This is an archive of the discontinued LLVM Phabricator instance.

Make OpenMP's lit.cfg python 3 compatible
ClosedPublic

Authored by thieta on Jan 28 2021, 11:46 PM.

Details

Summary

This fails currently like this:

llvm-lit: /Users/tobias/code/llvm-releases/12.0.0/rc1/llvm-project/llvm/utils/lit/lit/TestingConfig.py:99: fatal: unable to parse config file '/Users/tobias/code/llvm-releases/12.0.0/rc1/llvm-project/openmp/runtime/test/lit.cfg', traceback: Traceback (most recent call last):
  File "/Users/tobias/code/llvm-releases/12.0.0/rc1/Phase3/Release/llvmCore-12.0.0-rc1.obj/bin/../../../../llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/Users/tobias/code/llvm-releases/12.0.0/rc1/llvm-project/openmp/runtime/test/lit.cfg", line 82, in <module>
    config.test_flags += " -isysroot " + out
TypeError: can only concatenate str (not "bytes") to str

Diff Detail

Event Timeline

thieta created this revision.Jan 28 2021, 11:46 PM
thieta requested review of this revision.Jan 28 2021, 11:46 PM

Next time please provide the full context of the change as suggested in the guide: https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface

openmp/runtime/test/lit.cfg
79

Isn't strip() also a string method? I'd expect that you want to decode first, then strip.

thieta added inline comments.Jan 29 2021, 3:36 AM
openmp/runtime/test/lit.cfg
79

strip() works on byte objects as well as far as I can understand the python docs.

Next time please provide the full context of the change as suggested in the guide: https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface

Ah yeah I can make sure to do that. I usually do but I was lazy since I did the patch on a remote machine without arc. But will try to not take shortcuts in the future!

protze.joachim accepted this revision.Jan 29 2021, 3:50 AM

Ok, I found bytes.strip() in the documentation.
LGTM

This revision is now accepted and ready to land.Jan 29 2021, 3:50 AM
This revision was automatically updated to reflect the committed changes.