-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
msi: enable CFG in node.exe #42126
base: main
Are you sure you want to change the base?
msi: enable CFG in node.exe #42126
Conversation
Windows CI (including tests on arm64): https://ci.nodejs.org/job/node-test-commit-windows-fanned/47188/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a compilation error:
MSBUILD : error MSB1001: Unknown switch.
Switch: /guard:cf
Added some suggestions which should hopefully help you fix that.
vcbuild.bat
Outdated
@@ -508,7 +509,7 @@ if not defined msi goto install-doctools | |||
echo Building node-v%FULLVERSION%-%target_arch%.msi | |||
set "msbsdk=" | |||
if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%" | |||
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo | |||
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /guard:cf /DYNAMICBASE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, /DYNAMICBASE
is something that should be passed to link
. To do that, you can try adding <AdditionalOptions>/DYNAMICBASE /GUARD:CF</AdditionalOptions>
to the list of <Link>
options.
@RaisinTen How can I get the binary built for this PR. I need to run test for CFG enablement. |
The suggested solution ain't working. I tried multiple combinations. |
I don't think we provide a way to download the artifacts generated from PRs. You probably need to build it yourself. Here is the building guide for Windows - https://github.com/nodejs/node/blob/HEAD/BUILDING.md#windows.
I guess Richard is right in #42126 (comment), this needs a change in the gyp files. The vcxproj file is only used to build the msi, not the node.exe executable. |
Can anyone suggest something more concrete ?? |
@richardlau Which gyp files should be modified to enable CFG when compiling node.js sources? |
Probably common.gypi: Lines 279 to 318 in 03fb789
I think cc @nodejs/platform-windows |
Links Issue : #42100
#42100