From f311c70893f9dab30c324e7de82d8b97c75e0636 Mon Sep 17 00:00:00 2001 From: richarddd Date: Tue, 12 May 2026 16:35:58 +0200 Subject: [PATCH 1/6] Replace per-target cross-toolchain setups with cargo-zigbuild and move bindings regeneration to a dedicated workflow --- .github/workflows/bindings.yml | 134 ++++++++++ .github/workflows/ci.yml | 432 +++++++-------------------------- 2 files changed, 224 insertions(+), 342 deletions(-) create mode 100644 .github/workflows/bindings.yml diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml new file mode 100644 index 000000000..0ff1da8df --- /dev/null +++ b/.github/workflows/bindings.yml @@ -0,0 +1,134 @@ +name: Update bindings + +on: + workflow_dispatch: + inputs: + base: + description: Branch to open the pull request against + required: false + default: master + push: + branches: + - master + paths: + - 'sys/quickjs' + - 'sys/wrapper.h' + - 'sys/build.rs' + - 'sys/Cargo.toml' + - '.github/workflows/bindings.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + bindings: + name: ${{ matrix.target }} + strategy: + fail-fast: false + matrix: + include: + # Cross-compiled Linux targets handled by cargo-zigbuild. + - { os: ubuntu-latest, target: i686-unknown-linux-gnu, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: x86_64-unknown-linux-musl, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: aarch64-unknown-linux-musl, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: armv7-unknown-linux-gnueabihf, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: powerpc64-unknown-linux-gnu, rust: stable, builder: zigbuild } + - { os: ubuntu-24.04, target: loongarch64-unknown-linux-gnu, rust: nightly, builder: zigbuild } + - { os: ubuntu-24.04, target: loongarch64-unknown-linux-musl, rust: nightly, builder: zigbuild } + # Native builds. + - { os: macos-latest, target: x86_64-apple-darwin, rust: stable, builder: native } + - { os: macos-latest, target: aarch64-apple-darwin, rust: stable, builder: native } + - { os: windows-latest, target: x86_64-pc-windows-msvc, rust: stable, builder: native } + - { os: windows-latest, target: x86_64-pc-windows-gnu, rust: stable, builder: msys2 } + - { os: windows-11-arm, target: aarch64-pc-windows-msvc, rust: stable, builder: native } + - { os: ubuntu-latest, target: wasm32-wasip1, rust: stable, builder: native } + - { os: ubuntu-latest, target: wasm32-wasip2, rust: nightly, builder: native } + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + components: rust-src + + - name: Set up zig + if: matrix.builder == 'zigbuild' + uses: mlugg/setup-zig@v2 + with: + version: 0.14.1 + + - name: Install cargo-zigbuild + if: matrix.builder == 'zigbuild' + uses: taiki-e/install-action@v2 + with: + tool: cargo-zigbuild + + - name: Set up msys2 + if: matrix.builder == 'msys2' + uses: msys2/setup-msys2@v2 + with: + release: false + + - name: Prepare msys2 env + if: matrix.builder == 'msys2' + shell: pwsh + run: | + New-Item -Path "C:\Program Files\LLVM\x86_64-w64-mingw32" -ItemType SymbolicLink -Value "C:\msys64\mingw64\x86_64-w64-mingw32" + New-Item -Path "C:\Program Files\LLVM\i686-w64-mingw32" -ItemType SymbolicLink -Value "C:\msys64\mingw64\i686-w64-mingw32" + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\mingw32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + echo "CC_i686_pc_windows_gnu=i686-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + + - name: Regenerate bindings + shell: bash + env: + BUILD_TARGET: ${{ matrix.target }} + RUST_LOG: bindgen=warn,bindgen::ir=error,bindgen::codegen=error + run: | + if [ "${{ matrix.builder }}" = "zigbuild" ]; then + cargo zigbuild --manifest-path sys/Cargo.toml --target ${{ matrix.target }} --features bindgen,update-bindings,logging + else + cargo build --manifest-path sys/Cargo.toml --target ${{ matrix.target }} --features bindgen,update-bindings,logging + fi + cat "sys/src/bindings/${{ matrix.target }}.rs" | head -n 20 + + - name: Upload bindings + uses: actions/upload-artifact@v7 + with: + name: bindings-${{ matrix.target }} + path: sys/src/bindings/${{ matrix.target }}.rs + overwrite: true + + open-pr: + needs: bindings + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v6 + - name: Download bindings artifacts + uses: actions/download-artifact@v8 + with: + pattern: bindings-* + path: sys/src/bindings + merge-multiple: true + - name: Create pull request + uses: peter-evans/create-pull-request@v8 + with: + base: ${{ github.event.inputs.base || github.ref_name }} + branch: update-bindings + delete-branch: true + commit-message: Update bindings + title: Update bindings + body: | + Regenerated `sys/src/bindings/*.rs` after a change to `sys/quickjs`, `sys/wrapper.h`, `sys/build.rs`, or `sys/Cargo.toml`. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fdcdb1b6..572802903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,6 @@ on: push: branches: - master - - update-bindings pull_request: # Only run on the latest ref @@ -49,6 +48,7 @@ jobs: target/doc/rquickjs target/doc/rquickjs-sys target/doc/rquickjs-macro + check: runs-on: ubuntu-latest permissions: @@ -65,10 +65,7 @@ jobs: run: cargo clippy --all --all-targets --features full-async,bindgen msrv: - # Check to see if rquickjs builds on minimal supported Rust version. runs-on: ubuntu-latest - # we use a matrix here just because env can't be used in job names - # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: msrv: [1.87.0] @@ -159,383 +156,134 @@ jobs: fail-fast: ${{ startsWith(github.ref, 'refs/tags/') }} matrix: include: - # Generate bindings - - task: bindings - os: ubuntu-latest - rust: stable - target: i686-unknown-linux-gnu - features: full-async - - task: bindings - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: full-async - - - task: bindings - os: macos-latest - rust: stable - target: x86_64-apple-darwin - features: full-async - - task: bindings - os: macos-latest - rust: stable - target: aarch64-apple-darwin - features: full-async - no-test: true - - - task: bindings - os: windows-latest - rust: stable - target: x86_64-pc-windows-gnu - features: full-async - - task: bindings - os: windows-latest - rust: stable - target: x86_64-pc-windows-msvc - features: full-async - - task: bindings - os: windows-11-arm - rust: stable - target: aarch64-pc-windows-msvc - features: full-async - - task: test - os: windows-latest - rust: stable - target: x86_64-pc-windows-msvc - features: full-async - optimization: true - - - task: bindings - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-musl - features: full-async - - task: bindings - os: ubuntu-latest - rust: stable - target: aarch64-unknown-linux-musl - features: full-async - - - task: bindings - os: ubuntu-latest - rust: stable - target: aarch64-unknown-linux-gnu - features: full-async - - - task: bindings - os: ubuntu-latest - rust: stable - target: armv7-unknown-linux-gnueabihf - features: full-async - - - task: bindings - os: ubuntu-latest - rust: stable - target: powerpc64-unknown-linux-gnu - features: full-async - - - task: bindings - os: ubuntu-24.04 - rust: nightly - target: loongarch64-unknown-linux-musl - features: full-async - - task: bindings - os: ubuntu-24.04 - rust: nightly - target: loongarch64-unknown-linux-gnu - features: full-async - - - task: bindings - os: ubuntu-latest - rust: stable - target: wasm32-wasip1 - features: full-async-wasi - - task: bindings - os: ubuntu-latest - rust: nightly - target: wasm32-wasip2 - features: full-async-wasi - - # Test features - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: rust-alloc - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: loader - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: futures - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: parallel - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: disable-assertions - - task: features - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: half - - # Test channels - - task: channels - os: ubuntu-latest - rust: stable - target: x86_64-unknown-linux-gnu - features: full-async - - task: channels - os: ubuntu-latest - rust: beta - target: x86_64-unknown-linux-gnu - features: full-async - - task: channels - os: ubuntu-latest - rust: nightly - target: x86_64-unknown-linux-gnu - features: full-async + # Cross-compiled Linux targets via cargo-zigbuild + QEMU. + - { task: test, os: ubuntu-latest, rust: stable, target: i686-unknown-linux-gnu, features: full-async, builder: zigbuild } + - { task: test, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-musl, features: full-async, builder: zigbuild } + - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: aarch64 } + - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: aarch64 } + - { task: test, os: ubuntu-latest, rust: stable, target: armv7-unknown-linux-gnueabihf, features: full-async, builder: zigbuild, qemu: arm } + - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: ppc64 } + - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: loongarch64 } + - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: loongarch64 } + + # Native targets. + - { task: test, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: full-async, builder: native } + + - { task: test, os: macos-latest, rust: stable, target: x86_64-apple-darwin, features: full-async, builder: native } + - { task: test, os: macos-latest, rust: stable, target: aarch64-apple-darwin, features: full-async, builder: native, no-test: true } + + - { task: test, os: windows-latest, rust: stable, target: x86_64-pc-windows-gnu, features: full-async, builder: msys2 } + - { task: test, os: windows-latest, rust: stable, target: x86_64-pc-windows-msvc, features: full-async, builder: native, optimization: true } + - { task: test, os: windows-11-arm, rust: stable, target: aarch64-pc-windows-msvc, features: full-async, builder: native } + + # WebAssembly targets (wasmtime runner). + - { task: test, os: ubuntu-latest, rust: stable, target: wasm32-wasip1, features: full-async-wasi, builder: native, wasi: true } + - { task: test, os: ubuntu-latest, rust: nightly, target: wasm32-wasip2, features: full-async-wasi, builder: native, wasi: true } + + # Feature matrix (native x86_64 Linux). + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: rust-alloc, builder: native } + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: loader, builder: native } + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: futures, builder: native } + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: parallel, builder: native } + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: disable-assertions, builder: native } + - { task: features, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: half, builder: native } + + # Channel matrix (native x86_64 Linux). + - { task: channels, os: ubuntu-latest, rust: stable, target: x86_64-unknown-linux-gnu, features: full-async, builder: native } + - { task: channels, os: ubuntu-latest, rust: beta, target: x86_64-unknown-linux-gnu, features: full-async, builder: native } + - { task: channels, os: ubuntu-latest, rust: nightly, target: x86_64-unknown-linux-gnu, features: full-async, builder: native } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 with: submodules: true - - name: Setup cross linux toolchain - if: contains(matrix.target, '-linux-') && !startsWith(matrix.target, 'aarch64') && !startsWith(matrix.target, 'armv7') && !startsWith(matrix.target, 'loongarch64') && !startsWith(matrix.target, 'x86_64-') && !endsWith(matrix.target, '-musl') && !startsWith(matrix.target, 'powerpc64') - run: | - case "${{ matrix.target }}" in - i686-*) SYSTEM_ARCH=i386 ;; - esac - GCC_TARGET=$(printf "${{ matrix.target }}" | sed 's/-unknown-/-/' | sed 's/arm[^-]*/arm/g') - ENV_TARGET=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') - sudo dpkg --add-architecture ${SYSTEM_ARCH} - sudo apt-get update -y - sudo apt-get install -y libc6-dev:${SYSTEM_ARCH} gcc-${GCC_TARGET} libgcc-s1:${SYSTEM_ARCH} - echo "CARGO_TARGET_${ENV_TARGET}_LINKER=${GCC_TARGET}-gcc" >> $GITHUB_ENV - - - name: Setup musl-tools - if: startsWith(matrix.target, 'x86_64-') && endsWith(matrix.target, '-musl') - run: sudo apt-get update -y && sudo apt-get install -y musl-tools - - name: Setup armv7 toolchain - if: startsWith(matrix.target, 'armv7') && contains(matrix.target, '-linux-') - run: | - sudo apt-get update -y - sudo apt-get install -y \ - libc6-armhf-cross \ - libc6-dev-armhf-cross \ - gcc-arm-linux-gnueabihf \ - qemu-user - echo "CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV - echo "CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++" >> $GITHUB_ENV - echo "AR_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER=qemu-arm -L /usr/arm-linux-gnueabihf" >> $GITHUB_ENV - - - name: Setup powerpc64 toolchain - if: startsWith(matrix.target, 'powerpc64') && endsWith(matrix.target, '-gnu') - run: | - sudo apt-get update -y - sudo apt-get install -y \ - libc6-ppc64-cross \ - libc6-dev-ppc64-cross \ - gcc-powerpc64-linux-gnu \ - qemu-user - echo "CC_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-gcc" >> $GITHUB_ENV - echo "CXX_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-g++" >> $GITHUB_ENV - echo "AR_powerpc64_unknown_linux_gnu=powerpc64-linux-gnu-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER=qemu-ppc64 -L /usr/powerpc64-linux-gnu" >> $GITHUB_ENV - - - name: Setup gnu aarch64 - if: startsWith(matrix.target, 'aarch64') && endsWith(matrix.target, '-gnu') - run: | - sudo apt-get update -y - sudo apt-get install -y \ - curl \ - libc6-arm64-cross \ - libc6-dev-arm64-cross \ - crossbuild-essential-arm64 \ - clang \ - qemu-system-arm \ - qemu-efi-aarch64 \ - qemu-utils \ - qemu-user - - echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV - echo "AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER=qemu-aarch64" >> $GITHUB_ENV - - echo "LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib" >> $GITHUB_ENV - - sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1 + - name: Set up zig + if: matrix.builder == 'zigbuild' + uses: mlugg/setup-zig@v2 + with: + version: 0.14.1 - mkdir -p ~/.cargo/ - echo "[target.aarch64-unknown-linux-gnu]" >> ~/.cargo/config.toml - echo 'rustflags = ["-C", "linker=aarch64-linux-gnu-gcc"]' >> ~/.cargo/config.toml + - name: Install cargo-zigbuild + if: matrix.builder == 'zigbuild' + uses: taiki-e/install-action@v2 + with: + tool: cargo-zigbuild - - name: Setup musl aarch64 - if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') + - name: Install QEMU user emulation + if: matrix.qemu run: | sudo apt-get update -y - sudo apt-get install -y \ - curl \ - libc6-arm64-cross \ - libc6-dev-arm64-cross \ - crossbuild-essential-arm64 \ - clang \ - qemu-system-arm \ - qemu-efi-aarch64 \ - qemu-utils \ - qemu-user - - curl -L --retry 5 https://github.com/musl-cross/musl-cross/releases/latest/download/aarch64-unknown-linux-musl.tar.xz | tar xJf - - sudo mv aarch64-unknown-linux-musl /musl + sudo apt-get install -y qemu-user + QEMU_TARGET=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') + echo "CARGO_TARGET_${QEMU_TARGET}_RUNNER=qemu-${{ matrix.qemu }}" >> "$GITHUB_ENV" - echo "CC_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-gcc" >> $GITHUB_ENV - echo "CXX_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-g++" >> $GITHUB_ENV - echo "AR_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-unknown-linux-musl-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER=qemu-aarch64" >> $GITHUB_ENV - - mkdir -p ~/.cargo/ - echo "[target.aarch64-unknown-linux-musl]" >> ~/.cargo/config.toml - echo 'rustflags = ["-C", "link-self-contained=yes","-C", "linker=rust-lld"]' >> ~/.cargo/config.toml - - echo "/musl/bin" >> $GITHUB_PATH + - name: Set up wasmtime + if: matrix.wasi + uses: bytecodealliance/actions/wasmtime/setup@v1 - - name: Setup cross loongarch64 - if: startsWith(matrix.target, 'loongarch64') && contains(matrix.target, '-linux-') + - name: Configure wasmtime runner + if: matrix.wasi + shell: bash run: | - sudo apt-get update -y - sudo apt-get install -y \ - curl \ - libc6-dev-loong64-cross \ - gcc-14-loongarch64-linux-gnu \ - g++-14-loongarch64-linux-gnu \ - clang \ - qemu-user \ - qemu-system-arm \ - qemu-efi-aarch64 \ - qemu-utils \ - qemu-user-static - - curl -L --retry 5 https://github.com/musl-cross/musl-cross/releases/latest/download/loongarch64-unknown-linux-musl.tar.xz | tar xJf - - sudo mv loongarch64-unknown-linux-musl /musl - - ls -al /usr/loongarch64-linux-gnu - - echo "CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc" >> $GITHUB_ENV - echo "CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++" >> $GITHUB_ENV - echo "AR_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER=qemu-loongarch64 -L /musl/loongarch64-unknown-linux-musl/sysroot" >> $GITHUB_ENV + WASI_TARGET=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') + echo "CARGO_TARGET_${WASI_TARGET}_RUNNER=wasmtime" >> "$GITHUB_ENV" - echo "CC_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-gcc-14" >> $GITHUB_ENV - echo "CXX_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-g++-14" >> $GITHUB_ENV - echo "AR_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-ar" >> $GITHUB_ENV - echo "CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14" >> $GITHUB_ENV - echo "CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER=qemu-loongarch64 -L /usr/loongarch64-linux-gnu" >> $GITHUB_ENV - - mkdir -p ~/.cargo/ - echo "[target.loongarch64-unknown-linux-musl]" >> ~/.cargo/config.toml - echo 'rustflags = ["-C", "target-feature=+crt-static", "-C", "link-self-contained=yes", "-C", "linker=loongarch64-unknown-linux-musl-gcc"]' >> ~/.cargo/config.toml - echo "[target.loongarch64-unknown-linux-gnu]" >> ~/.cargo/config.toml - echo 'rustflags = ["-C", "linker=loongarch64-linux-gnu-gcc-14"]' >> ~/.cargo/config.toml - - echo "/musl/bin" >> $GITHUB_PATH - - name: Setup wasmtime for wasm32-wasip1 and wasm32-wasip2 - if: matrix.target == 'wasm32-wasip1' || matrix.target == 'wasm32-wasip2' - uses: bytecodealliance/actions/wasmtime/setup@v1 - - name: Setup msys2 toolchains - if: startsWith(matrix.os, 'windows') && endsWith(matrix.target, '-gnu') + - name: Set up msys2 + if: matrix.builder == 'msys2' uses: msys2/setup-msys2@v2 with: release: false - - name: Prepare env for windows - if: startsWith(matrix.os, 'windows') && endsWith(matrix.target, '-gnu') + + - name: Prepare msys2 env + if: matrix.builder == 'msys2' + shell: pwsh run: | - # Add symlinks to the target-specific GNU sysroots for Clang New-Item -Path "C:\Program Files\LLVM\x86_64-w64-mingw32" -ItemType SymbolicLink -Value "C:\msys64\mingw64\x86_64-w64-mingw32" New-Item -Path "C:\Program Files\LLVM\i686-w64-mingw32" -ItemType SymbolicLink -Value "C:\msys64\mingw64\i686-w64-mingw32" - # Add paths to GCC executables to PATH echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\msys64\mingw32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - # Configure CC_ environment variables echo "CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - echo "CC_i686_pc_windows_gnu=i686-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - # echo "HOST_CC=x86_64-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + echo "CC_i686_pc_windows_gnu=i686-w64-mingw32-gcc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + - name: Setup Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} components: rustfmt rust-src + - name: Update deps run: cargo update - - name: Build sys - env: - RUST_LOG: bindgen=warn,bindgen::ir=error,bindgen::codegen=error - BUILD_TARGET: ${{ matrix.target }} - run: | - cargo build ${{ matrix.optimization && '--release' || '' }} --manifest-path sys/Cargo.toml --target ${{ matrix.target }} --features bindgen,update-bindings,logging - cat sys/src/bindings/${{ matrix.target }}.rs - - name: Upload bindings - if: matrix.task == 'bindings' - uses: actions/upload-artifact@v7 - with: - name: bindings-${{ matrix.target }} - path: sys/src/bindings/${{ matrix.target }}.rs - overwrite: true + - name: Build - if: ${{ !matrix.no-build }} + shell: bash env: BUILD_TARGET: ${{ matrix.target }} TARGET: ${{ matrix.target }} run: | - cargo build ${{ matrix.optimization && '--release' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + if [ "${{ matrix.builder }}" = "zigbuild" ]; then + cargo zigbuild ${{ matrix.optimization && '--release' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + else + cargo build ${{ matrix.optimization && '--release' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + fi + - name: Test - if: ${{ !matrix.no-build && !matrix.no-test }} + if: ${{ !matrix.no-test }} timeout-minutes: 12 + shell: bash env: RUST_BACKTRACE: full run: | - # Limit test threads to 1 for QEMU-emulated targets to work around an intermittent + # Limit test threads on QEMU-emulated targets to work around an intermittent # QEMU user-mode emulation bug: "QEMU internal SIGSEGV {code=MAPERR, addr=0x20}" - # This is a race condition in QEMU's thread emulation, not a bug in rquickjs. - ${{ (startsWith(matrix.target, 'loongarch64') || startsWith(matrix.target, 'aarch64-unknown-linux') || startsWith(matrix.target, 'armv7') || startsWith(matrix.target, 'powerpc64')) && 'RUST_TEST_THREADS=1' || '' }} ${{ matrix.target == 'wasm32-wasip1' && 'CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime' || '' }} ${{ matrix.target == 'wasm32-wasip2' && 'CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime' || '' }} cargo test ${{ matrix.optimization && '--release' || '' }} --all ${{ (matrix.target == 'wasm32-wasip1' || matrix.target == 'wasm32-wasip2') && '--exclude module-loader' || '' }} --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} - - update-bindings: - if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') }} - needs: - - test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Download bindings - uses: actions/download-artifact@v8 - with: - pattern: bindings-* - path: sys/src/bindings - merge-multiple: true - - name: Create pull request - uses: peter-evans/create-pull-request@v8 - with: - base: ${{ github.head_ref }} - commit-message: Updated bindings - branch: update-bindings - delete-branch: true - title: Update bindings - body: | - Bindings should be updated to be consistent with latest changes + if [ -n "${{ matrix.qemu }}" ]; then + export RUST_TEST_THREADS=1 + fi + if [ "${{ matrix.builder }}" = "zigbuild" ]; then + cargo-zigbuild test ${{ matrix.optimization && '--release' || '' }} --all --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + elif [ "${{ matrix.wasi }}" = "true" ]; then + cargo test ${{ matrix.optimization && '--release' || '' }} --all --exclude module-loader --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + else + cargo test ${{ matrix.optimization && '--release' || '' }} --all --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} + fi From 51e7733ee33de31bd20422a9bf88a86a206faeaa Mon Sep 17 00:00:00 2001 From: richarddd Date: Fri, 15 May 2026 21:59:01 +0200 Subject: [PATCH 2/6] Install glibc cross sysroots for QEMU runners and refresh stale wasm32-wasip2 bindings --- .github/workflows/ci.yml | 38 +- sys/src/bindings/wasm32-wasip2.rs | 646 ++++++++++++++---------------- 2 files changed, 344 insertions(+), 340 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 572802903..a64193013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,11 +212,45 @@ jobs: - name: Install QEMU user emulation if: matrix.qemu + shell: bash run: | + # Cross-compiled glibc binaries need both the dynamic linker and the + # matching sysroot at runtime. zigbuild produces dynamic binaries for + # *-linux-gnu targets, so install the cross libc and point qemu's + # -L prefix at it. *-linux-musl binaries are statically linked and + # need neither. + case "${{ matrix.target }}" in + aarch64-unknown-linux-gnu) + LIBC_PKG=libc6-arm64-cross + PREFIX=/usr/aarch64-linux-gnu + ;; + armv7-unknown-linux-gnueabihf) + LIBC_PKG=libc6-armhf-cross + PREFIX=/usr/arm-linux-gnueabihf + ;; + powerpc64-unknown-linux-gnu) + LIBC_PKG=libc6-ppc64-cross + PREFIX=/usr/powerpc64-linux-gnu + ;; + loongarch64-unknown-linux-gnu) + LIBC_PKG=libc6-dev-loong64-cross + PREFIX=/usr/loongarch64-linux-gnu + ;; + *) + LIBC_PKG='' + PREFIX='' + ;; + esac + sudo apt-get update -y - sudo apt-get install -y qemu-user + sudo apt-get install -y qemu-user $LIBC_PKG + QEMU_TARGET=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') - echo "CARGO_TARGET_${QEMU_TARGET}_RUNNER=qemu-${{ matrix.qemu }}" >> "$GITHUB_ENV" + if [ -n "$PREFIX" ]; then + echo "CARGO_TARGET_${QEMU_TARGET}_RUNNER=qemu-${{ matrix.qemu }} -L $PREFIX" >> "$GITHUB_ENV" + else + echo "CARGO_TARGET_${QEMU_TARGET}_RUNNER=qemu-${{ matrix.qemu }}" >> "$GITHUB_ENV" + fi - name: Set up wasmtime if: matrix.wasi diff --git a/sys/src/bindings/wasm32-wasip2.rs b/sys/src/bindings/wasm32-wasip2.rs index 14ab7668c..26a693a41 100644 --- a/sys/src/bindings/wasm32-wasip2.rs +++ b/sys/src/bindings/wasm32-wasip2.rs @@ -1,5 +1,6 @@ /* automatically generated by rust-bindgen 0.72.1 */ +pub const JS_NAN_BOXING: u32 = 1; pub const JS_PROP_CONFIGURABLE: u32 = 1; pub const JS_PROP_WRITABLE: u32 = 2; pub const JS_PROP_ENUMERABLE: u32 = 4; @@ -53,6 +54,7 @@ pub const JS_DUMP_MEM: u32 = 65536; pub const JS_DUMP_OBJECTS: u32 = 131072; pub const JS_DUMP_ATOMS: u32 = 262144; pub const JS_DUMP_SHAPES: u32 = 524288; +pub const JS_ABORT_ON_LEAKS: u32 = 1097728; pub const JS_ATOM_NULL: u32 = 0; pub const JS_CALL_FLAG_CONSTRUCTOR: u32 = 1; pub const JS_EVAL_OPTIONS_VERSION: u32 = 1; @@ -107,56 +109,25 @@ pub struct JSClass { } pub type JSClassID = u32; pub type JSAtom = u32; -pub const JS_TAG_FIRST: _bindgen_ty_3 = -9; -pub const JS_TAG_BIG_INT: _bindgen_ty_3 = -9; -pub const JS_TAG_SYMBOL: _bindgen_ty_3 = -8; -pub const JS_TAG_STRING: _bindgen_ty_3 = -7; -pub const JS_TAG_STRING_ROPE: _bindgen_ty_3 = -6; -pub const JS_TAG_MODULE: _bindgen_ty_3 = -3; -pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_3 = -2; -pub const JS_TAG_OBJECT: _bindgen_ty_3 = -1; -pub const JS_TAG_INT: _bindgen_ty_3 = 0; -pub const JS_TAG_BOOL: _bindgen_ty_3 = 1; -pub const JS_TAG_NULL: _bindgen_ty_3 = 2; -pub const JS_TAG_UNDEFINED: _bindgen_ty_3 = 3; -pub const JS_TAG_UNINITIALIZED: _bindgen_ty_3 = 4; -pub const JS_TAG_CATCH_OFFSET: _bindgen_ty_3 = 5; -pub const JS_TAG_EXCEPTION: _bindgen_ty_3 = 6; -pub const JS_TAG_SHORT_BIG_INT: _bindgen_ty_3 = 7; -pub const JS_TAG_FLOAT64: _bindgen_ty_3 = 8; -pub type _bindgen_ty_3 = ::core::ffi::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union JSValueUnion { - pub int32: i32, - pub float64: f64, - pub ptr: *mut ::core::ffi::c_void, - pub short_big_int: i32, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of JSValueUnion"][::core::mem::size_of::() - 8usize]; - ["Alignment of JSValueUnion"][::core::mem::align_of::() - 8usize]; - ["Offset of field: JSValueUnion::int32"][::core::mem::offset_of!(JSValueUnion, int32) - 0usize]; - ["Offset of field: JSValueUnion::float64"] - [::core::mem::offset_of!(JSValueUnion, float64) - 0usize]; - ["Offset of field: JSValueUnion::ptr"][::core::mem::offset_of!(JSValueUnion, ptr) - 0usize]; - ["Offset of field: JSValueUnion::short_big_int"] - [::core::mem::offset_of!(JSValueUnion, short_big_int) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct JSValue { - pub u: JSValueUnion, - pub tag: i64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of JSValue"][::core::mem::size_of::() - 16usize]; - ["Alignment of JSValue"][::core::mem::align_of::() - 8usize]; - ["Offset of field: JSValue::u"][::core::mem::offset_of!(JSValue, u) - 0usize]; - ["Offset of field: JSValue::tag"][::core::mem::offset_of!(JSValue, tag) - 8usize]; -}; +pub const JS_TAG_FIRST: _bindgen_ty_1 = -9; +pub const JS_TAG_BIG_INT: _bindgen_ty_1 = -9; +pub const JS_TAG_SYMBOL: _bindgen_ty_1 = -8; +pub const JS_TAG_STRING: _bindgen_ty_1 = -7; +pub const JS_TAG_STRING_ROPE: _bindgen_ty_1 = -6; +pub const JS_TAG_MODULE: _bindgen_ty_1 = -3; +pub const JS_TAG_FUNCTION_BYTECODE: _bindgen_ty_1 = -2; +pub const JS_TAG_OBJECT: _bindgen_ty_1 = -1; +pub const JS_TAG_INT: _bindgen_ty_1 = 0; +pub const JS_TAG_BOOL: _bindgen_ty_1 = 1; +pub const JS_TAG_NULL: _bindgen_ty_1 = 2; +pub const JS_TAG_UNDEFINED: _bindgen_ty_1 = 3; +pub const JS_TAG_UNINITIALIZED: _bindgen_ty_1 = 4; +pub const JS_TAG_CATCH_OFFSET: _bindgen_ty_1 = 5; +pub const JS_TAG_EXCEPTION: _bindgen_ty_1 = 6; +pub const JS_TAG_SHORT_BIG_INT: _bindgen_ty_1 = 7; +pub const JS_TAG_FLOAT64: _bindgen_ty_1 = 8; +pub type _bindgen_ty_1 = ::core::ffi::c_int; +pub type JSValue = u64; pub type JSCFunction = ::core::option::Option< unsafe extern "C" fn( ctx: *mut JSContext, @@ -225,18 +196,18 @@ pub struct JSMallocFunctions { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSMallocFunctions"][::core::mem::size_of::() - 40usize]; - ["Alignment of JSMallocFunctions"][::core::mem::align_of::() - 8usize]; + ["Size of JSMallocFunctions"][::core::mem::size_of::() - 20usize]; + ["Alignment of JSMallocFunctions"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSMallocFunctions::js_calloc"] [::core::mem::offset_of!(JSMallocFunctions, js_calloc) - 0usize]; ["Offset of field: JSMallocFunctions::js_malloc"] - [::core::mem::offset_of!(JSMallocFunctions, js_malloc) - 8usize]; + [::core::mem::offset_of!(JSMallocFunctions, js_malloc) - 4usize]; ["Offset of field: JSMallocFunctions::js_free"] - [::core::mem::offset_of!(JSMallocFunctions, js_free) - 16usize]; + [::core::mem::offset_of!(JSMallocFunctions, js_free) - 8usize]; ["Offset of field: JSMallocFunctions::js_realloc"] - [::core::mem::offset_of!(JSMallocFunctions, js_realloc) - 24usize]; + [::core::mem::offset_of!(JSMallocFunctions, js_realloc) - 12usize]; ["Offset of field: JSMallocFunctions::js_malloc_usable_size"] - [::core::mem::offset_of!(JSMallocFunctions, js_malloc_usable_size) - 32usize]; + [::core::mem::offset_of!(JSMallocFunctions, js_malloc_usable_size) - 16usize]; }; pub type JSRuntimeFinalizer = ::core::option::Option; @@ -616,7 +587,7 @@ const _: () = { [::core::mem::offset_of!(JSPropertyEnum, atom) - 4usize]; }; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct JSPropertyDescriptor { pub flags: ::core::ffi::c_int, pub value: JSValue, @@ -625,16 +596,16 @@ pub struct JSPropertyDescriptor { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSPropertyDescriptor"][::core::mem::size_of::() - 56usize]; + ["Size of JSPropertyDescriptor"][::core::mem::size_of::() - 32usize]; ["Alignment of JSPropertyDescriptor"][::core::mem::align_of::() - 8usize]; ["Offset of field: JSPropertyDescriptor::flags"] [::core::mem::offset_of!(JSPropertyDescriptor, flags) - 0usize]; ["Offset of field: JSPropertyDescriptor::value"] [::core::mem::offset_of!(JSPropertyDescriptor, value) - 8usize]; ["Offset of field: JSPropertyDescriptor::getter"] - [::core::mem::offset_of!(JSPropertyDescriptor, getter) - 24usize]; + [::core::mem::offset_of!(JSPropertyDescriptor, getter) - 16usize]; ["Offset of field: JSPropertyDescriptor::setter"] - [::core::mem::offset_of!(JSPropertyDescriptor, setter) - 40usize]; + [::core::mem::offset_of!(JSPropertyDescriptor, setter) - 24usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -693,22 +664,22 @@ pub struct JSClassExoticMethods { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSClassExoticMethods"][::core::mem::size_of::() - 56usize]; - ["Alignment of JSClassExoticMethods"][::core::mem::align_of::() - 8usize]; + ["Size of JSClassExoticMethods"][::core::mem::size_of::() - 28usize]; + ["Alignment of JSClassExoticMethods"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSClassExoticMethods::get_own_property"] [::core::mem::offset_of!(JSClassExoticMethods, get_own_property) - 0usize]; ["Offset of field: JSClassExoticMethods::get_own_property_names"] - [::core::mem::offset_of!(JSClassExoticMethods, get_own_property_names) - 8usize]; + [::core::mem::offset_of!(JSClassExoticMethods, get_own_property_names) - 4usize]; ["Offset of field: JSClassExoticMethods::delete_property"] - [::core::mem::offset_of!(JSClassExoticMethods, delete_property) - 16usize]; + [::core::mem::offset_of!(JSClassExoticMethods, delete_property) - 8usize]; ["Offset of field: JSClassExoticMethods::define_own_property"] - [::core::mem::offset_of!(JSClassExoticMethods, define_own_property) - 24usize]; + [::core::mem::offset_of!(JSClassExoticMethods, define_own_property) - 12usize]; ["Offset of field: JSClassExoticMethods::has_property"] - [::core::mem::offset_of!(JSClassExoticMethods, has_property) - 32usize]; + [::core::mem::offset_of!(JSClassExoticMethods, has_property) - 16usize]; ["Offset of field: JSClassExoticMethods::get_property"] - [::core::mem::offset_of!(JSClassExoticMethods, get_property) - 40usize]; + [::core::mem::offset_of!(JSClassExoticMethods, get_property) - 20usize]; ["Offset of field: JSClassExoticMethods::set_property"] - [::core::mem::offset_of!(JSClassExoticMethods, set_property) - 48usize]; + [::core::mem::offset_of!(JSClassExoticMethods, set_property) - 24usize]; }; pub type JSClassFinalizer = ::core::option::Option; @@ -736,16 +707,15 @@ pub struct JSClassDef { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSClassDef"][::core::mem::size_of::() - 40usize]; - ["Alignment of JSClassDef"][::core::mem::align_of::() - 8usize]; + ["Size of JSClassDef"][::core::mem::size_of::() - 20usize]; + ["Alignment of JSClassDef"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSClassDef::class_name"] [::core::mem::offset_of!(JSClassDef, class_name) - 0usize]; ["Offset of field: JSClassDef::finalizer"] - [::core::mem::offset_of!(JSClassDef, finalizer) - 8usize]; - ["Offset of field: JSClassDef::gc_mark"] - [::core::mem::offset_of!(JSClassDef, gc_mark) - 16usize]; - ["Offset of field: JSClassDef::call"][::core::mem::offset_of!(JSClassDef, call) - 24usize]; - ["Offset of field: JSClassDef::exotic"][::core::mem::offset_of!(JSClassDef, exotic) - 32usize]; + [::core::mem::offset_of!(JSClassDef, finalizer) - 4usize]; + ["Offset of field: JSClassDef::gc_mark"][::core::mem::offset_of!(JSClassDef, gc_mark) - 8usize]; + ["Offset of field: JSClassDef::call"][::core::mem::offset_of!(JSClassDef, call) - 12usize]; + ["Offset of field: JSClassDef::exotic"][::core::mem::offset_of!(JSClassDef, exotic) - 16usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -757,8 +727,8 @@ pub struct JSEvalOptions { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSEvalOptions"][::core::mem::size_of::() - 24usize]; - ["Alignment of JSEvalOptions"][::core::mem::align_of::() - 8usize]; + ["Size of JSEvalOptions"][::core::mem::size_of::() - 16usize]; + ["Alignment of JSEvalOptions"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSEvalOptions::version"] [::core::mem::offset_of!(JSEvalOptions, version) - 0usize]; ["Offset of field: JSEvalOptions::eval_flags"] @@ -766,7 +736,7 @@ const _: () = { ["Offset of field: JSEvalOptions::filename"] [::core::mem::offset_of!(JSEvalOptions, filename) - 8usize]; ["Offset of field: JSEvalOptions::line_num"] - [::core::mem::offset_of!(JSEvalOptions, line_num) - 16usize]; + [::core::mem::offset_of!(JSEvalOptions, line_num) - 12usize]; }; unsafe extern "C" { pub fn JS_NewClassID(rt: *mut JSRuntime, pclass_id: *mut JSClassID) -> JSClassID; @@ -1454,17 +1424,17 @@ pub struct JSSharedArrayBufferFunctions { #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSSharedArrayBufferFunctions"] - [::core::mem::size_of::() - 32usize]; + [::core::mem::size_of::() - 16usize]; ["Alignment of JSSharedArrayBufferFunctions"] - [::core::mem::align_of::() - 8usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: JSSharedArrayBufferFunctions::sab_alloc"] [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_alloc) - 0usize]; ["Offset of field: JSSharedArrayBufferFunctions::sab_free"] - [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_free) - 8usize]; + [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_free) - 4usize]; ["Offset of field: JSSharedArrayBufferFunctions::sab_dup"] - [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_dup) - 16usize]; + [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_dup) - 8usize]; ["Offset of field: JSSharedArrayBufferFunctions::sab_opaque"] - [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_opaque) - 24usize]; + [::core::mem::offset_of!(JSSharedArrayBufferFunctions, sab_opaque) - 12usize]; }; unsafe extern "C" { pub fn JS_SetSharedArrayBufferFunctions( @@ -1673,10 +1643,10 @@ pub struct JSSABTab { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSSABTab"][::core::mem::size_of::() - 16usize]; - ["Alignment of JSSABTab"][::core::mem::align_of::() - 8usize]; + ["Size of JSSABTab"][::core::mem::size_of::() - 8usize]; + ["Alignment of JSSABTab"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSSABTab::tab"][::core::mem::offset_of!(JSSABTab, tab) - 0usize]; - ["Offset of field: JSSABTab::len"][::core::mem::offset_of!(JSSABTab, len) - 8usize]; + ["Offset of field: JSSABTab::len"][::core::mem::offset_of!(JSSABTab, len) - 4usize]; }; unsafe extern "C" { pub fn JS_WriteObject( @@ -1805,8 +1775,8 @@ pub union JSCFunctionType { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSCFunctionType"][::core::mem::size_of::() - 8usize]; - ["Alignment of JSCFunctionType"][::core::mem::align_of::() - 8usize]; + ["Size of JSCFunctionType"][::core::mem::size_of::() - 4usize]; + ["Alignment of JSCFunctionType"][::core::mem::align_of::() - 4usize]; ["Offset of field: JSCFunctionType::generic"] [::core::mem::offset_of!(JSCFunctionType, generic) - 0usize]; ["Offset of field: JSCFunctionType::generic_magic"] @@ -1927,9 +1897,9 @@ pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1 { #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::size_of::() - 16usize]; + [::core::mem::size_of::() - 8usize]; ["Alignment of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1"] - [::core::mem::align_of::() - 8usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1::length"][::core::mem::offset_of!( JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1, length @@ -1939,7 +1909,7 @@ const _: () = { cproto ) - 1usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1::cfunc"] - [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1, cfunc) - 8usize]; + [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_1, cfunc) - 4usize]; }; #[repr(C)] #[derive(Copy, Clone)] @@ -1950,13 +1920,13 @@ pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2 { #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2"] - [::core::mem::size_of::() - 16usize]; + [::core::mem::size_of::() - 8usize]; ["Alignment of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2"] - [::core::mem::align_of::() - 8usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2::get"] [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2, get) - 0usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2::set"] - [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2, set) - 8usize]; + [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_2, set) - 4usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1967,13 +1937,13 @@ pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3 { #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3"] - [::core::mem::size_of::() - 16usize]; + [::core::mem::size_of::() - 8usize]; ["Alignment of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3"] - [::core::mem::align_of::() - 8usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3::name"] [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3, name) - 0usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3::base"] - [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3, base) - 8usize]; + [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_3, base) - 4usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1984,18 +1954,18 @@ pub struct JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4 { #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4"] - [::core::mem::size_of::() - 16usize]; + [::core::mem::size_of::() - 8usize]; ["Alignment of JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4"] - [::core::mem::align_of::() - 8usize]; + [::core::mem::align_of::() - 4usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4::tab"] [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4, tab) - 0usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4::len"] - [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4, len) - 8usize]; + [::core::mem::offset_of!(JSCFunctionListEntry__bindgen_ty_1__bindgen_ty_4, len) - 4usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of JSCFunctionListEntry__bindgen_ty_1"] - [::core::mem::size_of::() - 16usize]; + [::core::mem::size_of::() - 8usize]; ["Alignment of JSCFunctionListEntry__bindgen_ty_1"] [::core::mem::align_of::() - 8usize]; ["Offset of field: JSCFunctionListEntry__bindgen_ty_1::func"] @@ -2019,18 +1989,18 @@ const _: () = { }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of JSCFunctionListEntry"][::core::mem::size_of::() - 32usize]; + ["Size of JSCFunctionListEntry"][::core::mem::size_of::() - 16usize]; ["Alignment of JSCFunctionListEntry"][::core::mem::align_of::() - 8usize]; ["Offset of field: JSCFunctionListEntry::name"] [::core::mem::offset_of!(JSCFunctionListEntry, name) - 0usize]; ["Offset of field: JSCFunctionListEntry::prop_flags"] - [::core::mem::offset_of!(JSCFunctionListEntry, prop_flags) - 8usize]; + [::core::mem::offset_of!(JSCFunctionListEntry, prop_flags) - 4usize]; ["Offset of field: JSCFunctionListEntry::def_type"] - [::core::mem::offset_of!(JSCFunctionListEntry, def_type) - 9usize]; + [::core::mem::offset_of!(JSCFunctionListEntry, def_type) - 5usize]; ["Offset of field: JSCFunctionListEntry::magic"] - [::core::mem::offset_of!(JSCFunctionListEntry, magic) - 10usize]; + [::core::mem::offset_of!(JSCFunctionListEntry, magic) - 6usize]; ["Offset of field: JSCFunctionListEntry::u"] - [::core::mem::offset_of!(JSCFunctionListEntry, u) - 16usize]; + [::core::mem::offset_of!(JSCFunctionListEntry, u) - 8usize]; }; unsafe extern "C" { pub fn JS_SetPropertyFunctionList( @@ -2087,235 +2057,235 @@ unsafe extern "C" { unsafe extern "C" { pub fn js_std_cmd(cmd: ::core::ffi::c_int, ...) -> usize; } -pub const __JS_ATOM_NULL: _bindgen_ty_4 = 0; -pub const JS_ATOM_null: _bindgen_ty_4 = 1; -pub const JS_ATOM_false: _bindgen_ty_4 = 2; -pub const JS_ATOM_true: _bindgen_ty_4 = 3; -pub const JS_ATOM_if: _bindgen_ty_4 = 4; -pub const JS_ATOM_else: _bindgen_ty_4 = 5; -pub const JS_ATOM_return: _bindgen_ty_4 = 6; -pub const JS_ATOM_var: _bindgen_ty_4 = 7; -pub const JS_ATOM_this: _bindgen_ty_4 = 8; -pub const JS_ATOM_delete: _bindgen_ty_4 = 9; -pub const JS_ATOM_void: _bindgen_ty_4 = 10; -pub const JS_ATOM_typeof: _bindgen_ty_4 = 11; -pub const JS_ATOM_new: _bindgen_ty_4 = 12; -pub const JS_ATOM_in: _bindgen_ty_4 = 13; -pub const JS_ATOM_instanceof: _bindgen_ty_4 = 14; -pub const JS_ATOM_do: _bindgen_ty_4 = 15; -pub const JS_ATOM_while: _bindgen_ty_4 = 16; -pub const JS_ATOM_for: _bindgen_ty_4 = 17; -pub const JS_ATOM_break: _bindgen_ty_4 = 18; -pub const JS_ATOM_continue: _bindgen_ty_4 = 19; -pub const JS_ATOM_switch: _bindgen_ty_4 = 20; -pub const JS_ATOM_case: _bindgen_ty_4 = 21; -pub const JS_ATOM_default: _bindgen_ty_4 = 22; -pub const JS_ATOM_throw: _bindgen_ty_4 = 23; -pub const JS_ATOM_try: _bindgen_ty_4 = 24; -pub const JS_ATOM_catch: _bindgen_ty_4 = 25; -pub const JS_ATOM_finally: _bindgen_ty_4 = 26; -pub const JS_ATOM_function: _bindgen_ty_4 = 27; -pub const JS_ATOM_debugger: _bindgen_ty_4 = 28; -pub const JS_ATOM_with: _bindgen_ty_4 = 29; -pub const JS_ATOM_class: _bindgen_ty_4 = 30; -pub const JS_ATOM_const: _bindgen_ty_4 = 31; -pub const JS_ATOM_enum: _bindgen_ty_4 = 32; -pub const JS_ATOM_export: _bindgen_ty_4 = 33; -pub const JS_ATOM_extends: _bindgen_ty_4 = 34; -pub const JS_ATOM_import: _bindgen_ty_4 = 35; -pub const JS_ATOM_super: _bindgen_ty_4 = 36; -pub const JS_ATOM_implements: _bindgen_ty_4 = 37; -pub const JS_ATOM_interface: _bindgen_ty_4 = 38; -pub const JS_ATOM_let: _bindgen_ty_4 = 39; -pub const JS_ATOM_package: _bindgen_ty_4 = 40; -pub const JS_ATOM_private: _bindgen_ty_4 = 41; -pub const JS_ATOM_protected: _bindgen_ty_4 = 42; -pub const JS_ATOM_public: _bindgen_ty_4 = 43; -pub const JS_ATOM_static: _bindgen_ty_4 = 44; -pub const JS_ATOM_yield: _bindgen_ty_4 = 45; -pub const JS_ATOM_await: _bindgen_ty_4 = 46; -pub const JS_ATOM_empty_string: _bindgen_ty_4 = 47; -pub const JS_ATOM_keys: _bindgen_ty_4 = 48; -pub const JS_ATOM_size: _bindgen_ty_4 = 49; -pub const JS_ATOM_length: _bindgen_ty_4 = 50; -pub const JS_ATOM_message: _bindgen_ty_4 = 51; -pub const JS_ATOM_cause: _bindgen_ty_4 = 52; -pub const JS_ATOM_errors: _bindgen_ty_4 = 53; -pub const JS_ATOM_stack: _bindgen_ty_4 = 54; -pub const JS_ATOM_name: _bindgen_ty_4 = 55; -pub const JS_ATOM_toString: _bindgen_ty_4 = 56; -pub const JS_ATOM_toLocaleString: _bindgen_ty_4 = 57; -pub const JS_ATOM_valueOf: _bindgen_ty_4 = 58; -pub const JS_ATOM_eval: _bindgen_ty_4 = 59; -pub const JS_ATOM_prototype: _bindgen_ty_4 = 60; -pub const JS_ATOM_constructor: _bindgen_ty_4 = 61; -pub const JS_ATOM_configurable: _bindgen_ty_4 = 62; -pub const JS_ATOM_writable: _bindgen_ty_4 = 63; -pub const JS_ATOM_enumerable: _bindgen_ty_4 = 64; -pub const JS_ATOM_value: _bindgen_ty_4 = 65; -pub const JS_ATOM_get: _bindgen_ty_4 = 66; -pub const JS_ATOM_set: _bindgen_ty_4 = 67; -pub const JS_ATOM_of: _bindgen_ty_4 = 68; -pub const JS_ATOM___proto__: _bindgen_ty_4 = 69; -pub const JS_ATOM_undefined: _bindgen_ty_4 = 70; -pub const JS_ATOM_number: _bindgen_ty_4 = 71; -pub const JS_ATOM_boolean: _bindgen_ty_4 = 72; -pub const JS_ATOM_string: _bindgen_ty_4 = 73; -pub const JS_ATOM_object: _bindgen_ty_4 = 74; -pub const JS_ATOM_symbol: _bindgen_ty_4 = 75; -pub const JS_ATOM_integer: _bindgen_ty_4 = 76; -pub const JS_ATOM_unknown: _bindgen_ty_4 = 77; -pub const JS_ATOM_arguments: _bindgen_ty_4 = 78; -pub const JS_ATOM_callee: _bindgen_ty_4 = 79; -pub const JS_ATOM_caller: _bindgen_ty_4 = 80; -pub const JS_ATOM__eval_: _bindgen_ty_4 = 81; -pub const JS_ATOM__ret_: _bindgen_ty_4 = 82; -pub const JS_ATOM__var_: _bindgen_ty_4 = 83; -pub const JS_ATOM__arg_var_: _bindgen_ty_4 = 84; -pub const JS_ATOM__with_: _bindgen_ty_4 = 85; -pub const JS_ATOM_lastIndex: _bindgen_ty_4 = 86; -pub const JS_ATOM_target: _bindgen_ty_4 = 87; -pub const JS_ATOM_index: _bindgen_ty_4 = 88; -pub const JS_ATOM_input: _bindgen_ty_4 = 89; -pub const JS_ATOM_defineProperties: _bindgen_ty_4 = 90; -pub const JS_ATOM_apply: _bindgen_ty_4 = 91; -pub const JS_ATOM_join: _bindgen_ty_4 = 92; -pub const JS_ATOM_concat: _bindgen_ty_4 = 93; -pub const JS_ATOM_split: _bindgen_ty_4 = 94; -pub const JS_ATOM_construct: _bindgen_ty_4 = 95; -pub const JS_ATOM_getPrototypeOf: _bindgen_ty_4 = 96; -pub const JS_ATOM_setPrototypeOf: _bindgen_ty_4 = 97; -pub const JS_ATOM_isExtensible: _bindgen_ty_4 = 98; -pub const JS_ATOM_preventExtensions: _bindgen_ty_4 = 99; -pub const JS_ATOM_has: _bindgen_ty_4 = 100; -pub const JS_ATOM_deleteProperty: _bindgen_ty_4 = 101; -pub const JS_ATOM_defineProperty: _bindgen_ty_4 = 102; -pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_4 = 103; -pub const JS_ATOM_ownKeys: _bindgen_ty_4 = 104; -pub const JS_ATOM_add: _bindgen_ty_4 = 105; -pub const JS_ATOM_done: _bindgen_ty_4 = 106; -pub const JS_ATOM_next: _bindgen_ty_4 = 107; -pub const JS_ATOM_values: _bindgen_ty_4 = 108; -pub const JS_ATOM_source: _bindgen_ty_4 = 109; -pub const JS_ATOM_flags: _bindgen_ty_4 = 110; -pub const JS_ATOM_global: _bindgen_ty_4 = 111; -pub const JS_ATOM_unicode: _bindgen_ty_4 = 112; -pub const JS_ATOM_raw: _bindgen_ty_4 = 113; -pub const JS_ATOM_rawJSON: _bindgen_ty_4 = 114; -pub const JS_ATOM_new_target: _bindgen_ty_4 = 115; -pub const JS_ATOM_this_active_func: _bindgen_ty_4 = 116; -pub const JS_ATOM_home_object: _bindgen_ty_4 = 117; -pub const JS_ATOM_computed_field: _bindgen_ty_4 = 118; -pub const JS_ATOM_static_computed_field: _bindgen_ty_4 = 119; -pub const JS_ATOM_class_fields_init: _bindgen_ty_4 = 120; -pub const JS_ATOM_brand: _bindgen_ty_4 = 121; -pub const JS_ATOM_hash_constructor: _bindgen_ty_4 = 122; -pub const JS_ATOM_as: _bindgen_ty_4 = 123; -pub const JS_ATOM_from: _bindgen_ty_4 = 124; -pub const JS_ATOM_fromAsync: _bindgen_ty_4 = 125; -pub const JS_ATOM_meta: _bindgen_ty_4 = 126; -pub const JS_ATOM__default_: _bindgen_ty_4 = 127; -pub const JS_ATOM__star_: _bindgen_ty_4 = 128; -pub const JS_ATOM_Module: _bindgen_ty_4 = 129; -pub const JS_ATOM_then: _bindgen_ty_4 = 130; -pub const JS_ATOM_resolve: _bindgen_ty_4 = 131; -pub const JS_ATOM_reject: _bindgen_ty_4 = 132; -pub const JS_ATOM_promise: _bindgen_ty_4 = 133; -pub const JS_ATOM_proxy: _bindgen_ty_4 = 134; -pub const JS_ATOM_revoke: _bindgen_ty_4 = 135; -pub const JS_ATOM_async: _bindgen_ty_4 = 136; -pub const JS_ATOM_exec: _bindgen_ty_4 = 137; -pub const JS_ATOM_groups: _bindgen_ty_4 = 138; -pub const JS_ATOM_indices: _bindgen_ty_4 = 139; -pub const JS_ATOM_status: _bindgen_ty_4 = 140; -pub const JS_ATOM_reason: _bindgen_ty_4 = 141; -pub const JS_ATOM_globalThis: _bindgen_ty_4 = 142; -pub const JS_ATOM_bigint: _bindgen_ty_4 = 143; -pub const JS_ATOM_not_equal: _bindgen_ty_4 = 144; -pub const JS_ATOM_timed_out: _bindgen_ty_4 = 145; -pub const JS_ATOM_ok: _bindgen_ty_4 = 146; -pub const JS_ATOM_toJSON: _bindgen_ty_4 = 147; -pub const JS_ATOM_maxByteLength: _bindgen_ty_4 = 148; -pub const JS_ATOM_zip: _bindgen_ty_4 = 149; -pub const JS_ATOM_zipKeyed: _bindgen_ty_4 = 150; -pub const JS_ATOM_Object: _bindgen_ty_4 = 151; -pub const JS_ATOM_Array: _bindgen_ty_4 = 152; -pub const JS_ATOM_Error: _bindgen_ty_4 = 153; -pub const JS_ATOM_Number: _bindgen_ty_4 = 154; -pub const JS_ATOM_String: _bindgen_ty_4 = 155; -pub const JS_ATOM_Boolean: _bindgen_ty_4 = 156; -pub const JS_ATOM_Symbol: _bindgen_ty_4 = 157; -pub const JS_ATOM_Arguments: _bindgen_ty_4 = 158; -pub const JS_ATOM_Math: _bindgen_ty_4 = 159; -pub const JS_ATOM_JSON: _bindgen_ty_4 = 160; -pub const JS_ATOM_Date: _bindgen_ty_4 = 161; -pub const JS_ATOM_Function: _bindgen_ty_4 = 162; -pub const JS_ATOM_GeneratorFunction: _bindgen_ty_4 = 163; -pub const JS_ATOM_ForInIterator: _bindgen_ty_4 = 164; -pub const JS_ATOM_RegExp: _bindgen_ty_4 = 165; -pub const JS_ATOM_ArrayBuffer: _bindgen_ty_4 = 166; -pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_4 = 167; -pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_4 = 168; -pub const JS_ATOM_Int8Array: _bindgen_ty_4 = 169; -pub const JS_ATOM_Uint8Array: _bindgen_ty_4 = 170; -pub const JS_ATOM_Int16Array: _bindgen_ty_4 = 171; -pub const JS_ATOM_Uint16Array: _bindgen_ty_4 = 172; -pub const JS_ATOM_Int32Array: _bindgen_ty_4 = 173; -pub const JS_ATOM_Uint32Array: _bindgen_ty_4 = 174; -pub const JS_ATOM_BigInt64Array: _bindgen_ty_4 = 175; -pub const JS_ATOM_BigUint64Array: _bindgen_ty_4 = 176; -pub const JS_ATOM_Float16Array: _bindgen_ty_4 = 177; -pub const JS_ATOM_Float32Array: _bindgen_ty_4 = 178; -pub const JS_ATOM_Float64Array: _bindgen_ty_4 = 179; -pub const JS_ATOM_DataView: _bindgen_ty_4 = 180; -pub const JS_ATOM_BigInt: _bindgen_ty_4 = 181; -pub const JS_ATOM_WeakRef: _bindgen_ty_4 = 182; -pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_4 = 183; -pub const JS_ATOM_Map: _bindgen_ty_4 = 184; -pub const JS_ATOM_Set: _bindgen_ty_4 = 185; -pub const JS_ATOM_WeakMap: _bindgen_ty_4 = 186; -pub const JS_ATOM_WeakSet: _bindgen_ty_4 = 187; -pub const JS_ATOM_Iterator: _bindgen_ty_4 = 188; -pub const JS_ATOM_IteratorConcat: _bindgen_ty_4 = 189; -pub const JS_ATOM_IteratorHelper: _bindgen_ty_4 = 190; -pub const JS_ATOM_IteratorWrap: _bindgen_ty_4 = 191; -pub const JS_ATOM_Map_Iterator: _bindgen_ty_4 = 192; -pub const JS_ATOM_Set_Iterator: _bindgen_ty_4 = 193; -pub const JS_ATOM_Array_Iterator: _bindgen_ty_4 = 194; -pub const JS_ATOM_String_Iterator: _bindgen_ty_4 = 195; -pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_4 = 196; -pub const JS_ATOM_Generator: _bindgen_ty_4 = 197; -pub const JS_ATOM_Proxy: _bindgen_ty_4 = 198; -pub const JS_ATOM_Promise: _bindgen_ty_4 = 199; -pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_4 = 200; -pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_4 = 201; -pub const JS_ATOM_AsyncFunction: _bindgen_ty_4 = 202; -pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_4 = 203; -pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_4 = 204; -pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_4 = 205; -pub const JS_ATOM_AsyncGenerator: _bindgen_ty_4 = 206; -pub const JS_ATOM_EvalError: _bindgen_ty_4 = 207; -pub const JS_ATOM_RangeError: _bindgen_ty_4 = 208; -pub const JS_ATOM_ReferenceError: _bindgen_ty_4 = 209; -pub const JS_ATOM_SyntaxError: _bindgen_ty_4 = 210; -pub const JS_ATOM_TypeError: _bindgen_ty_4 = 211; -pub const JS_ATOM_URIError: _bindgen_ty_4 = 212; -pub const JS_ATOM_InternalError: _bindgen_ty_4 = 213; -pub const JS_ATOM_DOMException: _bindgen_ty_4 = 214; -pub const JS_ATOM_CallSite: _bindgen_ty_4 = 215; -pub const JS_ATOM_Private_brand: _bindgen_ty_4 = 216; -pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_4 = 217; -pub const JS_ATOM_Symbol_iterator: _bindgen_ty_4 = 218; -pub const JS_ATOM_Symbol_match: _bindgen_ty_4 = 219; -pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_4 = 220; -pub const JS_ATOM_Symbol_replace: _bindgen_ty_4 = 221; -pub const JS_ATOM_Symbol_search: _bindgen_ty_4 = 222; -pub const JS_ATOM_Symbol_split: _bindgen_ty_4 = 223; -pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_4 = 224; -pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_4 = 225; -pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_4 = 226; -pub const JS_ATOM_Symbol_species: _bindgen_ty_4 = 227; -pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_4 = 228; -pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_4 = 229; -pub const JS_ATOM_END: _bindgen_ty_4 = 230; -pub type _bindgen_ty_4 = ::core::ffi::c_uint; +pub const __JS_ATOM_NULL: _bindgen_ty_2 = 0; +pub const JS_ATOM_null: _bindgen_ty_2 = 1; +pub const JS_ATOM_false: _bindgen_ty_2 = 2; +pub const JS_ATOM_true: _bindgen_ty_2 = 3; +pub const JS_ATOM_if: _bindgen_ty_2 = 4; +pub const JS_ATOM_else: _bindgen_ty_2 = 5; +pub const JS_ATOM_return: _bindgen_ty_2 = 6; +pub const JS_ATOM_var: _bindgen_ty_2 = 7; +pub const JS_ATOM_this: _bindgen_ty_2 = 8; +pub const JS_ATOM_delete: _bindgen_ty_2 = 9; +pub const JS_ATOM_void: _bindgen_ty_2 = 10; +pub const JS_ATOM_typeof: _bindgen_ty_2 = 11; +pub const JS_ATOM_new: _bindgen_ty_2 = 12; +pub const JS_ATOM_in: _bindgen_ty_2 = 13; +pub const JS_ATOM_instanceof: _bindgen_ty_2 = 14; +pub const JS_ATOM_do: _bindgen_ty_2 = 15; +pub const JS_ATOM_while: _bindgen_ty_2 = 16; +pub const JS_ATOM_for: _bindgen_ty_2 = 17; +pub const JS_ATOM_break: _bindgen_ty_2 = 18; +pub const JS_ATOM_continue: _bindgen_ty_2 = 19; +pub const JS_ATOM_switch: _bindgen_ty_2 = 20; +pub const JS_ATOM_case: _bindgen_ty_2 = 21; +pub const JS_ATOM_default: _bindgen_ty_2 = 22; +pub const JS_ATOM_throw: _bindgen_ty_2 = 23; +pub const JS_ATOM_try: _bindgen_ty_2 = 24; +pub const JS_ATOM_catch: _bindgen_ty_2 = 25; +pub const JS_ATOM_finally: _bindgen_ty_2 = 26; +pub const JS_ATOM_function: _bindgen_ty_2 = 27; +pub const JS_ATOM_debugger: _bindgen_ty_2 = 28; +pub const JS_ATOM_with: _bindgen_ty_2 = 29; +pub const JS_ATOM_class: _bindgen_ty_2 = 30; +pub const JS_ATOM_const: _bindgen_ty_2 = 31; +pub const JS_ATOM_enum: _bindgen_ty_2 = 32; +pub const JS_ATOM_export: _bindgen_ty_2 = 33; +pub const JS_ATOM_extends: _bindgen_ty_2 = 34; +pub const JS_ATOM_import: _bindgen_ty_2 = 35; +pub const JS_ATOM_super: _bindgen_ty_2 = 36; +pub const JS_ATOM_implements: _bindgen_ty_2 = 37; +pub const JS_ATOM_interface: _bindgen_ty_2 = 38; +pub const JS_ATOM_let: _bindgen_ty_2 = 39; +pub const JS_ATOM_package: _bindgen_ty_2 = 40; +pub const JS_ATOM_private: _bindgen_ty_2 = 41; +pub const JS_ATOM_protected: _bindgen_ty_2 = 42; +pub const JS_ATOM_public: _bindgen_ty_2 = 43; +pub const JS_ATOM_static: _bindgen_ty_2 = 44; +pub const JS_ATOM_yield: _bindgen_ty_2 = 45; +pub const JS_ATOM_await: _bindgen_ty_2 = 46; +pub const JS_ATOM_empty_string: _bindgen_ty_2 = 47; +pub const JS_ATOM_keys: _bindgen_ty_2 = 48; +pub const JS_ATOM_size: _bindgen_ty_2 = 49; +pub const JS_ATOM_length: _bindgen_ty_2 = 50; +pub const JS_ATOM_message: _bindgen_ty_2 = 51; +pub const JS_ATOM_cause: _bindgen_ty_2 = 52; +pub const JS_ATOM_errors: _bindgen_ty_2 = 53; +pub const JS_ATOM_stack: _bindgen_ty_2 = 54; +pub const JS_ATOM_name: _bindgen_ty_2 = 55; +pub const JS_ATOM_toString: _bindgen_ty_2 = 56; +pub const JS_ATOM_toLocaleString: _bindgen_ty_2 = 57; +pub const JS_ATOM_valueOf: _bindgen_ty_2 = 58; +pub const JS_ATOM_eval: _bindgen_ty_2 = 59; +pub const JS_ATOM_prototype: _bindgen_ty_2 = 60; +pub const JS_ATOM_constructor: _bindgen_ty_2 = 61; +pub const JS_ATOM_configurable: _bindgen_ty_2 = 62; +pub const JS_ATOM_writable: _bindgen_ty_2 = 63; +pub const JS_ATOM_enumerable: _bindgen_ty_2 = 64; +pub const JS_ATOM_value: _bindgen_ty_2 = 65; +pub const JS_ATOM_get: _bindgen_ty_2 = 66; +pub const JS_ATOM_set: _bindgen_ty_2 = 67; +pub const JS_ATOM_of: _bindgen_ty_2 = 68; +pub const JS_ATOM___proto__: _bindgen_ty_2 = 69; +pub const JS_ATOM_undefined: _bindgen_ty_2 = 70; +pub const JS_ATOM_number: _bindgen_ty_2 = 71; +pub const JS_ATOM_boolean: _bindgen_ty_2 = 72; +pub const JS_ATOM_string: _bindgen_ty_2 = 73; +pub const JS_ATOM_object: _bindgen_ty_2 = 74; +pub const JS_ATOM_symbol: _bindgen_ty_2 = 75; +pub const JS_ATOM_integer: _bindgen_ty_2 = 76; +pub const JS_ATOM_unknown: _bindgen_ty_2 = 77; +pub const JS_ATOM_arguments: _bindgen_ty_2 = 78; +pub const JS_ATOM_callee: _bindgen_ty_2 = 79; +pub const JS_ATOM_caller: _bindgen_ty_2 = 80; +pub const JS_ATOM__eval_: _bindgen_ty_2 = 81; +pub const JS_ATOM__ret_: _bindgen_ty_2 = 82; +pub const JS_ATOM__var_: _bindgen_ty_2 = 83; +pub const JS_ATOM__arg_var_: _bindgen_ty_2 = 84; +pub const JS_ATOM__with_: _bindgen_ty_2 = 85; +pub const JS_ATOM_lastIndex: _bindgen_ty_2 = 86; +pub const JS_ATOM_target: _bindgen_ty_2 = 87; +pub const JS_ATOM_index: _bindgen_ty_2 = 88; +pub const JS_ATOM_input: _bindgen_ty_2 = 89; +pub const JS_ATOM_defineProperties: _bindgen_ty_2 = 90; +pub const JS_ATOM_apply: _bindgen_ty_2 = 91; +pub const JS_ATOM_join: _bindgen_ty_2 = 92; +pub const JS_ATOM_concat: _bindgen_ty_2 = 93; +pub const JS_ATOM_split: _bindgen_ty_2 = 94; +pub const JS_ATOM_construct: _bindgen_ty_2 = 95; +pub const JS_ATOM_getPrototypeOf: _bindgen_ty_2 = 96; +pub const JS_ATOM_setPrototypeOf: _bindgen_ty_2 = 97; +pub const JS_ATOM_isExtensible: _bindgen_ty_2 = 98; +pub const JS_ATOM_preventExtensions: _bindgen_ty_2 = 99; +pub const JS_ATOM_has: _bindgen_ty_2 = 100; +pub const JS_ATOM_deleteProperty: _bindgen_ty_2 = 101; +pub const JS_ATOM_defineProperty: _bindgen_ty_2 = 102; +pub const JS_ATOM_getOwnPropertyDescriptor: _bindgen_ty_2 = 103; +pub const JS_ATOM_ownKeys: _bindgen_ty_2 = 104; +pub const JS_ATOM_add: _bindgen_ty_2 = 105; +pub const JS_ATOM_done: _bindgen_ty_2 = 106; +pub const JS_ATOM_next: _bindgen_ty_2 = 107; +pub const JS_ATOM_values: _bindgen_ty_2 = 108; +pub const JS_ATOM_source: _bindgen_ty_2 = 109; +pub const JS_ATOM_flags: _bindgen_ty_2 = 110; +pub const JS_ATOM_global: _bindgen_ty_2 = 111; +pub const JS_ATOM_unicode: _bindgen_ty_2 = 112; +pub const JS_ATOM_raw: _bindgen_ty_2 = 113; +pub const JS_ATOM_rawJSON: _bindgen_ty_2 = 114; +pub const JS_ATOM_new_target: _bindgen_ty_2 = 115; +pub const JS_ATOM_this_active_func: _bindgen_ty_2 = 116; +pub const JS_ATOM_home_object: _bindgen_ty_2 = 117; +pub const JS_ATOM_computed_field: _bindgen_ty_2 = 118; +pub const JS_ATOM_static_computed_field: _bindgen_ty_2 = 119; +pub const JS_ATOM_class_fields_init: _bindgen_ty_2 = 120; +pub const JS_ATOM_brand: _bindgen_ty_2 = 121; +pub const JS_ATOM_hash_constructor: _bindgen_ty_2 = 122; +pub const JS_ATOM_as: _bindgen_ty_2 = 123; +pub const JS_ATOM_from: _bindgen_ty_2 = 124; +pub const JS_ATOM_fromAsync: _bindgen_ty_2 = 125; +pub const JS_ATOM_meta: _bindgen_ty_2 = 126; +pub const JS_ATOM__default_: _bindgen_ty_2 = 127; +pub const JS_ATOM__star_: _bindgen_ty_2 = 128; +pub const JS_ATOM_Module: _bindgen_ty_2 = 129; +pub const JS_ATOM_then: _bindgen_ty_2 = 130; +pub const JS_ATOM_resolve: _bindgen_ty_2 = 131; +pub const JS_ATOM_reject: _bindgen_ty_2 = 132; +pub const JS_ATOM_promise: _bindgen_ty_2 = 133; +pub const JS_ATOM_proxy: _bindgen_ty_2 = 134; +pub const JS_ATOM_revoke: _bindgen_ty_2 = 135; +pub const JS_ATOM_async: _bindgen_ty_2 = 136; +pub const JS_ATOM_exec: _bindgen_ty_2 = 137; +pub const JS_ATOM_groups: _bindgen_ty_2 = 138; +pub const JS_ATOM_indices: _bindgen_ty_2 = 139; +pub const JS_ATOM_status: _bindgen_ty_2 = 140; +pub const JS_ATOM_reason: _bindgen_ty_2 = 141; +pub const JS_ATOM_globalThis: _bindgen_ty_2 = 142; +pub const JS_ATOM_bigint: _bindgen_ty_2 = 143; +pub const JS_ATOM_not_equal: _bindgen_ty_2 = 144; +pub const JS_ATOM_timed_out: _bindgen_ty_2 = 145; +pub const JS_ATOM_ok: _bindgen_ty_2 = 146; +pub const JS_ATOM_toJSON: _bindgen_ty_2 = 147; +pub const JS_ATOM_maxByteLength: _bindgen_ty_2 = 148; +pub const JS_ATOM_zip: _bindgen_ty_2 = 149; +pub const JS_ATOM_zipKeyed: _bindgen_ty_2 = 150; +pub const JS_ATOM_Object: _bindgen_ty_2 = 151; +pub const JS_ATOM_Array: _bindgen_ty_2 = 152; +pub const JS_ATOM_Error: _bindgen_ty_2 = 153; +pub const JS_ATOM_Number: _bindgen_ty_2 = 154; +pub const JS_ATOM_String: _bindgen_ty_2 = 155; +pub const JS_ATOM_Boolean: _bindgen_ty_2 = 156; +pub const JS_ATOM_Symbol: _bindgen_ty_2 = 157; +pub const JS_ATOM_Arguments: _bindgen_ty_2 = 158; +pub const JS_ATOM_Math: _bindgen_ty_2 = 159; +pub const JS_ATOM_JSON: _bindgen_ty_2 = 160; +pub const JS_ATOM_Date: _bindgen_ty_2 = 161; +pub const JS_ATOM_Function: _bindgen_ty_2 = 162; +pub const JS_ATOM_GeneratorFunction: _bindgen_ty_2 = 163; +pub const JS_ATOM_ForInIterator: _bindgen_ty_2 = 164; +pub const JS_ATOM_RegExp: _bindgen_ty_2 = 165; +pub const JS_ATOM_ArrayBuffer: _bindgen_ty_2 = 166; +pub const JS_ATOM_SharedArrayBuffer: _bindgen_ty_2 = 167; +pub const JS_ATOM_Uint8ClampedArray: _bindgen_ty_2 = 168; +pub const JS_ATOM_Int8Array: _bindgen_ty_2 = 169; +pub const JS_ATOM_Uint8Array: _bindgen_ty_2 = 170; +pub const JS_ATOM_Int16Array: _bindgen_ty_2 = 171; +pub const JS_ATOM_Uint16Array: _bindgen_ty_2 = 172; +pub const JS_ATOM_Int32Array: _bindgen_ty_2 = 173; +pub const JS_ATOM_Uint32Array: _bindgen_ty_2 = 174; +pub const JS_ATOM_BigInt64Array: _bindgen_ty_2 = 175; +pub const JS_ATOM_BigUint64Array: _bindgen_ty_2 = 176; +pub const JS_ATOM_Float16Array: _bindgen_ty_2 = 177; +pub const JS_ATOM_Float32Array: _bindgen_ty_2 = 178; +pub const JS_ATOM_Float64Array: _bindgen_ty_2 = 179; +pub const JS_ATOM_DataView: _bindgen_ty_2 = 180; +pub const JS_ATOM_BigInt: _bindgen_ty_2 = 181; +pub const JS_ATOM_WeakRef: _bindgen_ty_2 = 182; +pub const JS_ATOM_FinalizationRegistry: _bindgen_ty_2 = 183; +pub const JS_ATOM_Map: _bindgen_ty_2 = 184; +pub const JS_ATOM_Set: _bindgen_ty_2 = 185; +pub const JS_ATOM_WeakMap: _bindgen_ty_2 = 186; +pub const JS_ATOM_WeakSet: _bindgen_ty_2 = 187; +pub const JS_ATOM_Iterator: _bindgen_ty_2 = 188; +pub const JS_ATOM_IteratorConcat: _bindgen_ty_2 = 189; +pub const JS_ATOM_IteratorHelper: _bindgen_ty_2 = 190; +pub const JS_ATOM_IteratorWrap: _bindgen_ty_2 = 191; +pub const JS_ATOM_Map_Iterator: _bindgen_ty_2 = 192; +pub const JS_ATOM_Set_Iterator: _bindgen_ty_2 = 193; +pub const JS_ATOM_Array_Iterator: _bindgen_ty_2 = 194; +pub const JS_ATOM_String_Iterator: _bindgen_ty_2 = 195; +pub const JS_ATOM_RegExp_String_Iterator: _bindgen_ty_2 = 196; +pub const JS_ATOM_Generator: _bindgen_ty_2 = 197; +pub const JS_ATOM_Proxy: _bindgen_ty_2 = 198; +pub const JS_ATOM_Promise: _bindgen_ty_2 = 199; +pub const JS_ATOM_PromiseResolveFunction: _bindgen_ty_2 = 200; +pub const JS_ATOM_PromiseRejectFunction: _bindgen_ty_2 = 201; +pub const JS_ATOM_AsyncFunction: _bindgen_ty_2 = 202; +pub const JS_ATOM_AsyncFunctionResolve: _bindgen_ty_2 = 203; +pub const JS_ATOM_AsyncFunctionReject: _bindgen_ty_2 = 204; +pub const JS_ATOM_AsyncGeneratorFunction: _bindgen_ty_2 = 205; +pub const JS_ATOM_AsyncGenerator: _bindgen_ty_2 = 206; +pub const JS_ATOM_EvalError: _bindgen_ty_2 = 207; +pub const JS_ATOM_RangeError: _bindgen_ty_2 = 208; +pub const JS_ATOM_ReferenceError: _bindgen_ty_2 = 209; +pub const JS_ATOM_SyntaxError: _bindgen_ty_2 = 210; +pub const JS_ATOM_TypeError: _bindgen_ty_2 = 211; +pub const JS_ATOM_URIError: _bindgen_ty_2 = 212; +pub const JS_ATOM_InternalError: _bindgen_ty_2 = 213; +pub const JS_ATOM_DOMException: _bindgen_ty_2 = 214; +pub const JS_ATOM_CallSite: _bindgen_ty_2 = 215; +pub const JS_ATOM_Private_brand: _bindgen_ty_2 = 216; +pub const JS_ATOM_Symbol_toPrimitive: _bindgen_ty_2 = 217; +pub const JS_ATOM_Symbol_iterator: _bindgen_ty_2 = 218; +pub const JS_ATOM_Symbol_match: _bindgen_ty_2 = 219; +pub const JS_ATOM_Symbol_matchAll: _bindgen_ty_2 = 220; +pub const JS_ATOM_Symbol_replace: _bindgen_ty_2 = 221; +pub const JS_ATOM_Symbol_search: _bindgen_ty_2 = 222; +pub const JS_ATOM_Symbol_split: _bindgen_ty_2 = 223; +pub const JS_ATOM_Symbol_toStringTag: _bindgen_ty_2 = 224; +pub const JS_ATOM_Symbol_isConcatSpreadable: _bindgen_ty_2 = 225; +pub const JS_ATOM_Symbol_hasInstance: _bindgen_ty_2 = 226; +pub const JS_ATOM_Symbol_species: _bindgen_ty_2 = 227; +pub const JS_ATOM_Symbol_unscopables: _bindgen_ty_2 = 228; +pub const JS_ATOM_Symbol_asyncIterator: _bindgen_ty_2 = 229; +pub const JS_ATOM_END: _bindgen_ty_2 = 230; +pub type _bindgen_ty_2 = ::core::ffi::c_uint; From 9d8fd6bfd2e2b8632675ca36af0daf856edf7b79 Mon Sep 17 00:00:00 2001 From: richarddd Date: Fri, 15 May 2026 22:28:53 +0200 Subject: [PATCH 3/6] Use apt cross-gcc instead of zigbuild for powerpc64 to work around missing zig glibc stubs --- .github/workflows/bindings.yml | 29 ++++++++++++++++++++++++++++- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 0ff1da8df..654b372a7 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -35,7 +35,7 @@ jobs: - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, rust: stable, builder: zigbuild } - { os: ubuntu-latest, target: aarch64-unknown-linux-musl, rust: stable, builder: zigbuild } - { os: ubuntu-latest, target: armv7-unknown-linux-gnueabihf, rust: stable, builder: zigbuild } - - { os: ubuntu-latest, target: powerpc64-unknown-linux-gnu, rust: stable, builder: zigbuild } + - { os: ubuntu-latest, target: powerpc64-unknown-linux-gnu, rust: stable, builder: cross-gcc } - { os: ubuntu-24.04, target: loongarch64-unknown-linux-gnu, rust: nightly, builder: zigbuild } - { os: ubuntu-24.04, target: loongarch64-unknown-linux-musl, rust: nightly, builder: zigbuild } # Native builds. @@ -71,6 +71,33 @@ jobs: with: tool: cargo-zigbuild + - name: Set up cross-gcc toolchain + if: matrix.builder == 'cross-gcc' + shell: bash + run: | + case "${{ matrix.target }}" in + powerpc64-unknown-linux-gnu) + GCC_TARGET=powerpc64-linux-gnu + GCC_PKGS=(gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc6-dev-ppc64-cross) + ;; + *) + echo "unsupported cross-gcc target: ${{ matrix.target }}" >&2 + exit 1 + ;; + esac + + sudo apt-get update -y + sudo apt-get install -y "${GCC_PKGS[@]}" + + ENV_UPPER=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') + ENV_LOWER=$(printf "${{ matrix.target }}" | tr '-' '_') + { + echo "CC_${ENV_LOWER}=${GCC_TARGET}-gcc" + echo "CXX_${ENV_LOWER}=${GCC_TARGET}-g++" + echo "AR_${ENV_LOWER}=${GCC_TARGET}-ar" + echo "CARGO_TARGET_${ENV_UPPER}_LINKER=${GCC_TARGET}-gcc" + } >> "$GITHUB_ENV" + - name: Set up msys2 if: matrix.builder == 'msys2' uses: msys2/setup-msys2@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a64193013..5dd01daa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,7 @@ jobs: - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: armv7-unknown-linux-gnueabihf, features: full-async, builder: zigbuild, qemu: arm } - - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: ppc64 } + - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: cross-gcc, qemu: ppc64 } - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: loongarch64 } - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: loongarch64 } @@ -210,6 +210,36 @@ jobs: with: tool: cargo-zigbuild + - name: Set up cross-gcc toolchain + if: matrix.builder == 'cross-gcc' + shell: bash + run: | + # zig 0.14 ships an incomplete glibc sysroot for some targets + # (e.g. powerpc64 lacks `gnu/stubs-64-v2.h`), so for those targets + # we fall back to the apt cross-gcc toolchain. + case "${{ matrix.target }}" in + powerpc64-unknown-linux-gnu) + GCC_TARGET=powerpc64-linux-gnu + GCC_PKGS=(gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc6-dev-ppc64-cross) + ;; + *) + echo "unsupported cross-gcc target: ${{ matrix.target }}" >&2 + exit 1 + ;; + esac + + sudo apt-get update -y + sudo apt-get install -y "${GCC_PKGS[@]}" + + ENV_UPPER=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') + ENV_LOWER=$(printf "${{ matrix.target }}" | tr '-' '_') + { + echo "CC_${ENV_LOWER}=${GCC_TARGET}-gcc" + echo "CXX_${ENV_LOWER}=${GCC_TARGET}-g++" + echo "AR_${ENV_LOWER}=${GCC_TARGET}-ar" + echo "CARGO_TARGET_${ENV_UPPER}_LINKER=${GCC_TARGET}-gcc" + } >> "$GITHUB_ENV" + - name: Install QEMU user emulation if: matrix.qemu shell: bash From ff645a5d5f4f99680576474a349fae64c64f94b5 Mon Sep 17 00:00:00 2001 From: richarddd Date: Fri, 15 May 2026 22:33:24 +0200 Subject: [PATCH 4/6] Bump zig to 0.16.0 and drop the powerpc64 cross-gcc fallback now that zig ships the missing glibc stubs --- .github/workflows/bindings.yml | 31 ++----------------------------- .github/workflows/ci.yml | 34 ++-------------------------------- 2 files changed, 4 insertions(+), 61 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 654b372a7..549bac010 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -35,7 +35,7 @@ jobs: - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, rust: stable, builder: zigbuild } - { os: ubuntu-latest, target: aarch64-unknown-linux-musl, rust: stable, builder: zigbuild } - { os: ubuntu-latest, target: armv7-unknown-linux-gnueabihf, rust: stable, builder: zigbuild } - - { os: ubuntu-latest, target: powerpc64-unknown-linux-gnu, rust: stable, builder: cross-gcc } + - { os: ubuntu-latest, target: powerpc64-unknown-linux-gnu, rust: stable, builder: zigbuild } - { os: ubuntu-24.04, target: loongarch64-unknown-linux-gnu, rust: nightly, builder: zigbuild } - { os: ubuntu-24.04, target: loongarch64-unknown-linux-musl, rust: nightly, builder: zigbuild } # Native builds. @@ -63,7 +63,7 @@ jobs: if: matrix.builder == 'zigbuild' uses: mlugg/setup-zig@v2 with: - version: 0.14.1 + version: 0.16.0 - name: Install cargo-zigbuild if: matrix.builder == 'zigbuild' @@ -71,33 +71,6 @@ jobs: with: tool: cargo-zigbuild - - name: Set up cross-gcc toolchain - if: matrix.builder == 'cross-gcc' - shell: bash - run: | - case "${{ matrix.target }}" in - powerpc64-unknown-linux-gnu) - GCC_TARGET=powerpc64-linux-gnu - GCC_PKGS=(gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc6-dev-ppc64-cross) - ;; - *) - echo "unsupported cross-gcc target: ${{ matrix.target }}" >&2 - exit 1 - ;; - esac - - sudo apt-get update -y - sudo apt-get install -y "${GCC_PKGS[@]}" - - ENV_UPPER=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') - ENV_LOWER=$(printf "${{ matrix.target }}" | tr '-' '_') - { - echo "CC_${ENV_LOWER}=${GCC_TARGET}-gcc" - echo "CXX_${ENV_LOWER}=${GCC_TARGET}-g++" - echo "AR_${ENV_LOWER}=${GCC_TARGET}-ar" - echo "CARGO_TARGET_${ENV_UPPER}_LINKER=${GCC_TARGET}-gcc" - } >> "$GITHUB_ENV" - - name: Set up msys2 if: matrix.builder == 'msys2' uses: msys2/setup-msys2@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dd01daa6..b9cab0efd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,7 @@ jobs: - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: armv7-unknown-linux-gnueabihf, features: full-async, builder: zigbuild, qemu: arm } - - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: cross-gcc, qemu: ppc64 } + - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: ppc64 } - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: loongarch64 } - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: loongarch64 } @@ -202,7 +202,7 @@ jobs: if: matrix.builder == 'zigbuild' uses: mlugg/setup-zig@v2 with: - version: 0.14.1 + version: 0.16.0 - name: Install cargo-zigbuild if: matrix.builder == 'zigbuild' @@ -210,36 +210,6 @@ jobs: with: tool: cargo-zigbuild - - name: Set up cross-gcc toolchain - if: matrix.builder == 'cross-gcc' - shell: bash - run: | - # zig 0.14 ships an incomplete glibc sysroot for some targets - # (e.g. powerpc64 lacks `gnu/stubs-64-v2.h`), so for those targets - # we fall back to the apt cross-gcc toolchain. - case "${{ matrix.target }}" in - powerpc64-unknown-linux-gnu) - GCC_TARGET=powerpc64-linux-gnu - GCC_PKGS=(gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc6-dev-ppc64-cross) - ;; - *) - echo "unsupported cross-gcc target: ${{ matrix.target }}" >&2 - exit 1 - ;; - esac - - sudo apt-get update -y - sudo apt-get install -y "${GCC_PKGS[@]}" - - ENV_UPPER=$(printf "${{ matrix.target }}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') - ENV_LOWER=$(printf "${{ matrix.target }}" | tr '-' '_') - { - echo "CC_${ENV_LOWER}=${GCC_TARGET}-gcc" - echo "CXX_${ENV_LOWER}=${GCC_TARGET}-g++" - echo "AR_${ENV_LOWER}=${GCC_TARGET}-ar" - echo "CARGO_TARGET_${ENV_UPPER}_LINKER=${GCC_TARGET}-gcc" - } >> "$GITHUB_ENV" - - name: Install QEMU user emulation if: matrix.qemu shell: bash From 40b6cab21772f6518572ae5d7ca6710ab6116523 Mon Sep 17 00:00:00 2001 From: richarddd Date: Sat, 16 May 2026 19:47:12 +0200 Subject: [PATCH 5/6] Skip powerpc64 from the CI test matrix because zig's lld does not support PPC64 ELFv1 executables --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9cab0efd..b683148d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,12 @@ jobs: - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: aarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: aarch64 } - { task: test, os: ubuntu-latest, rust: stable, target: armv7-unknown-linux-gnueabihf, features: full-async, builder: zigbuild, qemu: arm } - - { task: test, os: ubuntu-latest, rust: stable, target: powerpc64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: ppc64 } + # NOTE: powerpc64-unknown-linux-gnu is not tested in CI because zig's + # bundled lld does not support PPC64 ELFv1 (the ABI Rust's + # precompiled std for that target uses), so linking the test + # executables fails. Bindings are still regenerated for it via + # `.github/workflows/bindings.yml` (sys builds as a static rlib, + # which does not trigger lld). - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-gnu, features: full-async, builder: zigbuild, qemu: loongarch64 } - { task: test, os: ubuntu-24.04, rust: nightly, target: loongarch64-unknown-linux-musl, features: full-async, builder: zigbuild, qemu: loongarch64 } @@ -228,10 +233,6 @@ jobs: LIBC_PKG=libc6-armhf-cross PREFIX=/usr/arm-linux-gnueabihf ;; - powerpc64-unknown-linux-gnu) - LIBC_PKG=libc6-ppc64-cross - PREFIX=/usr/powerpc64-linux-gnu - ;; loongarch64-unknown-linux-gnu) LIBC_PKG=libc6-dev-loong64-cross PREFIX=/usr/loongarch64-linux-gnu From 795ef0cb47466db8006ad74f6b472a42b3afebde Mon Sep 17 00:00:00 2001 From: richarddd Date: Mon, 18 May 2026 09:39:58 +0200 Subject: [PATCH 6/6] ci: pin third-party actions to commit SHA at latest version Addresses review feedback on PR #689: third-party actions are now pinned to the upstream tag's commit SHA rather than mutable major-version tags, preventing surprise upgrades or supply-chain attacks via tag rewrites. Pinned (latest stable as of 2026-05): - mlugg/setup-zig v2.2.1 d1434d0 - taiki-e/install-action v2.79.0 7be9fd8 - msys2/setup-msys2 v2.31.1 e989830 Applied in both bindings.yml and ci.yml where this PR added or moves the action invocations. --- .github/workflows/bindings.yml | 6 +++--- .github/workflows/ci.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 549bac010..161c7de3c 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -61,19 +61,19 @@ jobs: - name: Set up zig if: matrix.builder == 'zigbuild' - uses: mlugg/setup-zig@v2 + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 with: version: 0.16.0 - name: Install cargo-zigbuild if: matrix.builder == 'zigbuild' - uses: taiki-e/install-action@v2 + uses: taiki-e/install-action@7be9fd86bd1707236395105d6e9329dd1511a7e1 # v2.79.0 with: tool: cargo-zigbuild - name: Set up msys2 if: matrix.builder == 'msys2' - uses: msys2/setup-msys2@v2 + uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c # v2.31.1 with: release: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b683148d3..b7809d48c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,13 +205,13 @@ jobs: - name: Set up zig if: matrix.builder == 'zigbuild' - uses: mlugg/setup-zig@v2 + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 with: version: 0.16.0 - name: Install cargo-zigbuild if: matrix.builder == 'zigbuild' - uses: taiki-e/install-action@v2 + uses: taiki-e/install-action@7be9fd86bd1707236395105d6e9329dd1511a7e1 # v2.79.0 with: tool: cargo-zigbuild