Skip to content

Commit

Permalink
Disable Python compilation cache during build (#7052)
Browse files Browse the repository at this point in the history
* Disable Python compilation cache during build

* Fix var name
  • Loading branch information
wintersteiger committed Dec 14, 2023
1 parent 3ebec56 commit 8293be8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/mk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2994,9 +2994,16 @@ 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).
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")
sys.pycache_prefix = pycache_prefix_before
if is_verbose:
print("Generated python bytecode")
# Copy sources to build
Expand Down

0 comments on commit 8293be8

Please sign in to comment.