The check-* targets run ${Python3_EXECUTABLE} $BUILD/bin/llvm-lit, but
running ./bin/llvm-lit $ARGS from the build directory currently always
uses "python" to run llvm-lit. On most systems this will be python2.7 even
if we found python3 at CMake time.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn | ||
---|---|---|
89 | I'm not sure about this, since I haven't ever used GN but it seems to match what other files are doing. |
I'm not sure that there is a better way to accomplish this other than the replacement from configure_file.
This puts #!/usr/bin/python3.8 instead of #!/usr/bin/env python3.8 in llvm-bulid/bin/llvm-lit (in a cmake build). That seems undesirable?
(ps: No need to touch files in llvm/utils/gn at all, keeping that code updates is up to folks using the gn build.)
(I fixed this in the GN build in rGc88a77620436ee475d54d3b5ced30286101e0dc9 and don't care all that much about what happens in the cmake build, so if y'all are happy with what currently happens, it's fine to not change anything here, but it looks strange to me.)
CMake should give an absolute path for Python3_EXECUTABLE . However, I'm not sure if that is also true if you specify it manually on the command line. I guess the same fix as the GN one would work for CMake.
This works very badly on Windows. You get:
#!C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe
MSys bash doesn't like that shebang line. It works if I say "python bin/llvm-lit.py ...", but who likes to spell things out? I guess I just have to live with it.
I'm not sure about this, since I haven't ever used GN but it seems to match what other files are doing.