@@ -2730,6 +2730,7 @@ def update_hpy_import_cmd(args):
2730
2730
hpy_repo_include_dir = join (hpy_repo_path , "hpy" , "devel" , "include" )
2731
2731
hpy_repo_src_dir = join (hpy_repo_path , "hpy" , "devel" , "src" )
2732
2732
hpy_repo_debug_dir = join (hpy_repo_path , "hpy" , "debug" )
2733
+ hpy_repo_trace_dir = join (hpy_repo_path , "hpy" , "trace" )
2733
2734
hpy_repo_test_dir = join (hpy_repo_path , "test" )
2734
2735
for d in [hpy_repo_path , hpy_repo_include_dir , hpy_repo_src_dir , hpy_repo_test_dir ]:
2735
2736
if not os .path .isdir (d ):
@@ -2843,7 +2844,8 @@ def exclude_files(*files):
2843
2844
tracker_file_src = join (hpy_repo_src_dir , "runtime" , "ctx_tracker.c" )
2844
2845
if not os .path .exists (tracker_file_src ):
2845
2846
mx .abort ("File '{}' is missing but required." .format (tracker_file_src ))
2846
- tracker_file_dest = join (mx .project ("com.oracle.graal.python.jni" ).dir , "src" , "ctx_tracker.c" )
2847
+ jni_project_dir = mx .project ("com.oracle.graal.python.jni" ).dir
2848
+ tracker_file_dest = join (jni_project_dir , "src" , "ctx_tracker.c" )
2847
2849
import_file (tracker_file_src , tracker_file_dest )
2848
2850
2849
2851
# tests go to 'com.oracle.graal.python.hpy.test/src/test'
@@ -2858,12 +2860,24 @@ def exclude_files(*files):
2858
2860
2859
2861
# debug mode goes into 'com.oracle.graal.python.jni/src/debug'
2860
2862
debugctx_src = join (hpy_repo_debug_dir , "src" )
2861
- debugctx_dest = join (mx . project ( "com.oracle.graal.python.jni" ). dir , "src" , "debug" )
2863
+ debugctx_dest = join (jni_project_dir , "src" , "debug" )
2862
2864
debugctx_hdr = join (debugctx_src , "include" , "hpy_debug.h" )
2863
2865
import_files (debugctx_src , debugctx_dest , exclude_files (
2864
2866
"autogen_debug_ctx_call.i" , "debug_ctx_cpython.c" , debugctx_hdr ))
2865
2867
import_file (debugctx_hdr , join (debugctx_dest , "hpy_debug.h" ))
2866
2868
2869
+ # trace Python sources go into 'lib-graalpython/module/hpy/trace'
2870
+ trace_files_dest = join (_get_core_home (), "modules" , "hpy" , "trace" )
2871
+ import_files (hpy_repo_debug_dir , trace_files_dest , exclude_subdir ("src" ))
2872
+ remove_inexistent_files (hpy_repo_trace_dir , trace_files_dest )
2873
+
2874
+ # trace mode goes into 'com.oracle.graal.python.jni/src/trace'
2875
+ tracectx_src = join (hpy_repo_trace_dir , "src" )
2876
+ tracectx_dest = join (jni_project_dir , "src" , "trace" )
2877
+ tracectx_hdr = join (tracectx_src , "include" , "hpy_trace.h" )
2878
+ import_files (tracectx_src , tracectx_dest , exclude_files (tracectx_hdr ))
2879
+ import_file (tracectx_hdr , join (tracectx_dest , "hpy_trace.h" ))
2880
+
2867
2881
# import 'version.py' by path and read '__version__'
2868
2882
from importlib import util
2869
2883
spec = util .spec_from_file_location ("version" , dest_version_file )
0 commit comments