From 004dc5d7d120059ed7d7443e53f629b3db1c9f6e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 07:02:39 +0000 Subject: [PATCH 1/4] port: add imgui-bundle 1.92.900 riscv64 wheel build Build-from-checkout cibuildwheel job mirroring upstream's own wheels.yml (Linux only): nanobind/scikit-build-core, GLFW+OpenGL3 built from vendored submodules against system X11/GL dev headers per upstream's own pyproject.toml [tool.cibuildwheel] table, manylinux and musllinux riscv64. --- .github/workflows/build-imgui-bundle.yml | 115 +++++++++++++++++++++++ docs/packages/imgui-bundle.yaml | 5 + 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/build-imgui-bundle.yml create mode 100644 docs/packages/imgui-bundle.yaml diff --git a/.github/workflows/build-imgui-bundle.yml b/.github/workflows/build-imgui-bundle.yml new file mode 100644 index 00000000000..c10c39cd38a --- /dev/null +++ b/.github/workflows/build-imgui-bundle.yml @@ -0,0 +1,115 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow mirrors the `build_wheels` job of upstream's own +# .github/workflows/wheels.yml, narrowed to Linux (cibuildwheel options live in +# upstream's pyproject.toml, [tool.cibuildwheel]). +name: Build imgui-bundle wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/imgui-bundle.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-imgui-bundle.yml' + - 'docs/packages/imgui-bundle.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-imgui-bundle.yml' + - 'docs/packages/imgui-bundle.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: imgui-bundle + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build imgui-bundle ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 480 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Upstream's own cibuildwheel build list is cp311-cp314 (no free-threaded + # variants); cp311 is dropped to match this repo's numpy-driven cp312 floor. + python: ["cp312", "cp313", "cp314"] + libc: [manylinux, musllinux] + + env: + IMGUI_BUNDLE_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout imgui-bundle v${{ env.IMGUI_BUNDLE_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: pthom/imgui_bundle + ref: v${{ env.IMGUI_BUNDLE_VERSION }} + submodules: recursive + persist-credentials: false + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + # scikit-build-core provisions cmake/ninja from PyPI when not already on + # PATH; both are published to our registry for riscv64, so pin pip/uv to + # binary wheels of them (and of the numpy test dependency) from there. + # CIBW_ENVIRONMENT replaces (not merges with) pyproject's own environment + # table (CLAUDE.md gotcha 107), which for *-musllinux* sets CMAKE_ARGS to + # disable the OpenGL2 backend (musl's loader has no lazy binding - see + # pyproject.toml) - repeat it here for musllinux legs only. + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,cmake,ninja + UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + UV_INDEX_STRATEGY=unsafe-best-match + UV_ONLY_BINARY=numpy,cmake,ninja + ${{ matrix.libc == 'musllinux' && 'CMAKE_ARGS=-DIMGUI_BUNDLE_PYTHON_DISABLE_OPENGL2=ON' || '' }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: imgui-bundle-${{ env.IMGUI_BUNDLE_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish imgui-bundle ${{ matrix.version }} + needs: [setup, build_wheels] + 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: imgui-bundle-${{ matrix.version }}-*riscv64 diff --git a/docs/packages/imgui-bundle.yaml b/docs/packages/imgui-bundle.yaml new file mode 100644 index 00000000000..e63124294bd --- /dev/null +++ b/docs/packages/imgui-bundle.yaml @@ -0,0 +1,5 @@ +package-name: imgui-bundle +source-code: https://github.com/pthom/imgui_bundle +license: MIT +versions: +- version: 1.92.900 From feb7407524b2925b3f3d49dd5f1b6503591e90a7 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 08:16:12 +0000 Subject: [PATCH 2/4] build-imgui-bundle: pin nanobind<3 for the build (fix CI) external/{imgui,hello_imgui}/bindings' own pybind_*.cpp call nanobind's ndarray_export() with its pre-3.0 signature (nanobind 3.0.0's split-mode refactor added a leading nb_internals* parameter). pyproject.toml's build-system.requires ("nanobind>=2.4.0") has no upper bound, so pip/uv resolved nanobind 3.1.0 and the vendored bindings failed to compile. Mirrors build-gemmi.yml's nanobind<3 constraint-file precedent for the same shape of problem. --- .github/workflows/build-imgui-bundle.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-imgui-bundle.yml b/.github/workflows/build-imgui-bundle.yml index c10c39cd38a..0717ff8d220 100644 --- a/.github/workflows/build-imgui-bundle.yml +++ b/.github/workflows/build-imgui-bundle.yml @@ -76,6 +76,11 @@ jobs: env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + # external/{imgui,hello_imgui}/bindings' own pybind_*.cpp call nanobind's + # ndarray_export() with its pre-3.0 signature; pyproject.toml's + # build-system.requires has no upper bound (CLAUDE.md gotcha 107 shape, + # see build-gemmi.yml). + CIBW_BEFORE_ALL: echo 'nanobind<3' > /nanobind-constraint.txt # scikit-build-core provisions cmake/ninja from PyPI when not already on # PATH; both are published to our registry for riscv64, so pin pip/uv to # binary wheels of them (and of the numpy test dependency) from there. @@ -86,9 +91,13 @@ jobs: CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,cmake,ninja + PIP_CONSTRAINT=/nanobind-constraint.txt + PIP_BUILD_CONSTRAINT=/nanobind-constraint.txt UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match UV_ONLY_BINARY=numpy,cmake,ninja + UV_CONSTRAINT=/nanobind-constraint.txt + UV_BUILD_CONSTRAINT=/nanobind-constraint.txt ${{ matrix.libc == 'musllinux' && 'CMAKE_ARGS=-DIMGUI_BUNDLE_PYTHON_DISABLE_OPENGL2=ON' || '' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 16243084380bca437e37f15d1dea03db267e1c8a Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 09:53:11 +0000 Subject: [PATCH 3/4] build-imgui-bundle: repeat upstream's before-all under CIBW_BEFORE_ALL CIBW_BEFORE_ALL replaces (not merges with) pyproject.toml's own [tool.cibuildwheel.linux] before-all, same gotcha 107 shape as CIBW_ENVIRONMENT: the nanobind<3 constraint write clobbered upstream's yum/apk install of the X11/GL dev headers GLFW's CMake needs (RandR headers not found), confirmed on the cp314-manylinux re-run. Repeat upstream's before-all command per libc, then append the constraint write. --- .github/workflows/build-imgui-bundle.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-imgui-bundle.yml b/.github/workflows/build-imgui-bundle.yml index 0717ff8d220..ef3931d4251 100644 --- a/.github/workflows/build-imgui-bundle.yml +++ b/.github/workflows/build-imgui-bundle.yml @@ -79,8 +79,13 @@ jobs: # external/{imgui,hello_imgui}/bindings' own pybind_*.cpp call nanobind's # ndarray_export() with its pre-3.0 signature; pyproject.toml's # build-system.requires has no upper bound (CLAUDE.md gotcha 107 shape, - # see build-gemmi.yml). - CIBW_BEFORE_ALL: echo 'nanobind<3' > /nanobind-constraint.txt + # see build-gemmi.yml). CIBW_BEFORE_ALL replaces (not merges with) + # pyproject's own before-all (same gotcha 107 shape as CIBW_ENVIRONMENT + # below), which installs the X11/GL dev headers GLFW's CMake needs - + # repeat that command here per libc. + CIBW_BEFORE_ALL: >- + ${{ matrix.libc == 'musllinux' && 'apk add xorg-server-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev mesa-dev mesa-gl cmake curl bash' || 'yum install -y libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel mesa-libGL-devel' }} && + echo 'nanobind<3' > /nanobind-constraint.txt # scikit-build-core provisions cmake/ninja from PyPI when not already on # PATH; both are published to our registry for riscv64, so pin pip/uv to # binary wheels of them (and of the numpy test dependency) from there. From 6e142fbd677e906bac56e4bc26f441d561740b78 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 28 Sep 2026 14:35:38 +0000 Subject: [PATCH 4/4] build-imgui-bundle: skip musllinux test-install (numpy has no musllinux riscv64 wheel) --- .github/workflows/build-imgui-bundle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-imgui-bundle.yml b/.github/workflows/build-imgui-bundle.yml index ef3931d4251..a13bd6f0848 100644 --- a/.github/workflows/build-imgui-bundle.yml +++ b/.github/workflows/build-imgui-bundle.yml @@ -104,6 +104,10 @@ jobs: UV_CONSTRAINT=/nanobind-constraint.txt UV_BUILD_CONSTRAINT=/nanobind-constraint.txt ${{ matrix.libc == 'musllinux' && 'CMAKE_ARGS=-DIMGUI_BUNDLE_PYTHON_DISABLE_OPENGL2=ON' || '' }} + # Upstream's test-requires (pytest, pytest-asyncio, numpy) needs numpy, which + # has no riscv64 musllinux wheel in our registry (manylinux_riscv64 only) - + # skip the test-install/test-command on musllinux legs, keeping the build. + CIBW_TEST_SKIP: "*-musllinux*" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: