Skip to content

Commit 789403b

Browse files
committed
[GR-48563] Remove workaround for enterprise compiler
1 parent e66d436 commit 789403b

File tree

1 file changed

+11
-14
lines changed
  • graalpython/lib-graalpython/modules/standalone

1 file changed

+11
-14
lines changed

graalpython/lib-graalpython/modules/standalone/__main__.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
MVN_REPOSITORY = os.getenv("MVN_REPOSITORY")
8888
MVN_GRAALPY_VERSION = os.getenv("MVN_GRAALPY_VERSION") if os.getenv("MVN_GRAALPY_VERSION") else __graalpython__.get_graalvm_version()
89-
89+
9090
CMD_NATIVE_EXECUTABLE = "native"
9191
CMD_JAVA_PYTHON_APP = "polyglot_app"
9292
ATTR_STANDALONE_CMD = "command"
@@ -141,7 +141,7 @@ def create_polyglot_app(parsed_args):
141141

142142
def get_download_dir(parsed_args):
143143
subdir = "downloaded_standalone_resources"
144-
mp = os.path.join(__graalpython__.home, subdir)
144+
mp = os.path.join(__graalpython__.home, subdir)
145145
try:
146146
if not os.path.exists(mp):
147147
os.mkdir(mp)
@@ -168,32 +168,32 @@ def create_native_exec(parsed_args):
168168
target_dir = tempfile.mkdtemp()
169169
try:
170170
ni, jc = get_tools(target_dir, parsed_args)
171-
171+
172172
modules_path = get_download_dir(parsed_args)
173173
for artifact in artifacts:
174174
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)
177177
create_target_directory(target_dir, launcher_file, parsed_args)
178-
178+
179179
index_vfs(target_dir)
180180
build_binary(target_dir, ni, jc, modules_path, launcher_file, parsed_args)
181181
finally:
182182
if not parsed_args.keep_temp:
183183
shutil.rmtree(target_dir)
184184

185185

186-
def index_vfs(target_dir):
186+
def index_vfs(target_dir):
187187
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)
189189
target_dir_len = len(target_dir)
190190
with open(files_list_path, "w") as files_list:
191191
def f(dir_path, names, line_end):
192192
rel_path = dir_path[target_dir_len:]
193193
for name in names:
194194
vfs_path = os.path.join(rel_path, name).replace(os.sep, '/')
195195
files_list.write(f"{vfs_path}{line_end}")
196-
w = os.walk(dir_to_list)
196+
w = os.walk(dir_to_list)
197197
for (dir_path, dir_names, file_names) in w:
198198
f(dir_path, dir_names, "/\n")
199199
f(dir_path, file_names, "\n")
@@ -393,7 +393,7 @@ def build_binary(target_dir, ni, jc, modules_path, launcher_file, parsed_args):
393393
output = os.path.abspath(parsed_args.output)
394394
os.chdir(target_dir)
395395

396-
try:
396+
try:
397397
cmd = [jc, "-cp", f"{modules_path}/*", launcher_file]
398398
if parsed_args.verbose:
399399
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):
411411
"-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime",
412412
"-Dpolyglot.engine.WarnInterpreterOnly=false",
413413
]
414-
# Remove once GR-48563 is fixed
415-
if "Oracle GraalVM" in subprocess.check_output([ni, "--version"], text=True):
416-
cmd.append("-H:-OptConditionalMoves")
417414
cmd += [
418415
"--no-fallback",
419416
"-H:-CopyLanguageResources",
@@ -469,7 +466,7 @@ def main(args):
469466
parser_app = subparsers.add_parser(
470467
CMD_JAVA_PYTHON_APP,
471468
help="Create a polyglot Java-Python maven project skeleton preconfigured to build native binaries.",
472-
)
469+
)
473470

474471
parser_app.add_argument(
475472
"-g",

0 commit comments

Comments
 (0)