From a280132cb90d428e7831c4a324a04e734105ae50 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 11 Jun 2026 20:03:48 +0000 Subject: [PATCH] fix(build): ignore NODE_OPTIONS in the SEA binary to keep the V8 code cache valid The standalone `sentry` binary is a Node SEA with an embedded V8 code cache. When a user has V8 flags in NODE_OPTIONS (e.g. `NODE_OPTIONS=--max-old-space-size=8192`), those flags change V8's FlagList::Hash() at runtime, so V8 rejects the build-time code cache and emits `Warning: Code cache data rejected` (and recompiles). Bump fossilize to ^0.10.1 and pass `--ignore-node-options`, which patches the binary to ignore NODE_OPTIONS (equivalent to `--without-node-options`). The flag-hash then matches the build-time default and the cache is accepted. process.env is untouched, so child processes still inherit NODE_OPTIONS. (0.10.1 also fixes the NODE_OPTIONS-constant selector for win-x64 / node 24.) --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- script/build.ts | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9d9e378fc..48aecebd5 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "consola": "^3.4.2", "esbuild": "^0.25.0", "fast-check": "^4.5.3", - "fossilize": "^0.8.1", + "fossilize": "^0.10.1", "hono": "^4.12.15", "http-cache-semantics": "^4.2.0", "ignore": "^7.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc1aa7599..aa5be7548 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,8 +92,8 @@ importers: specifier: ^4.5.3 version: 4.8.0 fossilize: - specifier: ^0.8.1 - version: 0.8.1 + specifier: ^0.10.1 + version: 0.10.1 hono: specifier: ^4.12.15 version: 4.12.23 @@ -1801,8 +1801,8 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} - fossilize@0.8.1: - resolution: {integrity: sha512-cyjES48pTg6gx9qcdAx7JJ/0PFvLKBeFEZVDMAOf7b6RSDUckla64N+si3Ljxw0nnXOtrE3rCCr0mLevdP+CsQ==} + fossilize@0.10.1: + resolution: {integrity: sha512-+7rb/72OJmlgwDGnqmtzwcZ3A4sOut/BTu4kzUo2jzsa8k0F401TXFkHSg1y2U/M442BqaYtARgWv508gjdw+g==} engines: {node: '>=18'} hasBin: true @@ -4681,7 +4681,7 @@ snapshots: forwarded@0.2.0: {} - fossilize@0.8.1: + fossilize@0.10.1: dependencies: '@stricli/auto-complete': 1.2.7 '@stricli/core': 1.2.7(patch_hash=402d573df36b19c62010d4ff41e49826f69d5c47212b8052ee7b042df34f973f) diff --git a/script/build.ts b/script/build.ts index 0ecc78e5b..26043cd1f 100644 --- a/script/build.ts +++ b/script/build.ts @@ -321,6 +321,12 @@ async function compileAllTargets( fossilizeBin, "--no-bundle", "--hole-punch", + // Make the binary ignore NODE_OPTIONS so user V8 flags (e.g. + // `NODE_OPTIONS=--max-old-space-size=8192`) don't change V8's + // flag-hash and reject the embedded code cache ("Code cache data + // rejected"). process.env is untouched, so child processes still + // inherit the user's NODE_OPTIONS. + "--ignore-node-options", "--output-name", "sentry", "--platforms",