OpenConsole.psm1 -- Set-MsbuildDevEnvironment doesn't check for the existence of VS140COMNTOOLS #1427

Closed
opened 2026-01-30 22:26:50 +00:00 by claunia · 2 comments
Owner

Originally created by @strega-nil on GitHub (May 30, 2019).

Environment

...
VCIDEInstallDir                C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\VC\
VCINSTALLDIR                   C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\
VCToolsInstallDir              C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\
VCToolsRedistDir               C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.20.27508\
VCToolsVersion                 14.20.27508
VisualStudioVersion            16.0
VS160COMNTOOLS                 C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\
VSCMD_ARG_app_plat             Desktop
VSCMD_ARG_HOST_ARCH            x64
VSCMD_ARG_TGT_ARCH             x64
VSCMD_VER                      16.0
VSINSTALLDIR                   C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\
...

Microsoft Windows [Version 10.0.18362.145]
pscore-6

Steps to reproduce

Don't install version 14x of MSVC when you're installing VS 2019, then follow the build instructions.

Expected behavior

Find MSVC 160, compile using that version; or, give an error and tell the user to install a version of MSVC which is compatible with terminal.

Actual behavior

PS C:\Users\npmaz\src\misc\terminal> Set-MsbuildDevEnvironment
pushd : The path 'C:\..\..' referred to an item that was outside the base 'C:'.
At C:\Users\npmaz\src\misc\terminal\tools\OpenConsole.psm1:11 char:5
+     pushd $path
+     ~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Push-Location], PSArgumentException
+ FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.PushLocationCommand

pushd : The path 'C:\..\..' referred to an item that was outside the base 'C:'.
At C:\Users\npmaz\src\misc\terminal\tools\OpenConsole.psm1:11 char:5
+     pushd $path
+     ~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Push-Location], PSArgumentException
+ FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.PushLocationCommand

'vcvarsall.bat' is not recognized as an internal or external command,
operable program or batch file.
Dev environment variables set

Note that no errors happen.

Originally created by @strega-nil on GitHub (May 30, 2019). <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none ... VCIDEInstallDir C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\VC\ VCINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\ VCToolsInstallDir C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\ VCToolsRedistDir C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.20.27508\ VCToolsVersion 14.20.27508 VisualStudioVersion 16.0 VS160COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\ VSCMD_ARG_app_plat Desktop VSCMD_ARG_HOST_ARCH x64 VSCMD_ARG_TGT_ARCH x64 VSCMD_VER 16.0 VSINSTALLDIR C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\ ... Microsoft Windows [Version 10.0.18362.145] pscore-6 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Don't install version 14x of MSVC when you're installing VS 2019, then follow the build instructions. # Expected behavior Find MSVC 160, compile using that version; or, give an error and tell the user to install a version of MSVC which is compatible with terminal. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior ``` PS C:\Users\npmaz\src\misc\terminal> Set-MsbuildDevEnvironment pushd : The path 'C:\..\..' referred to an item that was outside the base 'C:'. At C:\Users\npmaz\src\misc\terminal\tools\OpenConsole.psm1:11 char:5 + pushd $path + ~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Push-Location], PSArgumentException + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.PushLocationCommand pushd : The path 'C:\..\..' referred to an item that was outside the base 'C:'. At C:\Users\npmaz\src\misc\terminal\tools\OpenConsole.psm1:11 char:5 + pushd $path + ~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Push-Location], PSArgumentException + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.PushLocationCommand 'vcvarsall.bat' is not recognized as an internal or external command, operable program or batch file. Dev environment variables set ``` Note that no errors happen. <!-- What's actually happening? -->
Author
Owner

@zadjii-msft commented on GitHub (May 30, 2019):

@adiviness who owns these scripts

@zadjii-msft commented on GitHub (May 30, 2019): @adiviness who owns these scripts
Author
Owner

@DHowett-MSFT commented on GitHub (May 30, 2019):

Moving to #930

@DHowett-MSFT commented on GitHub (May 30, 2019): Moving to #930
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1427