Skip to content

Commit 8dee95c

Browse files
committed
pyjnius: carry the test_jvm_options patch forward to 1.8.0
The nightly bump added 1.8.0 to docs/packages/pyjnius.yaml without a patches/pyjnius/1.8.0/ directory, so the test job's `git apply python-wheels/patches/pyjnius/1.8.0/*.patch` got the unexpanded glob and failed with "can't open patch" on every interpreter. The patch is still needed: upstream tests/test_jvm_options.py is byte-identical between 1.7.0 and 1.8.0, so the riscv64 JVM startup warning on stdout still breaks its json.loads. Copy it unchanged (it applies cleanly to the 1.8.0 tag) and mark 1.8.0 as patched like 1.7.0. Signed-off-by: Ludovic Henry <git@ludovic.dev>
1 parent 64b4edd commit 8dee95c

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎docs/packages/pyjnius.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ versions:
1515
- filename: pyjnius-1.7.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
1616
sha256: c5718bd952e193830626ba0884e54f418fa7efaaf2cf7bfc90803b56859d4f25
1717
- version: 1.8.0
18+
patched: true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Wed, 30 Sep 2026 00:00:00 +0000
4+
Subject: [PATCH] tests: tolerate a riscv64 JVM stdout warning in
5+
test_jvm_options
6+
7+
test_jvm_options spawns a subprocess that imports jnius (starting the JVM)
8+
and then json.dumps the JVM's own input arguments straight to stdout,
9+
which the parent process parses with json.loads(stdoutdata.decode()).
10+
11+
On riscv64 the JVM itself prints a startup diagnostic to stdout before
12+
any Python code runs:
13+
14+
WARNING: Not able to assign machine() = riscv64 to a cpu value!
15+
Using cpu = 'riscv64' instead!
16+
17+
That line lands ahead of the JSON in the same stdout stream, so
18+
json.loads sees "WARNING: ...\n[...]" and fails with
19+
JSONDecodeError: Expecting value: line 1 column 1 (char 0), even though
20+
the JVM started fine and the arguments round-tripped correctly. The
21+
child's own json.dump() output is always the last line written, so
22+
parse only that line instead of the whole stream.
23+
24+
Upstream-Status: To upstream [not yet submitted; riscv64-specific JVM startup diagnostic, no reference to check it against yet]
25+
26+
Signed-off-by: Ludovic Henry <git@ludovic.dev>
27+
---
28+
--- a/tests/test_jvm_options.py
29+
+++ b/tests/test_jvm_options.py
30+
@@ -27,5 +27,8 @@
31+
bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
32+
stdoutdata, _ = process.communicate(json.dumps(options).encode())
33+
assert process.wait() == 0
34+
- actual_options = json.loads(stdoutdata.decode())
35+
+ # The JVM itself can print a startup diagnostic to stdout ahead of
36+
+ # the child's own json.dump() output; that dump is always the last
37+
+ # line written, so parse only it.
38+
+ actual_options = json.loads(stdoutdata.decode().splitlines()[-1])
39+
assert list(sorted(options)) == list(sorted(actual_options))

0 commit comments

Comments
 (0)