[PATCH] D95339: [RFC][test] Adapt debug-info lit framework for more general purposes - part 1

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 07:38:35 PDT 2021


jhenderson added a comment.

In D95339#2633839 <https://reviews.llvm.org/D95339#2633839>, @jhenderson wrote:

> In D95339#2632968 <https://reviews.llvm.org/D95339#2632968>, @mehdi_amini wrote:
>
>>> either in build output or via environment variables
>>
>> This "magic" seems somehow fragile to me: if I have an old lldb installed and I run the cross-project tests with clang+lld+flang configured, it may run the lldb test and incorrectly fails `ninja check-all` because I only intended to test clang+lld+flang that I'm building/testing in the repo. Can this be controlled by a flag instead so there is an explicit opt-in to use a prebuilt tool? (`-DCROSS_PROJECT_LLDB_PATH=<path>` straw man).
>
> Yeah, I was in two minds about it. I followed the approach I did because discussing with others, it's sometimes desired to run some of the tests (I think the ones to do with dexter) with any old compiler, because how it gets compiled is somewhat unimportant.
>
> That being said, I don't think I'm changing anything with regards to LLDB at least. I'd be happy to change the behaviour so that you have to opt-in deliberately to using tools that aren't part of the explicit dependencies, if they can be found, but the obvious solution might impact other projects outside this area, so probably deserves a wider discussion on llvm-dev, if you think it's worth proceeding with that. I'll take a look and see what I can come up with.

I went back over the lit code. The behaviour of use_clang, use_lld and use_llvm_tool is as I thought: all three already look for the tool in the PATH. The build directory is first, so if the tool has just been built, it will already use that. Otherwise, it will find an installed tool. That appears to be by design. I guess people could opt-out of using preinstalled tools by omitting the installation directories from the PATH when running lit. Do we need something more than that?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95339/new/

https://reviews.llvm.org/D95339



More information about the llvm-commits mailing list