Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pointer-compression-enabled build for x86_64 linux #1687

Merged
merged 14 commits into from
Feb 6, 2025
39 changes: 36 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,56 +30,79 @@ jobs:
- os: macos-13
target: x86_64-apple-darwin
variant: debug
pointer_compression: "false"
cargo: cargo

- os: macos-13
target: x86_64-apple-darwin
variant: release
pointer_compression: "false"
cargo: cargo

- os: macos-14
target: aarch64-apple-darwin
variant: asan
pointer_compression: "false"
cargo: cargo

- os: macos-14
target: aarch64-apple-darwin
variant: debug
pointer_compression: "false"
cargo: cargo

- os: macos-14
target: aarch64-apple-darwin
variant: release
pointer_compression: "false"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: x86_64-unknown-linux-gnu
variant: debug
pointer_compression: "false"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: x86_64-unknown-linux-gnu
variant: release
pointer_compression: "false"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: x86_64-unknown-linux-gnu
variant: debug
pointer_compression: "true"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: x86_64-unknown-linux-gnu
variant: release
pointer_compression: "true"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'windows-2022-xxl' || 'windows-2022' }}
target: x86_64-pc-windows-msvc
variant: release # Note: we do not support windows debug builds.
pointer_compression: "false"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: aarch64-unknown-linux-gnu
variant: debug
pointer_compression: "false"
cargo: cargo

- os: ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
target: aarch64-unknown-linux-gnu
variant: release
pointer_compression: "false"
cargo: cargo

env:
V8_FROM_SOURCE: true
CARGO_VARIANT_FLAG: ${{ matrix.config.variant == 'release' && '--release' || '' }}
POINTER_COMPRESSION: ${{ matrix.config.pointer_compression }}
LIB_NAME: ${{ contains(matrix.config.target, 'windows') && 'rusty_v8' || 'librusty_v8' }}
LIB_EXT: ${{ contains(matrix.config.target, 'windows') && 'lib' || 'a' }}
RUSTFLAGS: -D warnings
Expand Down Expand Up @@ -197,11 +220,21 @@ jobs:
tar -C tools/clang/dsymutil/ -xvzf dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
V8_FROM_SOURCE=true RUSTFLAGS="-C opt-level=1 -Zsanitizer=address" cargo +nightly -Z build-std test --lib --bins --tests -vv --target ${{ matrix.config.target }}

- name: Test
- name: Test -- No Pointer Compression
env:
SCCACHE_IDLE_TIMEOUT: 0
if: matrix.config.variant == 'debug' || matrix.config.variant == 'release'|| matrix.config.pointer_compression == 'false'
run:
${{ matrix.config.cargo }} test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }}

- name: Test -- With Pointer Compression
env:
SCCACHE_IDLE_TIMEOUT: 0
if: matrix.config.variant == 'debug' || matrix.config.variant == 'release'
if: matrix.config.variant == 'debug' || matrix.config.variant == 'release' || matrix.config.pointer_compression == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should make it a feature flag, and update build.rs to pass that flag to gn.
See https://github.com/denoland/rusty_v8/blob/main/build.rs#L196-L198

run:
// Enable pointer_compression
sed -i 's/v8_enable_pointer_compression = false/v8_enable_pointer_compression = true/s' .gn
${{ matrix.config.cargo }} test -vv --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }}
--target ${{ matrix.config.target }}

Expand Down Expand Up @@ -229,7 +262,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}_${{ matrix.config.pointer_compression }}.${{ env.LIB_EXT }}.gz
target/src_binding_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs

- name: Upload CI artifacts
Expand Down
Loading