This reference to lit.util.capture is functionally identical to
subprocess.check_output, so this change switches to call the library routine
directly.
Details
Diff Detail
- Build Status
Buildable 7814 Build 7814: arc lint + arc unit
Event Timeline
Looks good to me (see one comment below)!
Thanks,
Michael
utils/libcxx/test/target_info.py | ||
---|---|---|
1 | Undo this sneaked in change please. |
One more time, with feeling. (LOL filesystems)
utils/libcxx/test/target_info.py | ||
---|---|---|
1 | Done. |
There are still more uses of lit.util.capture. I fixed one of them in r307201 (it broke PGO builds), but there are still some remaining:
./test/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./test/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./test/Unit/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./test/Unit/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./tools/clang/test/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./tools/clang/test/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./tools/clang/test/Unit/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./tools/clang/test/Unit/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
I wonder why they didn't cause any problems (or why we didn't find the problems). Do we need to change them the same way?
Michael
D'oh
/shamecube
./test/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./test/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./test/Unit/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./test/Unit/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./tools/clang/test/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./tools/clang/test/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() ./tools/clang/test/Unit/lit.cfg: llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() ./tools/clang/test/Unit/lit.cfg: llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()I wonder why they didn't cause any problems (or why we didn't find the problems).
So by my reading of those local config files, the calls are in the context of out-of-tree builds or other erroneous cases:
# Otherwise, we haven't loaded the site specific configuration (the user is # probably trying to run on a test file directly, and either the site # configuration hasn't been created by the build system, or we are in an # out-of-tree build situation).
All of my builds are out-of-tree (and CMake generates the files correctly), so I'm guessing the cases you found are some other configuration that triggers the same branch. I'm not sure how that would happen, but I'm pretty confident that it can.
Do we need to change them the same way?
I think that should work. (The Py2/Py3 differences shouldn't matter with llvm-config.) I'm not sure I will be able to test the fix, though, unless I can figure out how to repro.
Do you have any hints for how I might be able to tickle the errors you found?
Do you have any hints for how I might be able to tickle the errors you found?
I found this issue in our regular 2 stage PGO build (generate-profraw target from tools/clang/utils/perf-training/CMakeLists.txt invokes LIT tests). I think we should just replace all appearances of lit.util.capture with subprocess.check_output - at least, it shouldn't make things worse.
Michael
Undo this sneaked in change please.