Skip to content

Commit 7f3cede

Browse files
committed
Default to native compression backend on standalone
1 parent 5b6135d commit 7f3cede

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
182182
origArgs = new ArrayList<>();
183183
boolean posixBackendSpecified = false;
184184
boolean sha3BackendSpecified = false;
185+
boolean compressionBackendSpecified = false;
185186
boolean installSignalHandlersSpecified = false;
186187
boolean isolateNativeModulesSpecified = false;
187188
for (Iterator<String> argumentIterator = arguments.iterator(); argumentIterator.hasNext();) {
@@ -271,7 +272,8 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
271272
matchesPythonOption(arg, "StdLibHome") ||
272273
matchesPythonOption(arg, "CAPI") ||
273274
matchesPythonOption(arg, "PosixModuleBackend") ||
274-
matchesPythonOption(arg, "Sha3ModuleBackend")) {
275+
matchesPythonOption(arg, "Sha3ModuleBackend") ||
276+
matchesPythonOption(arg, "CompressionModulesBackend")) {
275277
addRelaunchArg(arg);
276278
}
277279
if (matchesPythonOption(arg, "PosixModuleBackend")) {
@@ -280,6 +282,9 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
280282
if (matchesPythonOption(arg, "Sha3ModuleBackend")) {
281283
sha3BackendSpecified = true;
282284
}
285+
if (matchesPythonOption(arg, "CompressionModulesBackend")) {
286+
compressionBackendSpecified = true;
287+
}
283288
if (matchesPythonOption(arg, "InstallSignalHandlers")) {
284289
installSignalHandlersSpecified = true;
285290
}
@@ -444,6 +449,9 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
444449
if (!sha3BackendSpecified) {
445450
polyglotOptions.put("python.Sha3ModuleBackend", "native");
446451
}
452+
if (!compressionBackendSpecified) {
453+
polyglotOptions.put("python.CompressionModulesBackend", "native");
454+
}
447455
if (!installSignalHandlersSpecified) {
448456
polyglotOptions.put("python.InstallSignalHandlers", "true");
449457
}

mx.graalpython/mx_graalpython.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,6 +2031,7 @@ def bytecode_dsl_build_args():
20312031
'--enable-native-access=org.graalvm.shadowed.jline',
20322032
'-Dpolyglot.python.PosixModuleBackend=native',
20332033
'-Dpolyglot.python.Sha3ModuleBackend=native',
2034+
'-Dpolyglot.python.CompressionModulesBackend=native',
20342035
] + bytecode_dsl_build_args(),
20352036
language='python',
20362037
default_vm_args=[

mx.graalpython/suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@
813813
'--enable-native-access=org.graalvm.shadowed.jline',
814814
"-Dpolyglot.python.PosixModuleBackend=native",
815815
"-Dpolyglot.python.Sha3ModuleBackend=native",
816+
"-Dpolyglot.python.CompressionModulesBackend=native",
816817
],
817818
"dynamicBuildArgs": "libpythonvm_build_args",
818819
},

0 commit comments

Comments
 (0)