This is an archive of the discontinued LLVM Phabricator instance.

[lit/libcxx] Fix a remaining reference to lit.util.capture() in custom libcxx/Darwin code.
ClosedPublic

Authored by dlj on Jun 29 2017, 3:56 PM.

Details

Event Timeline

dlj created this revision.Jun 29 2017, 3:56 PM
mzolotukhin accepted this revision.Jun 29 2017, 4:04 PM

Looks good to me (see one comment below)!

Thanks,
Michael

utils/libcxx/test/target_info.py
1

Undo this sneaked in change please.

This revision is now accepted and ready to land.Jun 29 2017, 4:04 PM
dlj updated this revision to Diff 104763.Jun 29 2017, 4:06 PM
dlj marked an inline comment as done.

Really update?

dlj updated this revision to Diff 104765.Jun 29 2017, 4:07 PM

One more time, with feeling. (LOL filesystems)

utils/libcxx/test/target_info.py
1

Done.

dlj closed this revision.Jun 29 2017, 4:07 PM

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

dlj added a comment.Jul 5 2017, 3:12 PM

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:

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

dlj added a comment.Jul 6 2017, 2:47 PM

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

Works for me. Fixed in r307320.