This is an archive of the discontinued LLVM Phabricator instance.

[lit] Report tool path from use_llvm_tool if found via env variable
ClosedPublic

Authored by jhenderson on May 5 2021, 4:46 AM.

Details

Summary

Previously, if the search_env argument was specified, and the tool was found at that location, the path was not reported, unlike other situations when this function was called. Adding the reporting makes the function consistent.

Diff Detail

Event Timeline

jhenderson created this revision.May 5 2021, 4:46 AM
jhenderson requested review of this revision.May 5 2021, 4:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 4:46 AM
jhenderson added inline comments.May 5 2021, 4:48 AM
llvm/utils/lit/tests/use-tool-search-env.py
8

I'll fix this before landing this patch.

thopre added inline comments.May 5 2021, 4:57 AM
llvm/utils/lit/lit/llvm/config.py
414–416

Is the check for search_env needed?

jhenderson updated this revision to Diff 343015.May 5 2021, 5:42 AM
jhenderson marked an inline comment as done.

Address review comment and attempt to fix pre-merge check.

There was something odd going on with the slash direction in the %{inputs} on the pre-merge bot: despite being a Windows machine, it was using / as the path separator in the substitution. This isn't what happens for me locally on my Windows machine. Either way, the new approach uses %p which should work.

thopre accepted this revision.May 5 2021, 5:43 AM

LGTM, thanks!

This revision is now accepted and ready to land.May 5 2021, 5:43 AM
daltenty added inline comments.
llvm/utils/lit/tests/use-tool-search-env.py
8

Looks like this test has issues if the path has a symlink in it, we may need to call realpath somewhere?

https://lab.llvm.org/staging/#/builders/126/builds/345/steps/5/logs/FAIL__lit___use-tool-search-env_py

(/home/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/ is symlinked to /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le on the AIX builder)

jhenderson added inline comments.May 7 2021, 1:24 AM
llvm/utils/lit/tests/use-tool-search-env.py
8

Thanks. I've pushed a likely fix (see rGd2b2ad32b76989b68e7b525e7484e25b0f0cc4e6), but don't have an environment where I can easily verify it. I'll keep an eye on the build bot, but if my fix doesn't resolve the issue, I'll need someone else to take a look at it.

daltenty added inline comments.May 7 2021, 7:01 AM
llvm/utils/lit/tests/use-tool-search-env.py
8

Thanks for the quick fix! Seems to have resolved the issue.