Skip to content

Commit d5bb132

Browse files
committed
Move pyc cache into mxbuild dir for C API build.
1 parent 7d5fb53 commit d5bb132

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,14 +1690,18 @@ def build(self):
16901690
mx.ensure_dir_exists(os.path.join(self.subject.get_output_root(), "modules"))
16911691

16921692
cwd = os.path.join(self.subject.get_output_root(), "mxbuild_temp")
1693+
pycache_dir = os.path.join(self.subject.get_output_root(), "__pycache__")
16931694
args = []
16941695
if mx._opts.verbose:
16951696
args.append("-v")
16961697
else:
16971698
# always add "-q" if not verbose to suppress hello message
16981699
args.append("-q")
16991700

1700-
args += ["--python.WithThread", "-S", os.path.join(self.src_dir(), "setup.py"), self.subject.get_output_root()]
1701+
args += ["--python.WithThread",
1702+
"--python.PyCachePrefix=" + pycache_dir,
1703+
"-S", os.path.join(self.src_dir() , "setup.py"),
1704+
self.subject.get_output_root()]
17011705
mx.ensure_dir_exists(cwd)
17021706
rc = self.run(args, cwd=cwd)
17031707
shutil.rmtree(cwd) # remove the temporary build files

0 commit comments

Comments
 (0)