File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2994,9 +2994,19 @@ def cp_z3py_to_build():
2994
2994
for f in files :
2995
2995
if f .endswith ('.pyc' ):
2996
2996
rmf (os .path .join (root , f ))
2997
+ # We do not want a second copy of the compiled files in the system-wide cache,
2998
+ # so we disable it temporarily. This is an issue with recent versions of MacOS
2999
+ # where XCode's Python has a cache, but the build scripts don't have access to
3000
+ # it (e.g. during OPAM package installation).
3001
+ have_cache = hasattr (sys , 'pycache_prefix' ) and sys .pycache_prefix is not None
3002
+ if have_cache :
3003
+ pycache_prefix_before = sys .pycache_prefix
3004
+ sys .pycache_prefix = None
2997
3005
# Compile Z3Py files
2998
3006
if compileall .compile_dir (z3py_src , force = 1 ) != 1 :
2999
3007
raise MKException ("failed to compile Z3Py sources" )
3008
+ if have_cache :
3009
+ sys .pycache_prefix = pycache_prefix_before
3000
3010
if is_verbose :
3001
3011
print ("Generated python bytecode" )
3002
3012
# Copy sources to build
You can’t perform that action at this time.
0 commit comments