From e8ded6cb88ea4fc4b75475fb7f60aa084d3102f5 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 07:25:58 +0000 Subject: [PATCH 1/3] jdk4py: Add version 25.0.2.1 --- .github/workflows/build-jdk4py.yml | 163 +++++++++++++++++++++++++++++ docs/packages/jdk4py.yaml | 5 + 2 files changed, 168 insertions(+) create mode 100644 .github/workflows/build-jdk4py.yml create mode 100644 docs/packages/jdk4py.yaml diff --git a/.github/workflows/build-jdk4py.yml b/.github/workflows/build-jdk4py.yml new file mode 100644 index 00000000000..a7accecec1b --- /dev/null +++ b/.github/workflows/build-jdk4py.yml @@ -0,0 +1,163 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: +# https://github.com/activeviam/jdk4py/blob/d50c00c85b49e1ab1c9dd0f8dcfbd54767fc9b00/.github/actions/build-java-runtime/action.yaml +# https://github.com/activeviam/jdk4py/blob/d50c00c85b49e1ab1c9dd0f8dcfbd54767fc9b00/.github/actions/build-python-wheel/action.yaml +name: Build jdk4py wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/jdk4py.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-jdk4py.yml' + - 'docs/packages/jdk4py.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-jdk4py.yml' + - 'docs/packages/jdk4py.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + # Upstream cuts releases by pushing to main and publishing via trusted + # publishing; it never pushes a git tag. This commit's pyproject.toml reads + # 25.0.2.1 and its src/jdk4py/*.py are byte-identical to the files inside + # the released manylinux_2_17_x86_64/aarch64 wheels. Update it alongside + # JDK4PY_VERSION. + JDK4PY_REF: d50c00c85b49e1ab1c9dd0f8dcfbd54767fc9b00 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: jdk4py + version: ${{ inputs.version }} + + build_wheel: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + name: Build jdk4py ${{ matrix.version }} py3-none-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 30 + + env: + JDK4PY_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout jdk4py ${{ env.JDK4PY_REF }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: activeviam/jdk4py + ref: ${{ env.JDK4PY_REF }} + persist-credentials: false + + - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + version-file: pyproject.toml + python-version: '3.12' + activate-environment: true + enable-cache: false + + - id: get-java-version + run: uv run python -c 'from jdk4py import JAVA_VERSION; print(f"""version={".".join(str(number) for number in JAVA_VERSION)}""")' >> "$GITHUB_OUTPUT" + + # actions/setup-java lists riscv64 as a supported Temurin/linux + # architecture; it does not auto-detect it from a self-hosted runner. + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 + with: + distribution: temurin + java-version: ${{ steps.get-java-version.outputs.version }} + architecture: riscv64 + + - run: uv run python build_java_runtime.py + + - run: uv build --wheel + + - run: uv run python -m wheel tags --platform-tag manylinux_2_39_riscv64 --remove dist/*-py3-none-any.whl + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: jdk4py-${{ env.JDK4PY_VERSION }}-py3-none-manylinux_riscv64 + path: dist/*.whl + if-no-files-found: error + + test_wheel: + name: Test jdk4py ${{ matrix.version }} on Python ${{ matrix.python-version }} + needs: [setup, build_wheel] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python-version: ['3.12', '3.13', '3.14', '3.14t'] + + env: + JDK4PY_VERSION: ${{ matrix.version }} + UV_PYTHON_PREFERENCE: only-managed + + steps: + - name: Checkout jdk4py ${{ env.JDK4PY_REF }} (tests) + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: activeviam/jdk4py + ref: ${{ env.JDK4PY_REF }} + persist-credentials: false + + - name: Download wheel + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: jdk4py-${{ env.JDK4PY_VERSION }}-py3-none-manylinux_riscv64 + + - name: Install Python + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: ${{ matrix.python-version }} + activate-environment: true + enable-cache: false + + # `uv run`/`uv sync` would install this checkout itself (pyproject.toml + # names the `jdk4py` project) over the wheel under test, so install + # directly with `uv pip` instead. + - name: Install the wheel and test dependencies + run: | + uv pip install --reinstall --no-index --find-links . jdk4py + uv pip install pytest==9.0.3 + + - name: Run upstream's tests + run: python -m pytest tests -v + + publish: + name: Publish jdk4py ${{ matrix.version }} + needs: [setup, build_wheel, test_wheel] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: jdk4py-${{ matrix.version }}-py3-none-manylinux_riscv64 diff --git a/docs/packages/jdk4py.yaml b/docs/packages/jdk4py.yaml new file mode 100644 index 00000000000..d59bc0bdb26 --- /dev/null +++ b/docs/packages/jdk4py.yaml @@ -0,0 +1,5 @@ +package-name: jdk4py +source-code: https://github.com/activeviam/jdk4py +license: GNU General Public License v2 (GPLv2) +versions: +- version: 25.0.2.1 From a60338412d7d33332a79cb7e1f031ddec954465e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 08:27:04 +0000 Subject: [PATCH 2/3] jdk4py: avoid uv.lock dev group (ty has no riscv64 wheel at the pinned version) --- .github/workflows/build-jdk4py.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-jdk4py.yml b/.github/workflows/build-jdk4py.yml index a7accecec1b..719a4587db7 100644 --- a/.github/workflows/build-jdk4py.yml +++ b/.github/workflows/build-jdk4py.yml @@ -75,8 +75,14 @@ jobs: activate-environment: true enable-cache: false + # `uv run` would sync uv.lock's dev dependency group, which pins + # ty==0.0.29 (no riscv64 wheel until later releases); uv then falls + # back to compiling it from source with cargo, which does not finish + # within the job timeout. Install only what these steps need instead. + - run: uv pip install --no-deps . wheel + - id: get-java-version - run: uv run python -c 'from jdk4py import JAVA_VERSION; print(f"""version={".".join(str(number) for number in JAVA_VERSION)}""")' >> "$GITHUB_OUTPUT" + run: python -c 'from jdk4py import JAVA_VERSION; print(f"""version={".".join(str(number) for number in JAVA_VERSION)}""")' >> "$GITHUB_OUTPUT" # actions/setup-java lists riscv64 as a supported Temurin/linux # architecture; it does not auto-detect it from a self-hosted runner. @@ -86,11 +92,11 @@ jobs: java-version: ${{ steps.get-java-version.outputs.version }} architecture: riscv64 - - run: uv run python build_java_runtime.py + - run: python build_java_runtime.py - run: uv build --wheel - - run: uv run python -m wheel tags --platform-tag manylinux_2_39_riscv64 --remove dist/*-py3-none-any.whl + - run: python -m wheel tags --platform-tag manylinux_2_39_riscv64 --remove dist/*-py3-none-any.whl - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: From de84ac212b9ac2fb3cfccc3975cab531a1a08ad5 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 13:35:49 +0000 Subject: [PATCH 3/3] jdk4py: install editable so build_java_runtime.py writes into the checkout uv pip install --no-deps . installed a non-editable copy into site-packages, so jlink's --output (jdk4py.JAVA_HOME) landed there instead of in the src tree that uv build --wheel packages from. The riscv64 wheel came out without java-runtime/ at all (2.7KB), which is why every test hit FileNotFoundError on java-runtime/bin/java. --- .github/workflows/build-jdk4py.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-jdk4py.yml b/.github/workflows/build-jdk4py.yml index 719a4587db7..532c78023e0 100644 --- a/.github/workflows/build-jdk4py.yml +++ b/.github/workflows/build-jdk4py.yml @@ -78,8 +78,12 @@ jobs: # `uv run` would sync uv.lock's dev dependency group, which pins # ty==0.0.29 (no riscv64 wheel until later releases); uv then falls # back to compiling it from source with cargo, which does not finish - # within the job timeout. Install only what these steps need instead. - - run: uv pip install --no-deps . wheel + # within the job timeout. Install only what these steps need instead, + # editable: build_java_runtime.py imports `jdk4py.JAVA_HOME` and writes + # the jlink output there, so it must resolve to this checkout (`uv build + # --wheel` below packages from here too), not to a separate copy in + # site-packages (gotcha 261). + - run: uv pip install --no-deps --editable . wheel - id: get-java-version run: python -c 'from jdk4py import JAVA_VERSION; print(f"""version={".".join(str(number) for number in JAVA_VERSION)}""")' >> "$GITHUB_OUTPUT"