#55042: build: stop overriding node GN declare_args defaults in patch
Merged
Description of Change
We shouldn't be patching default values for args inside declare_args() blocks since we can just override them.
The one exception at the moment is node_path, which due to a quirk of GN can't be overridden or the default value for node_module_version will fail. The GN docs say an argument shouldn't rely on another argument inside the same declare_args() block for this reason, so I'll upstream a fix to Node.js putting them in separate blocks so we can cleanly override node_path.
- Because you cannot read the value of a variable defined in the same
block, if you need to make the default value of one arg depend
on the possibly-overridden value of another, write two separate
declare_args() blocks:
declare_args() {
enable_foo = true
}
declare_args() {
# Bar defaults to same user-overridden state as foo.
enable_bar = enable_foo
}
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses
Release Notes
Notes: none
Backports
43-x-y
PendingWaiting for a manual backport
44-x-y
PendingWaiting for a manual backport
45-x-y
PendingWaiting for a manual backport
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron