diff --git a/docs/packages/pyjnius.yaml b/docs/packages/pyjnius.yaml index ce9e82057832..effcdcdab415 100644 --- a/docs/packages/pyjnius.yaml +++ b/docs/packages/pyjnius.yaml @@ -14,3 +14,5 @@ versions: sha256: 3bf5ee52e57bc18b6ac6e9b56c74e033413bba95455b6280b0744e0655b7b3f0 - filename: pyjnius-1.7.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl sha256: c5718bd952e193830626ba0884e54f418fa7efaaf2cf7bfc90803b56859d4f25 +- version: 1.8.0 +- version: 1.9.0 diff --git a/patches/pyjnius/1.8.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch b/patches/pyjnius/1.8.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch new file mode 100644 index 000000000000..244ac0b0be07 --- /dev/null +++ b/patches/pyjnius/1.8.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Wed, 30 Sep 2026 00:00:00 +0000 +Subject: [PATCH] tests: tolerate a riscv64 JVM stdout warning in + test_jvm_options + +test_jvm_options spawns a subprocess that imports jnius (starting the JVM) +and then json.dumps the JVM's own input arguments straight to stdout, +which the parent process parses with json.loads(stdoutdata.decode()). + +On riscv64 the JVM itself prints a startup diagnostic to stdout before +any Python code runs: + + WARNING: Not able to assign machine() = riscv64 to a cpu value! + Using cpu = 'riscv64' instead! + +That line lands ahead of the JSON in the same stdout stream, so +json.loads sees "WARNING: ...\n[...]" and fails with +JSONDecodeError: Expecting value: line 1 column 1 (char 0), even though +the JVM started fine and the arguments round-tripped correctly. The +child's own json.dump() output is always the last line written, so +parse only that line instead of the whole stream. + +Upstream-Status: To upstream [not yet submitted; riscv64-specific JVM startup diagnostic, no reference to check it against yet] + +Signed-off-by: Ludovic Henry +--- +--- a/tests/test_jvm_options.py ++++ b/tests/test_jvm_options.py +@@ -27,5 +27,8 @@ + bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + stdoutdata, _ = process.communicate(json.dumps(options).encode()) + assert process.wait() == 0 +- actual_options = json.loads(stdoutdata.decode()) ++ # The JVM itself can print a startup diagnostic to stdout ahead of ++ # the child's own json.dump() output; that dump is always the last ++ # line written, so parse only it. ++ actual_options = json.loads(stdoutdata.decode().splitlines()[-1]) + assert list(sorted(options)) == list(sorted(actual_options)) diff --git a/patches/pyjnius/1.9.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch b/patches/pyjnius/1.9.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch new file mode 100644 index 000000000000..244ac0b0be07 --- /dev/null +++ b/patches/pyjnius/1.9.0/0001-tests-tolerate-a-riscv64-JVM-stdout-warning-in-test_jvm_options.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Wed, 30 Sep 2026 00:00:00 +0000 +Subject: [PATCH] tests: tolerate a riscv64 JVM stdout warning in + test_jvm_options + +test_jvm_options spawns a subprocess that imports jnius (starting the JVM) +and then json.dumps the JVM's own input arguments straight to stdout, +which the parent process parses with json.loads(stdoutdata.decode()). + +On riscv64 the JVM itself prints a startup diagnostic to stdout before +any Python code runs: + + WARNING: Not able to assign machine() = riscv64 to a cpu value! + Using cpu = 'riscv64' instead! + +That line lands ahead of the JSON in the same stdout stream, so +json.loads sees "WARNING: ...\n[...]" and fails with +JSONDecodeError: Expecting value: line 1 column 1 (char 0), even though +the JVM started fine and the arguments round-tripped correctly. The +child's own json.dump() output is always the last line written, so +parse only that line instead of the whole stream. + +Upstream-Status: To upstream [not yet submitted; riscv64-specific JVM startup diagnostic, no reference to check it against yet] + +Signed-off-by: Ludovic Henry +--- +--- a/tests/test_jvm_options.py ++++ b/tests/test_jvm_options.py +@@ -27,5 +27,8 @@ + bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + stdoutdata, _ = process.communicate(json.dumps(options).encode()) + assert process.wait() == 0 +- actual_options = json.loads(stdoutdata.decode()) ++ # The JVM itself can print a startup diagnostic to stdout ahead of ++ # the child's own json.dump() output; that dump is always the last ++ # line written, so parse only it. ++ actual_options = json.loads(stdoutdata.decode().splitlines()[-1]) + assert list(sorted(options)) == list(sorted(actual_options))