Skip to content

Commit cb54db2

Browse files
committed
Fix coverage launcher to work with hpy tests
1 parent 348b536 commit cb54db2

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

mx.graalpython/downstream_tests.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,6 @@ def downstream_test_hpy(graalpy, testdir=None, args=None, env=None, check=True,
7676
hpy_test_root = hpy_root / "test"
7777
venv = testdir / 'hpy_venv'
7878
run([graalpy, "-m", "venv", str(venv)])
79-
if graalpy.endswith('.sh'):
80-
# Workaround jacoco launcher creating broken venv
81-
venv_launcher_path = venv / "bin" / "graalpy.sh"
82-
launcher = venv_launcher_path.read_text()
83-
venv_launcher_path.unlink()
84-
launcher = launcher.replace(
85-
'--python.Executable=',
86-
f'--python.Executable={venv_launcher_path.absolute()} --python.BaseExecutable=',
87-
)
88-
venv_launcher_path.write_text(launcher)
89-
venv_launcher_path.chmod(0o755)
90-
run([str(venv_launcher_path), '-m', 'ensurepip', '--default-pip'])
9179
run_in_venv(venv, ["pip", "install", "pytest", "pytest-xdist", "pytest-rerunfailures!=16.0", "filelock"])
9280
env = env or os.environ.copy()
9381
env["SETUPTOOLS_SCM_PRETEND_VERSION"] = "0.9.0"

mx.graalpython/mx_graalpython.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ def graalvm_vm_arg(java_arg):
10191019
if sys.platform != 'win32':
10201020
coverage_launcher = original_launcher + "_cov"
10211021
c_launcher_source = coverage_launcher + ".c"
1022-
exe_arg = f"--python.Executable={coverage_launcher}"
10231022
agent_args_list = shlex.split(agent_args)
10241023
extra_args_c = []
10251024
for arg in agent_args_list:
@@ -1033,9 +1032,8 @@ def graalvm_vm_arg(java_arg):
10331032
int main(int argc, char **argv) {{
10341033
char *new_args[argc + 3 + {len(agent_args_list)}];
10351034
int arg_index = 0;
1036-
new_args[arg_index++] = "{original_launcher}";
1035+
new_args[arg_index++] = argv[0];
10371036
new_args[arg_index++] = "--jvm";
1038-
new_args[arg_index++] = "{exe_arg}";
10391037
{extra_args_c}
10401038
for (int i = 1; i < argc; i++) {{
10411039
new_args[arg_index++] = argv[i];

0 commit comments

Comments
 (0)