Skip to content

build: fix pointer compression builds #58171

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joyeecheung
Copy link
Member

build: fix pointer compression builds

  • Remove usage of deprecated V8::InitializeSandbox().
  • External code space and pointer compression shared cage must
    be enabled when pointer compression builds are enabled.
  • We cannot enable the sandbox because that requires allocating
    the array buffer backing stores in the sandbox - we currently
    have many backing stores tied to pointers from C++ land that
    are not even necessarily dynamic (e.g. in static storage).
    Until we manage to get rid of all those, sandbox cannot be
    enabled. Note that enabling pointer compression without
    enabling sandbox is unsupported by V8, and can be broken
    at any time.

test: skip wasm-allocation tests for pointer compression builds

V8 isolate group initialization forces allocation of the virtual
memory cage with pointer compression builds and simply would not
work when there is a smaller hard limit on the virtual memory.

- Remove usage of deprecated V8::InitializeSandbox().
- External code space and pointer compression shared cage must
  be enabled when pointer compression builds are enabled.
- We cannot enable the sandbox because that requires allocating
  the array buffer backing stores in the sandbox - we currently
  have many backing stores tied to pointers from C++ land that
  are not even necessarily dynamic (e.g. in static storage).
  Until we manage to get rid of all those, sandbox cannot be
  enabled. Note that enabling pointer compression without
  enabling sandbox is unsupported by V8, and can be broken
  at any time.
V8 isolate group initialization forces allocation of the virtual
memory cage with pointer compression builds and simply would not
work when there is a smaller hard limit on the virtual memory.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels May 4, 2025
@joyeecheung
Copy link
Member Author

Trying to start a pointer compression build: https://ci.nodejs.org/job/node-test-commit-linux-pointer-compression/784/

@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.14%. Comparing base (5fb879c) to head (a3fab01).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #58171    +/-   ##
========================================
  Coverage   90.13%   90.14%            
========================================
  Files         630      630            
  Lines      186611   186754   +143     
  Branches    36631    36652    +21     
========================================
+ Hits       168204   168351   +147     
- Misses      11192    11193     +1     
+ Partials     7215     7210     -5     

see 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member Author

CI is happy. Can I get some reviews please? @nodejs/build @nodejs/v8-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants