Skip to content

Commit 8d0faaa

Browse files
committed
[GR-21590] Update imports.
PullRequest: graalpython/4030
2 parents b283db0 + 09d8e2b commit 8d0faaa

File tree

6 files changed

+44
-18
lines changed

6 files changed

+44
-18
lines changed

ci/graal/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.62.0",
7+
"mx_version": "7.62.2",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {

docs/site/03-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ img.pylogo {
6666
<script>
6767
DB.ANY_VERSION = "any";
6868
DB.INSTALLS_BUT_FAILS_TESTS = "The package installs, but the test suite was not set up for GraalPy.";
69-
DB.FAILS_TO_INSTALL = "The package fails to build or install.";
69+
DB.FAILS_TO_INSTALL = "We have been unable to build, install, or run tests for this package.";
7070
DB.UNSUPPORTED = "The package is unsupported.";
7171
DB.PERCENT_PASSING = (pct) => `${pct}% of the tests are passing on GraalPy.`;
7272
const PATCH_AVAILABLE = "GraalPy will automatically apply a patch when installing this package to improve compatibility.";

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_contextlib.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test.test_contextlib.ContextManagerTestCase.test_contextmanager_trap_yield_after
1818
test.test_contextlib.ContextManagerTestCase.test_contextmanager_wrap_runtimeerror @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
1919
test.test_contextlib.ContextManagerTestCase.test_instance_docstring_given_cm_docstring @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
2020
test.test_contextlib.ContextManagerTestCase.test_keywords @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
21-
test.test_contextlib.ContextManagerTestCase.test_nokeepref @ darwin-arm64,win32-AMD64
21+
test.test_contextlib.ContextManagerTestCase.test_nokeepref @ darwin-arm64,linux-aarch64,linux-x86_64,win32-AMD64
2222
test.test_contextlib.ContextManagerTestCase.test_param_errors @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
2323
test.test_contextlib.ContextManagerTestCase.test_recursive @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
2424
test.test_contextlib.FileContextTestCase.testWithOpen @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_cprofile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test.test_cprofile.CProfileTest.test_output_file_when_changing_directory @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
22
# transient: inconsistent running time [GR-67706]
33
!test.test_cprofile.CProfileTest.test_run_profile_as_module @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
4-
test.test_cprofile.CProfileTest.test_throw @ darwin-arm64,darwin-x86_64,linux-x86_64,win32-AMD64
4+
test.test_cprofile.CProfileTest.test_throw @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
55
test.test_cprofile.TestCommandLine.test_sort @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
66
test.test_profile.ProfileTest.test_calling_conventions @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64
77
test.test_profile.ProfileTest.test_cprofile @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64,win32-AMD64

mx.graalpython/mx_graalpython.py

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,24 +1014,50 @@ def graalvm_vm_arg(java_arg):
10141014
agent_args = ' '.join(graalvm_vm_arg(arg) for arg in mx_gate.get_jacoco_agent_args() or [])
10151015

10161016
# We need to make sure the arguments get passed to subprocesses, so we create a temporary launcher
1017-
# with the arguments. We also disable compilation, it hardly helps for this use case
1017+
# with the arguments.
10181018
original_launcher = os.path.abspath(os.path.realpath(launcher))
10191019
if sys.platform != 'win32':
1020-
coverage_launcher = original_launcher + '.sh'
1021-
preamble = '#!/bin/sh'
1022-
pass_args = '"$@"'
1020+
coverage_launcher = original_launcher + "_cov"
1021+
c_launcher_source = coverage_launcher + ".c"
1022+
exe_arg = f"--python.Executable={coverage_launcher}"
1023+
agent_args_list = shlex.split(agent_args)
1024+
extra_args_c = []
1025+
for i, arg in enumerate(agent_args_list):
1026+
extra_args_c.append(f'new_args[{i + 3}] = "' + arg.replace("\"", r"\"") + '";')
1027+
extra_args_c = ' '.join(extra_args_c)
1028+
c_code = dedent(f"""\
1029+
#include <stdio.h>
1030+
#include <stdlib.h>
1031+
#include <unistd.h>
1032+
1033+
int main(int argc, char **argv) {{
1034+
char *new_args[argc + 3 + {len(agent_args_list)}];
1035+
new_args[0] = "{original_launcher}";
1036+
new_args[1] = "--jvm";
1037+
new_args[2] = "{exe_arg}";
1038+
{extra_args_c}
1039+
for (int i = 1; i < argc; i++) {{
1040+
new_args[i + 3 + {len(agent_args_list)}] = argv[i];
1041+
}}
1042+
new_args[argc + 3 + {len(agent_args_list)}] = NULL;
1043+
execvp("{original_launcher}", new_args);
1044+
perror("execvp failed");
1045+
return 1;
1046+
}}
1047+
""")
1048+
with open(c_launcher_source, "w") as f:
1049+
f.write(c_code)
1050+
compile_cmd = ["cc", c_launcher_source, "-o", coverage_launcher]
1051+
subprocess.check_call(compile_cmd)
1052+
os.chmod(coverage_launcher, 0o775)
10231053
else:
10241054
coverage_launcher = original_launcher.replace('.exe', '.cmd')
10251055
# Windows looks for libraries on PATH, we need to add the jvm bin dir there or it won't find the instrumentation dlls
10261056
jvm_bindir = os.path.join(os.path.dirname(os.path.dirname(original_launcher)), 'jvm', 'bin')
1027-
preamble = f'@echo off\nset PATH=%PATH%;{jvm_bindir}'
1028-
pass_args = '%*'
1029-
with open(coverage_launcher, "w") as f:
1030-
f.write(f'{preamble}\n')
1031-
exe_arg = quote(f"--python.Executable={coverage_launcher}")
1032-
f.write(f'{original_launcher} --jvm {exe_arg} {agent_args} {pass_args}\n')
1033-
if sys.platform != 'win32':
1034-
os.chmod(coverage_launcher, 0o775)
1057+
with open(coverage_launcher, "w") as f:
1058+
f.write(f'@echo off\nset PATH=%PATH%;{jvm_bindir}\n')
1059+
exe_arg = quote(f"--python.Executable={coverage_launcher}")
1060+
f.write(f'{original_launcher} --jvm {exe_arg} {agent_args} %*\n')
10351061
mx.log(f"Replaced {launcher} with {coverage_launcher} to collect coverage")
10361062
launcher = coverage_launcher
10371063
return launcher

mx.graalpython/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
},
5454
{
5555
"name": "tools",
56-
"version": "b1181d14631c6760fd72c5eb441ad1aeca1f937f",
56+
"version": "b862bbf602252edc38d61ab86191a2fb5cfacd76",
5757
"subdir": True,
5858
"urls": [
5959
{"url": "https://github.com/oracle/graal", "kind": "git"},
6060
],
6161
},
6262
{
6363
"name": "regex",
64-
"version": "b1181d14631c6760fd72c5eb441ad1aeca1f937f",
64+
"version": "b862bbf602252edc38d61ab86191a2fb5cfacd76",
6565
"subdir": True,
6666
"urls": [
6767
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)