Page MenuHomePhabricator

[lit] Fix testing of standalone clang and lld builds

Authored by jhenderson on Wed, May 26, 4:53 AM.



In such cases, the executables are not in the llvm_tools_dir directory, so we need to look in the other search locations. Previously, they were found via the PATH, but this was disabled by default in commit rGa1e6565.

Depends on D103154.

Diff Detail

Event Timeline

jhenderson created this revision.Wed, May 26, 4:53 AM
jhenderson requested review of this revision.Wed, May 26, 4:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptWed, May 26, 4:53 AM

Depends on D101354.


jhenderson edited the summary of this revision. (Show Details)Wed, May 26, 5:32 AM

Depends on D101354.


Thanks. Fixed.

D103154 seems to be making a lot of the same changes as this patch.

D103154 seems to be making a lot of the same changes as this patch.

Sorry, I stuffed up the diff in that patch - it shouldn't include the changes. Will fix.

Remove unrelated parts of diff.

Upload correct patch.

thopre accepted this revision.Thu, May 27, 1:42 AM


This revision is now accepted and ready to land.Thu, May 27, 1:42 AM

Rebase. I'll try landing this once the pre-merge checks complete, if there are no objections.

FYI: I'm off next week, so if this doesn't fix things, and the issue is an issue that needs resolving faster, I'd recommend reverting the original change.

kwk added a subscriber: kwk.Fri, May 28, 3:55 AM
This comment was removed by kwk.
kwk added a comment.Fri, May 28, 4:00 AM

I've applied this patch but for me clang still fails to build. I've build python-lit and clang in revision 1546c52d971292ed4145b6d41aaca0d02229ebff. And applied this patch on top.

[340/341] cd /builddir/build/BUILD/clang-13.0.0.src/x86_64-redhat-linux-gnu && /usr/bin/python3.9 /usr/bin/lit -sv --param USE_Z3_SOLVER=0 /builddir/build/BUILD/clang-13.0.0.src/x86_64-redhat-linux-gnu/tools/extra/test /builddir/build/BUILD/clang-13.0.0.src/x86_64-redhat-linux-gnu/tools/extra/clangd/test/../unittests /builddir/build/BUILD/clang-13.0.0.src/x86_64-redhat-linux-gnu/tools/extra/clangd/test /builddir/build/BUILD/clang-13.0.0.src/x86_64-redhat-linux-gnu/test
lit: /usr/lib/python3.9/site-packages/lit/llvm/ fatal: couldn't find 'clang' program, try setting CLANG in your environment
FAILED: CMakeFiles/check-all

These are the clang files in my mock environment:

$ find / -name "clang"

Ah, I see I missed that paths is reused in use_clang, before the call to use_llvm_tool. I'll fix that now.

Use the right set of paths in use_clang. This should fix the issue. If it doesn't I'll need someone who can reproduce to dig more into why it doesn't.

@kwk, could you try again please with the latest version of the patch? The code now looks at the same paths as are added to the PATH environment variable, so it should work.

thopre accepted this revision.Fri, May 28, 4:35 AM

New change LGTM, provided @kwk confirms it works for him.

kwk added a comment.Fri, May 28, 2:59 PM

@jhenderson @thopre it works for me now! Thank you!

@jhenderson @thopre it works for me now! Thank you!

Great, thanks for letting me know. I'm not going to be at a computer to be able to land this for the next week, so someone else can on my behalf if they wish. Otherwise it will be in a bit over a week's time before I do.

This revision was automatically updated to reflect the committed changes.