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

Disable Python compilation cache during build #7057

Merged
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions scripts/mk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2994,9 +2994,19 @@ def cp_z3py_to_build():
for f in files:
if f.endswith('.pyc'):
rmf(os.path.join(root, f))
# We do not want a second copy of the compiled files in the system-wide cache,
# so we disable it temporarily. This is an issue with recent versions of MacOS
# where XCode's Python has a cache, but the build scripts don't have access to
# it (e.g. during OPAM package installation).
have_cache = hasattr(sys, 'pycache_prefix') and sys.pycache_prefix != None
wintersteiger marked this conversation as resolved.
Show resolved Hide resolved
if have_cache:
pycache_prefix_before = sys.pycache_prefix
sys.pycache_prefix = None
# Compile Z3Py files
if compileall.compile_dir(z3py_src, force=1) != 1:
raise MKException("failed to compile Z3Py sources")
if have_cache:
sys.pycache_prefix = pycache_prefix_before
if is_verbose:
print("Generated python bytecode")
# Copy sources to build
Expand Down