Open tamaroth opened 7 years ago
cc/ @nodejs/platform-windows
@tamaroth just to make sure: it only happens with the static
arg? i.e. vcbuild.bat debug static vs2017 x86
?
Repro. I think I'd rather add this in node.gyp
then patch GYP
Ref: https://gyp.gsrc.io/docs/LanguageSpecification.md#Detailed-Design
@refack Sorry for late response, yes, as far as I can tell it happens only when building as static library. There's also another error when building release library (problem with included resources), but I will make additional bug report for it.
@refack Suggestions for how to unstick this? Any team that might be cc'ed? Or maybe a label to add like help wanted
or something?
/CC @nodejs/gyp ¯_(ツ)_/¯
Not sure if it's related but https://github.com/nodejs/node/blob/83eb4f285583036bedc1c908178d58b9b6e45d1f/common.gypi#L307-L315 adds TargetMachine for release builds, even though there doesn't appear to be one for the debug builds.
When generating project files for node, gyp does not include for librarian but does so for linker. As a result the linking fails as MSBuild will default unknown machine to x64 (on x64 platforms).
The result is as follows:
This is manually easily fixed by modyfying .vcxproj file to include proper inside .
For instance, from the above command, the node.vcxproj file in Debug|Win32 configuration has this entry:
If I modify it to
Everything works great.
Inside
node\tools\gyp\pylib\gyp\msvs_emulation.py
in function GetLibFlags (line: 515) it says to add specific machine, but for some reason it's not added later on to the project file.