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

fix: bump node-gyp dependency to v9.4.0 #189308

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions build/azure-pipelines/win32/product-build-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ steps:
$ErrorActionPreference = "Stop"
# TODO: Should be replaced with upstream URL once https://github.com/nodejs/node-gyp/pull/2825
# gets merged.
exec { git clone https://github.com/rzhao271/node-gyp.git . } "Cloning rzhao271/node-gyp failed"
exec { git checkout 102b347da0c92c29f9c67df22e864e70249cf086 } "Checking out 102b347 failed"
exec { npm install } "Building rzhao271/node-gyp failed"
exec { git config --global user.email "vscode@microsoft.com" } "git config user.email failed"
exec { git config --global user.name "VSCode" } "git config user.name failed"
exec { git clone https://github.com/nodejs/node-gyp.git . } "Cloning nodejs/node-gyp failed"
exec { git checkout v9.4.0 } "Checking out v9.4.0 failed"
exec { git am --3way --whitespace=fix ../../build/npm/gyp/patches/gyp_spectre_mitigation_support.patch } "Apply spectre patch failed"
exec { npm install } "Building node-gyp failed"
displayName: Install custom node-gyp
workingDirectory: .build/node-gyp
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
Expand Down
1 change: 1 addition & 0 deletions build/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module.exports.indentationFilter = [
'!test/unit/assert.js',
'!resources/linux/snap/electron-launch',
'!build/ext.js',
'!build/npm/gyp/patches/gyp_spectre_mitigation_support.patch',

// except specific folders
'!test/automation/out/**',
Expand Down
2 changes: 1 addition & 1 deletion build/npm/gyp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "MIT",
"devDependencies": {
"node-gyp": "^8.4.1"
"node-gyp": "^9.4.0"
},
"scripts": {}
}
51 changes: 51 additions & 0 deletions build/npm/gyp/patches/gyp_spectre_mitigation_support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 853e4643b6737224a5aa0720a4108461a0230991 Mon Sep 17 00:00:00 2001
From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Date: Thu, 30 Mar 2023 05:23:36 -0700
Subject: [PATCH] feat(msvs): add SpectreMitigation attribute (#190)

Backports https://github.com/nodejs/gyp-next/commit/853e4643b6737224a5aa0720a4108461a0230991

diff --git a/gyp/pylib/gyp/easy_xml_test.py b/gyp/pylib/gyp/easy_xml_test.py
index 342f693..c5808b8 100755
--- a/gyp/pylib/gyp/easy_xml_test.py
+++ b/gyp/pylib/gyp/easy_xml_test.py
@@ -76,6 +76,7 @@ def test_EasyXml_complex(self):
'\'Debug|Win32\'" Label="Configuration">'
"<ConfigurationType>Application</ConfigurationType>"
"<CharacterSet>Unicode</CharacterSet>"
+ "<SpectreMitigation>SpectreLoadCF</SpectreMitigation>"
"</PropertyGroup>"
"</Project>"
)
@@ -99,6 +100,7 @@ def test_EasyXml_complex(self):
},
["ConfigurationType", "Application"],
["CharacterSet", "Unicode"],
+ ["SpectreMitigation", "SpectreLoadCF"]
],
]
)
diff --git a/gyp/pylib/gyp/generator/msvs.py b/gyp/pylib/gyp/generator/msvs.py
index 72269bd..85c354f 100644
--- a/gyp/pylib/gyp/generator/msvs.py
+++ b/gyp/pylib/gyp/generator/msvs.py
@@ -3006,6 +3006,10 @@ def _GetMSBuildConfigurationDetails(spec, build_file):
character_set = msbuild_attributes.get("CharacterSet")
config_type = msbuild_attributes.get("ConfigurationType")
_AddConditionalProperty(properties, condition, "ConfigurationType", config_type)
+ spectre_mitigation = msbuild_attributes.get('SpectreMitigation')
+ if spectre_mitigation:
+ _AddConditionalProperty(properties, condition, "SpectreMitigation",
+ spectre_mitigation)
if config_type == "Driver":
_AddConditionalProperty(properties, condition, "DriverType", "WDM")
_AddConditionalProperty(
@@ -3094,6 +3098,8 @@ def _ConvertMSVSBuildAttributes(spec, config, build_file):
msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a])
elif a == "ConfigurationType":
msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a])
+ elif a == "SpectreMitigation":
+ msbuild_attributes[a] = msvs_attributes[a]
else:
print("Warning: Do not know how to convert MSVS attribute " + a)
return msbuild_attributes