Skip to content

Commit 5781657

Browse files
committed
make sure we still add the C api headers
1 parent 261d06e commit 5781657

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,18 @@ def __str__(self):
11471147
def run(self, args, env, cwd):
11481148
return do_run_python(args, env=env, cwd=cwd)
11491149

1150+
def _prepare_headers(self):
1151+
# This should only be done for the base task, otherwise we'll duplicate
1152+
# the work. This is a development-time thing, because we need the
1153+
# include directory for the C API to be next to lib-graalpython
1154+
if type(self) == GraalpythonCAPIBuildTask:
1155+
target_dir = os.path.join(SUITE.dir, "graalpython", "include")
1156+
if os.path.exists(target_dir):
1157+
shutil.rmtree(target_dir)
1158+
shutil.copytree(os.path.join(self.src_dir(), "include"), target_dir)
1159+
11501160
def build(self):
1161+
self._prepare_headers()
11511162
env = os.environ.copy()
11521163
cwd = os.path.join(self.subject.get_output_root(), "mxbuild_temp")
11531164
args = []

mx.graalpython/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@
346346
"extracted-dependency:graalpython:GRAALPYTHON_PYTHON_LIB",
347347
"file:mx.graalpython/native-image.properties",
348348
"file:graalpython/lib-graalpython",
349+
"file:graalpython/com.oracle.graal.python.cext/include",
349350
],
350351
"./lib-graalpython/": [
351352
"dependency:graalpython:com.oracle.graal.python.cext/*",

0 commit comments

Comments
 (0)