Skip to content

Commit 066852e

Browse files
pyjnius: Add versions 1.8.0, 1.9.0
Signed-off-by: riseproject-dev[bot] <330740410+riseproject-dev[bot]@users.noreply.github.com>
1 parent 041007f commit 066852e

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

‎docs/packages/pyjnius.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ versions:
1414
sha256: 3bf5ee52e57bc18b6ac6e9b56c74e033413bba95455b6280b0744e0655b7b3f0
1515
- filename: pyjnius-1.7.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
1616
sha256: c5718bd952e193830626ba0884e54f418fa7efaaf2cf7bfc90803b56859d4f25
17+
- version: 1.8.0
18+
- version: 1.9.0
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))
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)