fix: Remove V8_DEPRECATION_WARNINGS define to fix build with GCC <= 12 - #42
Merged
Conversation
Lms24
approved these changes
Jul 28, 2026
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building this module against the Electron ≥ 43 headers fails on Linux with stock GCC on Ubuntu 22.04 / Debian 12 (see the failing
E2E Tests (ubuntu-22.04, 43.2.0, *)jobs in getsentry/sentry-electron#1398):Electron 43 ships V8 15.0, where
v8::String::Valuenow carries a class-level deprecation (v8-primitive.h:655):node-gyp's
addon.gypicompiles all addons with-DV8_DEPRECATION_WARNINGS=1, so this expands toclass [[deprecated("…")]] __attribute__((visibility("default"))) Value— a C++11 attribute mixed with a GNU attribute in a class head, which GCC ≤ 12 cannot parse (in either attribute order). GCC 13+ and clang parse it fine. The same declaration is still on V8main, so this will also hit Node.js once it ships V8 15.This PR strips the
V8_DEPRECATION_WARNINGS=1define via adefines!exclusion so theV8_DEPRECATEDmacros expand to nothing, restoring builds on GCC ≤ 12. The trade-off is that builds of this module no longer emit V8 API deprecation warnings.Verified in Docker (
node:20-bookworm, GCC 12.2) withnode-gyp rebuild --target=43.2.0 --dist-url=https://electronjs.org/headers: reproduces the exact error before this change, builds cleanly after.