86
86
87
87
MVN_REPOSITORY = os .getenv ("MVN_REPOSITORY" )
88
88
MVN_GRAALPY_VERSION = os .getenv ("MVN_GRAALPY_VERSION" ) if os .getenv ("MVN_GRAALPY_VERSION" ) else __graalpython__ .get_graalvm_version ()
89
-
89
+
90
90
CMD_NATIVE_EXECUTABLE = "native"
91
91
CMD_JAVA_PYTHON_APP = "polyglot_app"
92
92
ATTR_STANDALONE_CMD = "command"
@@ -141,7 +141,7 @@ def create_polyglot_app(parsed_args):
141
141
142
142
def get_download_dir (parsed_args ):
143
143
subdir = "downloaded_standalone_resources"
144
- mp = os .path .join (__graalpython__ .home , subdir )
144
+ mp = os .path .join (__graalpython__ .home , subdir )
145
145
try :
146
146
if not os .path .exists (mp ):
147
147
os .mkdir (mp )
@@ -168,32 +168,32 @@ def create_native_exec(parsed_args):
168
168
target_dir = tempfile .mkdtemp ()
169
169
try :
170
170
ni , jc = get_tools (target_dir , parsed_args )
171
-
171
+
172
172
modules_path = get_download_dir (parsed_args )
173
173
for artifact in artifacts :
174
174
download_maven_artifact (modules_path , artifact , parsed_args )
175
-
176
- launcher_file = os .path .join (target_dir , NATIVE_EXEC_LAUNCHER_FILE )
175
+
176
+ launcher_file = os .path .join (target_dir , NATIVE_EXEC_LAUNCHER_FILE )
177
177
create_target_directory (target_dir , launcher_file , parsed_args )
178
-
178
+
179
179
index_vfs (target_dir )
180
180
build_binary (target_dir , ni , jc , modules_path , launcher_file , parsed_args )
181
181
finally :
182
182
if not parsed_args .keep_temp :
183
183
shutil .rmtree (target_dir )
184
184
185
185
186
- def index_vfs (target_dir ):
186
+ def index_vfs (target_dir ):
187
187
files_list_path = os .path .join (target_dir , FILES_LIST_PATH )
188
- dir_to_list = os .path .join (target_dir , VFS_PREFIX )
188
+ dir_to_list = os .path .join (target_dir , VFS_PREFIX )
189
189
target_dir_len = len (target_dir )
190
190
with open (files_list_path , "w" ) as files_list :
191
191
def f (dir_path , names , line_end ):
192
192
rel_path = dir_path [target_dir_len :]
193
193
for name in names :
194
194
vfs_path = os .path .join (rel_path , name ).replace (os .sep , '/' )
195
195
files_list .write (f"{ vfs_path } { line_end } " )
196
- w = os .walk (dir_to_list )
196
+ w = os .walk (dir_to_list )
197
197
for (dir_path , dir_names , file_names ) in w :
198
198
f (dir_path , dir_names , "/\n " )
199
199
f (dir_path , file_names , "\n " )
@@ -393,7 +393,7 @@ def build_binary(target_dir, ni, jc, modules_path, launcher_file, parsed_args):
393
393
output = os .path .abspath (parsed_args .output )
394
394
os .chdir (target_dir )
395
395
396
- try :
396
+ try :
397
397
cmd = [jc , "-cp" , f"{ modules_path } /*" , launcher_file ]
398
398
if parsed_args .verbose :
399
399
print (f"Compiling code for Python standalone entry point: { ' ' .join (cmd )} " )
@@ -411,9 +411,6 @@ def build_binary(target_dir, ni, jc, modules_path, launcher_file, parsed_args):
411
411
"-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime" ,
412
412
"-Dpolyglot.engine.WarnInterpreterOnly=false" ,
413
413
]
414
- # Remove once GR-48563 is fixed
415
- if "Oracle GraalVM" in subprocess .check_output ([ni , "--version" ], text = True ):
416
- cmd .append ("-H:-OptConditionalMoves" )
417
414
cmd += [
418
415
"--no-fallback" ,
419
416
"-H:-CopyLanguageResources" ,
@@ -469,7 +466,7 @@ def main(args):
469
466
parser_app = subparsers .add_parser (
470
467
CMD_JAVA_PYTHON_APP ,
471
468
help = "Create a polyglot Java-Python maven project skeleton preconfigured to build native binaries." ,
472
- )
469
+ )
473
470
474
471
parser_app .add_argument (
475
472
"-g" ,
0 commit comments