Uh oh!
There was an error while loading. Please reload this page.
build: fix detection of Visual Studio 2017 - #30119
Conversation
This comment has been minimized.
This comment has been minimized.
targos
commented
Oct 25, 2019
do you know why it's not found in the |
targos
commented
Oct 25, 2019
Maybe we need to change the argument to |
richardlau
commented
Oct 25, 2019
Because it doesn't get there. See the debug in #30118 (comment). |
Or to be more specific in this block: Lines 239 to 272 in 11275dc On my system:
It looks like on the CI (which uses VS2017) |
richardlau
commented
Oct 25, 2019
Ah, it's probably because I build Node.js inside a "Developer Command Prompt for VS 2017" command prompt which has set up that environment variable. |
richardlau
commented
Oct 25, 2019
I've got a build going at the moment but when it completes I'll try clearing |
richardlau
commented
Oct 25, 2019
@targos I've updated this PR. Turns out all we need to do is clear the value of the |
nodejs-github-bot
commented
Oct 26, 2019
targos
commented
Oct 27, 2019
There was a problem hiding this comment.
| set"VCINSTALLDIR=" | |
| @rem VS2017 is detected here when VCINSTALLDIR is set (as in VS Command Prompt) | |
| set"VCINSTALLDIR=" |
There was a problem hiding this comment.
To be clear, this is just a suggestion. Feel free to take it, change it as you see fit or leave it.
There was a problem hiding this comment.
Added a (different) comment. PTAL.
dcdd328 to
07c4965Comparenodejs-github-bot
commented
Oct 31, 2019
nodejs-github-bot
commented
Nov 5, 2019
nodejs-github-bot
commented
Nov 5, 2019
nodejs-github-bot
commented
Nov 5, 2019
When run in a Visual Studio 2017 command prompt the `VCINSTALLDIR` environment variable will be already set and is not cleared by the `tools/msvs/vswhere_usability_wrapper.cmd` utility when it fails to find Visual Studio 2019. This causes `vcbuild.bat` to incorrectly assume Visual Studio 2019 and generate an incompatible configuration. Clearing the value of `VCINSTALLDIR` before calling the utility fixes the detection logic. PR-URL: nodejs#30119Fixes: nodejs#30118 Refs: nodejs#30022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: João Reis <reis@janeasystems.com>
richardlau
commented
Nov 5, 2019
Landed in 1f2fdc9 |
When run in a Visual Studio 2017 command prompt the `VCINSTALLDIR` environment variable will be already set and is not cleared by the `tools/msvs/vswhere_usability_wrapper.cmd` utility when it fails to find Visual Studio 2019. This causes `vcbuild.bat` to incorrectly assume Visual Studio 2019 and generate an incompatible configuration. Clearing the value of `VCINSTALLDIR` before calling the utility fixes the detection logic. PR-URL: #30119Fixes: #30118 Refs: #30022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: João Reis <reis@janeasystems.com>
When run in a Visual Studio 2017 command prompt the
VCINSTALLDIRenvironment variable will be already set and is not cleared by the
tools/msvs/vswhere_usability_wrapper.cmdutility when it fails tofind Visual Studio 2019. This causes
vcbuild.batto incorrectlyassume Visual Studio 2019 and generate an incompatible configuration.
Clearing the value of
VCINSTALLDIRbefore calling the utility fixesthe detection logic.
Fixes: #30118
Refs: #30022
cc @nodejs/platform-windows @nodejs/build-files @targos
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes