镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

vcbuild.bat fails for Visual Studio 2019 if VCINSTALLDIR intentionally pre-defined #35856

Description

@bingenito
  • Version: Found when internally onboarding now active LTS 14.x
  • Platform: windows
  • Subsystem: build

What steps will reproduce the bug?

We have a build environment that does not have any Visual Studio installed. As part of bootstrapping vcbuild we explicitly set paths to build tooling as well as locally nuget install other required packages into the build directory. The change in PR #30119 causes VS version detection to now fail because VCINSTALLDIR which we are explicitly setting based on our environment is being cleared.

What is the expected behavior?

If you run "vcbuild vs2019 ..." it doesn't try and fall through to detect vs2017 since a specific version was requested so nothing needs to be cleared for that detection to work.

Additional information

Suggested fix is that if target_env is defined and is "vs2019" then do not clear VCINSTALLDIR. I can create the pull request if it seems like the right direction.

Activity

  1. richardlau commented on Oct 28, 2020

    @richardlau
    Member

    cc @nodejs/platform-windows
    (FWIW I no longer have access to the Windows dev environment I had for #30119 so am not going to be able to test any changes.)

  2. bingenito commented on Oct 28, 2020

    @bingenito
    ContributorAuthor

    I tested locally with it wrapped as:

    if not defined target_env set "VCINSTALLDIR="

    If target_env is set it can only get to that line if it is vs2019 and if it isn't set I would assume it means you want it to auto detect and want it to do that fall through that #30119 was fixing. It seems low touch but I do worry about all the environment possibilities out there considering what we are doing ourselves. Another possible fix is adding a new env override to skip the clear and to keep simpler backcompat but it seems excessive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions