Roll to convex-149.2.9: enable external code space for multi-cage builds #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["**"] | |
| pull_request: | |
| branches: [main] | |
| types: [labeled, opened, synchronize, reopened] | |
| permissions: write-all | |
| jobs: | |
| build: | |
| name: ${{ matrix.config.variant }} ${{ matrix.config.target }} ${{ matrix.config.v8_enable_pointer_compression && 'ptrcomp' || '' }} ${{ matrix.config.simdutf && 'simdutf' || '' }} | |
| runs-on: ${{ matrix.config.os }} | |
| timeout-minutes: 180 | |
| strategy: | |
| # Always run main branch builds to completion. This allows the cache to | |
| # stay mostly up-to-date in situations where a single job fails due to | |
| # e.g. a flaky test. | |
| # Don't fast-fail on tag build because publishing binaries shouldn't be | |
| # prevented if 'cargo publish' fails (which can be a false negative). | |
| fail-fast: | |
| ${{ (github.event_name == 'pull_request' || (github.ref != | |
| 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/'))) && | |
| !contains(github.event.pull_request.labels.*.name, 'no-fail-fast') }} | |
| matrix: | |
| # Trimmed to exactly what convex consumes: release only, simdutf always | |
| # (deno_core enables v8/simdutf unconditionally), and pointer compression | |
| # only on the aarch64 targets that run it (linux = prod Graviton, macOS = | |
| # dev). arm64-linux is cross-compiled from x64 under QEMU, as before. | |
| config: | |
| - os: large-runner | |
| target: x86_64-unknown-linux-gnu | |
| variant: release | |
| v8_enable_pointer_compression: false | |
| simdutf: true | |
| cargo: cargo | |
| - os: large-runner | |
| target: aarch64-unknown-linux-gnu | |
| variant: release | |
| v8_enable_pointer_compression: true | |
| simdutf: true | |
| cargo: cargo | |
| - os: macos-15-large | |
| target: x86_64-apple-darwin | |
| variant: release | |
| v8_enable_pointer_compression: false | |
| simdutf: true | |
| cargo: cargo | |
| - os: macos-15 | |
| target: aarch64-apple-darwin | |
| variant: release | |
| v8_enable_pointer_compression: true | |
| simdutf: true | |
| cargo: cargo | |
| - os: windows-large-runner | |
| target: x86_64-pc-windows-msvc | |
| variant: release # Note: we do not support windows debug builds. | |
| v8_enable_pointer_compression: false | |
| simdutf: true | |
| cargo: cargo | |
| env: | |
| V8_FROM_SOURCE: true | |
| CARGO_VARIANT_FLAG: ${{ matrix.config.variant == 'release' && '--release' || '' }} | |
| CARGO_FEATURE_FLAGS: ${{ format('{0} {1}', matrix.config.v8_enable_pointer_compression && '--features v8_enable_pointer_compression' || '', matrix.config.simdutf && '--features simdutf' || '') }} | |
| LIB_NAME: ${{ contains(matrix.config.target, 'windows') && 'rusty_v8' || 'librusty_v8' }} | |
| LIB_EXT: ${{ contains(matrix.config.target, 'windows') && 'lib' || 'a' }} | |
| FEATURES_SUFFIX: ${{ format('{0}{1}', matrix.config.v8_enable_pointer_compression && '_ptrcomp' || '', matrix.config.simdutf && '_simdutf' || '') }} | |
| RUSTFLAGS: -D warnings | |
| steps: | |
| - name: Configure git | |
| run: git config --global core.symlinks true | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 10 | |
| submodules: recursive | |
| - name: Install rust | |
| uses: dsherret/rust-toolchain-file@v1 | |
| - name: Install cargo-binstall | |
| uses: cargo-bins/cargo-binstall@main | |
| - name: Install nextest | |
| run: cargo binstall cargo-nextest --secure --locked --no-confirm | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11.x | |
| architecture: x64 | |
| - name: Install cross compilation toolchain | |
| if: matrix.config.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| rustup target add aarch64-unknown-linux-gnu | |
| sudo apt update | |
| sudo apt install -yq --no-install-suggests --no-install-recommends \ | |
| binfmt-support g++-10-aarch64-linux-gnu g++-10-multilib \ | |
| gcc-10-aarch64-linux-gnu libc6-arm64-cross qemu qemu-user \ | |
| qemu-user-binfmt | |
| sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 \ | |
| /lib/ld-linux-aarch64.so.1 | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc-10" >> ${GITHUB_ENV} | |
| echo "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu" >> ${GITHUB_ENV} | |
| - name: Write git_submodule_status.txt | |
| run: git submodule status --recursive > git_submodule_status.txt | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| # Note: rusty_v8 targets always get get rebuilt, and their outputs | |
| # ('librusty_v8.rlib', the whole 'gn_out' directory, etc.) can be | |
| # quite big, so we cache only those subdirectories of | |
| # target/{debug|release} that contain the build output for crates that | |
| # come from the registry. By additionally saving the sccache cache | |
| # directory it's still possible to build v8 fast. | |
| path: |- | |
| target/sccache | |
| target/*/.* | |
| target/*/build | |
| target/*/deps | |
| key: cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }}-${{ matrix.config.simdutf }}-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }} | |
| restore-keys: cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }}- | |
| - name: Install and start sccache | |
| shell: pwsh | |
| env: | |
| SCCACHE_DIR: ${{ github.workspace }}/target/sccache | |
| SCCACHE_CACHE_SIZE: 256M | |
| SCCACHE_IDLE_TIMEOUT: 0 | |
| run: | | |
| $version = "v0.8.2" | |
| $platform = | |
| @{ "x86_64-apple-darwin" = "x86_64-apple-darwin" | |
| "aarch64-apple-darwin" = "aarch64-apple-darwin" | |
| "x86_64-unknown-linux-gnu" = "x86_64-unknown-linux-musl" | |
| "aarch64-unknown-linux-gnu" = "aarch64-unknown-linux-musl" | |
| "x86_64-pc-windows-msvc" = "x86_64-pc-windows-msvc" | |
| }['${{ matrix.config.target }}'] | |
| $basename = "sccache-$version-$platform" | |
| $url = "https://github.com/mozilla/sccache/releases/download/$version/$basename.tar.gz" | |
| cd ~ | |
| curl -LO $url | |
| tar -xzvf "$basename.tar.gz" | |
| . $basename/sccache --start-server | |
| echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| # Keyed on target, not the runner-label string: the org runner labels | |
| # (large-runner, windows-large-runner) don't contain 'ubuntu'/'macos'. | |
| # pkg-config + build-essential are preinstalled on GitHub-hosted images but | |
| # not on the org large-runner image; V8's gn gen (pkg_config.gni) needs them. | |
| - name: Install Clang + host build deps | |
| if: contains(matrix.config.target, 'linux') | |
| run: | | |
| echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-19.list | |
| curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg | |
| sudo apt-get update | |
| sudo apt-get -qq remove 'clang-*' | |
| sudo apt-get install lld-19 clang-19 clang-tools-19 clang-tidy-19 clang-format-19 libclang-19-dev pkg-config build-essential -y | |
| echo "LIBCLANG_PATH=/usr/lib/llvm-19/lib" >> $GITHUB_ENV | |
| - name: Set LIBCLANG_PATH (macOS) | |
| if: contains(matrix.config.target, 'darwin') | |
| run: | | |
| XCODE_CLANG_LIB="$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib" | |
| echo "LIBCLANG_PATH=$XCODE_CLANG_LIB" >> $GITHUB_ENV | |
| - name: check rust code formatting | |
| run: cargo fmt --check | |
| - name: check c++ code formatting | |
| if: contains(matrix.config.target, 'linux') | |
| run: | | |
| clang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.h | |
| # aarch64-linux is cross-compiled and can't be executed under qemu-user with | |
| # pointer compression on — V8's cage reservation segfaults the emulator | |
| # (every Isolate-creating test SIGSEGVs; pure-Rust tests pass). The arm64 | |
| # ptrcomp build is exercised natively by the aarch64-apple-darwin job. | |
| - name: Test | |
| env: | |
| SCCACHE_IDLE_TIMEOUT: 0 | |
| if: matrix.config.target != 'aarch64-unknown-linux-gnu' | |
| run: ${{ matrix.config.cargo }} nextest run -v --cargo-verbose --cargo-verbose --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }} | |
| - name: Clippy | |
| run: ${{ matrix.config.cargo }} clippy --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }} -- -D clippy::all | |
| - name: Prepare binary publish | |
| if: matrix.config.variant == 'debug' || matrix.config.variant == 'release' | |
| run: | | |
| gzip -9c target/${{ matrix.config.target }}/${{ matrix.config.variant }}/gn_out/obj/${{ env.LIB_NAME }}.${{ env.LIB_EXT }} > target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz | |
| ls -l target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz | |
| cp target/${{ matrix.config.target }}/${{ matrix.config.variant}}/gn_out/src_binding.rs target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs | |
| ls -l target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs | |
| - name: Binary publish | |
| uses: softprops/action-gh-release@v0.1.15 | |
| if: >- | |
| github.repository == 'get-convex/rusty_v8' && | |
| startsWith(github.ref, 'refs/tags/') && | |
| (matrix.config.variant == 'debug' || matrix.config.variant == 'release') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz | |
| target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs | |
| - name: Upload CI artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs | |
| path: target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs | |
| # get-convex: also persist the static lib as a downloadable artifact so the | |
| # release can be assembled even if the gated 'Binary publish' step is a no-op. | |
| - name: Upload prebuilt lib artifact | |
| if: matrix.config.variant == 'debug' || matrix.config.variant == 'release' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lib_${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }} | |
| path: target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz |