Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always run compileall module with -b option #191

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions build_defs/python.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ def python_library(name:str, srcs:list=[], resources:list=[], deps:list=[], visi
if srcs or resources:
cmd = '$TOOLS_ARCAT z -d -o ${OUTS} -i .'
if srcs:
# This is a bit of a hack, but rather annoying. We want to put bytecode in its 'legacy' location
# in python3 because zipimport doesn't look in __pycache__. Unfortunately the flag doesn't exist
# in python2 so we have to guess whether we should apply it or not.
bytecode_flag = '-b' if 'python3' in interpreter or 'pypy3' in interpreter else ''
compile_cmd = f'$TOOLS_INT -S -m compileall {bytecode_flag} -f $SRCS_SRCS'
compile_cmd = f'$TOOLS_INT -S -m compileall -b -f $SRCS_SRCS'
if strip:
cmd = ' && '.join([compile_cmd, 'rm -f $SRCS_SRCS', cmd])
else:
Expand Down
Loading