From d42a0d7ad5154973167ce7a02d0575f32f468cc5 Mon Sep 17 00:00:00 2001 From: kingchenc Date: Thu, 21 May 2026 18:04:57 +0200 Subject: [PATCH] ci: fix maturin and wasm-pack jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two unrelated failures in the post-release CI run: - Python jobs: `maturin develop` requires an activated virtualenv on CI runners that don't have a system Python set up that way. Switch to `maturin build --release --out dist` followed by `pip install --find-links dist`, which is venv-agnostic and OS-portable. - WASM job: the wasm-opt bundled with wasm-pack is older than the WASM features rustc 1.92 enables by default. The fix is to opt every feature in explicitly via the package metadata — reference-types, multivalue, bulk-memory, sign-ext, mutable-globals, nontrapping-float-to-int — so wasm-opt accepts the input. Same code as before; only the build steps and the wasm-opt config changed. --- .github/workflows/ci.yml | 17 +++++++++++++---- bindings/wasm/Cargo.toml | 14 +++++++++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92309448..8ea2b055 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,9 +79,14 @@ jobs: python -m pip install --upgrade pip python -m pip install maturin pytest numpy hypothesis - - name: Build extension in release mode + - name: Build wheel working-directory: bindings/python - run: maturin develop --release + run: maturin build --release --out dist + + - name: Install wheel + shell: bash + working-directory: bindings/python + run: python -m pip install --find-links dist --force-reinstall wickra - name: Run Python tests working-directory: bindings/python @@ -168,9 +173,13 @@ jobs: python -m pip install --upgrade pip python -m pip install maturin numpy pandas talipp finta - - name: Build Wickra extension + - name: Build Wickra wheel working-directory: bindings/python - run: maturin develop --release + run: maturin build --release --out dist + + - name: Install Wickra wheel + working-directory: bindings/python + run: python -m pip install --find-links dist --force-reinstall wickra - name: Run cross-library benchmark working-directory: bindings/python diff --git a/bindings/wasm/Cargo.toml b/bindings/wasm/Cargo.toml index fc39c75e..d7c4d6ce 100644 --- a/bindings/wasm/Cargo.toml +++ b/bindings/wasm/Cargo.toml @@ -35,4 +35,16 @@ default = [] panic-hook = ["dep:console_error_panic_hook"] [package.metadata.wasm-pack.profile.release] -wasm-opt = ['-O3', '--enable-bulk-memory'] +# The wasm-opt that ships with wasm-pack is older than the WebAssembly +# features rustc enables by default (reference-types, multivalue, +# bulk-memory, sign-extension, mutable-globals, …). Listing them all keeps +# wasm-opt happy without requiring a binaryen upgrade in CI. +wasm-opt = [ + '-O3', + '--enable-bulk-memory', + '--enable-mutable-globals', + '--enable-nontrapping-float-to-int', + '--enable-sign-ext', + '--enable-reference-types', + '--enable-multivalue', +]