This is an archive of the discontinued LLVM Phabricator instance.

[LIT] Allow suite configs to be preloaded allowing for better support of out-of-dir builds.
AbandonedPublic

Authored by EricWF on Nov 14 2014, 11:51 AM.

Details

Summary

This patch was inspired by the following use case when testing libc++:

  • The lit.site.cfg is in build-libcxx/test/lit.site.cfg
  • Your working out of libcxx/test

Currently the only solution is to copy or symlink the generated lit.site.cfg into the source tree and then teach your VCS to ignore it. This patch allows the user to manually specify configuration files to load. It works by pre-loading the suite configuration file cache. The configuration files can be specified one of two ways:

  • using the --config command line parameter
  • using the LIT_CONFIG environment variable.

The configuration files specified using --config are loaded before the ones in LIT_CONFIG. configuration files with the same path or the same test source path are not loaded twice.

@ddunbar If you disagree with this direction please let me know.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 16233.Nov 14 2014, 11:51 AM
EricWF retitled this revision from to [LIT] Allow suite configs to be reloaded allowing for better support of out-of-dir builds..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: ddunbar, danalbert, jroelofs.
EricWF set the repository for this revision to rL LLVM.
EricWF added subscribers: Unknown Object (MLST), Unknown Object (MLST), ddunbar.
EricWF retitled this revision from [LIT] Allow suite configs to be reloaded allowing for better support of out-of-dir builds. to [LIT] Allow suite configs to be preloaded allowing for better support of out-of-dir builds..Nov 15 2014, 1:12 AM
EricWF abandoned this revision.Dec 9 2014, 11:59 AM

I really don't like this patch. There was some suggestion that this feature would go nicely is LIT but I think it's better implemented on a test-suite basis.

ddunbar edited edge metadata.Dec 9 2014, 7:52 PM

I sympathize with the use case, and in fact if you look at LLVM and Clang's
config files they have code which tries to do a trick where if it finds it
is running in the source without a lit.site.cfg, then it tries to infer the
location of the actual exec_root by seeing if you are the kind of user who
puts such things in your path. It's messy and only works for some users and
is complicated, so I'm ultimately not a big fan of that solution, but it
was the first thing I came up with.

The next thing I came up with was the idea of building a tool that baked in
the path to the config file, that is llvm-lit. I'm not all that happy with
that approach either.r

Why did you decide you didn't like this patch?

  • Daniel
EricWF added a comment.Dec 9 2014, 8:02 PM

It just seemed like an ugly patch and the wrong way to do things. As you mentioned both clang and LLVM already provide similar functionality at almost no extra cost compared to this patch. For that reason it doesn't make sense to dirty up lit to achieve these goals.