Skip to content

vcvarsall.bat during tools\setup-buildtools.cmd execution unsets VCPKG_ROOT #3275

@monkey1016

Description

@monkey1016

Describe your environment

  • Windows 11
  • Visual Studio Professional
  • v1.19.0 tag

Steps to reproduce
Execute

tools\setup-buildtools.cmd

What is the expected behavior?
tools\setup-buildtools.cmd to complete successfully

What is the actual behavior?
The following error:

Building with vs2022 Professional...
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.12.5
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Using existing vcpkg installation...
Computing installation plan...
error: while looking for gtest:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\gtest: error: gtest does not exist
Computing installation plan...
error: try_read_contents("C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\scripts\vcpkg-tools.json"): no such file or directory
Computing installation plan...
error: try_read_contents("C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\scripts\vcpkg-tools.json"): no such file or directory
Computing installation plan...
error: while looking for ms-gsl:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\ms-gsl: error: ms-gsl does not exist
Computing installation plan...
error: while looking for nlohmann-json:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\nlohmann-json: error: nlohmann-json does not exist
Computing installation plan...
error: while looking for abseil:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\abseil: error: abseil does not exist
Computing installation plan...
error: while looking for grpc:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\grpc: error: grpc does not exist
Computing installation plan...
error: while looking for prometheus-cpp:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\prometheus-cpp: error: prometheus-cpp does not exist
Computing installation plan...
error: while looking for curl:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\curl: error: curl does not exist
Computing installation plan...
error: while looking for thrift:x64-windows:
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\vcpkg\ports\thrift: error: thrift does not exist

Additional context
If I comment out call %TOOLS_VS2022_PRO% %ARCH% on line 64 of vcvars.cmd, it completes the build successfully. Adding some echo lines shows that VCPKG_ROOT is properly set prior to executing vcvars.cmd and then unset after executing vcvars.cmd

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions