This is an archive of the discontinued LLVM Phabricator instance.

llvm-lit.in: specify file encoding to UTF-8
ClosedPublic

Authored by davispuh on Aug 2 2018, 2:27 PM.

Details

Summary

This is needed because otherwise if source dir is at location whose path
contains non-ASCII character then python will complain about SyntaxError

SyntaxError: Non-ASCII character '\xc4' in file /home/Dāvis/libc++/src/build/bin/llvm-lit on line 16, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Diff Detail

Repository
rL LLVM

Event Timeline

davispuh created this revision.Aug 2 2018, 2:27 PM
davispuh updated this revision to Diff 158838.Aug 2 2018, 2:32 PM

Fix mistake

Generated llvm-lit looks like this (in UTF-8)

...
# Variables configured at build time.
llvm_source_root = "/home/Dāvis/libc++/src/llvm"
llvm_obj_root = "/home/Dāvis/libc++/src/build"

# Make sure we can find the lit package.
sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))

# Set up some builtin parameters, so that by default the LLVM test suite
# configuration file knows how to find the object tree.
builtin_parameters = { 'build_mode' : "." }


map_config('/home/Dāvis/libc++/src/llvm/projects/libcxx/test/lit.cfg', '/home/Dāvis/libc++/src/build/projects/libcxx/test/lit.site.cfg')
map_config('/home/Dāvis/libc++/src/llvm/utils/lit/tests/lit.cfg', '/home/Dāvis/libc++/src/build/utils/lit/lit.site.cfg')
map_config('/home/Dāvis/libc++/src/llvm/test/lit.cfg.py', '/home/Dāvis/libc++/src/build/test/lit.site.cfg.py')
map_config('/home/Dāvis/libc++/src/llvm/test/Unit/lit.cfg.py', '/home/Dāvis/libc++/src/build/test/Unit/lit.site.cfg.py')

...
george.karpenkov accepted this revision.Aug 2 2018, 2:40 PM
george.karpenkov added a subscriber: george.karpenkov.

Sounds reasonable, and I don't see it possibly backfiring.

This revision is now accepted and ready to land.Aug 2 2018, 2:40 PM

This issue is still present, why it hasn't been merged?

@davispuh Someone needs to actually merge the change. Usually, the person who has opened the revision does it, but if they don't have it commit access the reviewer can do it for them (but then it is usually explicitly requested).
Would you like me to merge this?

@davispuh Someone needs to actually merge the change. Usually, the person who has opened the revision does it, but if they don't have it commit access the reviewer can do it for them (but then it is usually explicitly requested).
Would you like me to merge this?

Ohh, sorry, I didn't know that. I thought it would be automatically merged once accepted. And yeah I don't have commit access so of course that would be nice. Thanks!

This revision was automatically updated to reflect the committed changes.