Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect variables to export #32

Merged
merged 2 commits into from
Mar 20, 2021
Merged

Autodetect variables to export #32

merged 2 commits into from
Mar 20, 2021

Conversation

ilammy
Copy link
Owner

@ilammy ilammy commented Mar 20, 2021

Instead of using a hardcoded list of variables to export, use a more smart approach: first inspect the original environment, then look what variables have changed as a result of vcvarsall.bat invocation, and export all those new values.

Also, log the variables we export to be more debugging-friendly.

This is how the output currently looks like.
Found with vswhere: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Setting CommandPromptType
Setting DevEnvDir
Setting ExtensionSdkDir
Setting Framework40Version
Setting FrameworkDir
Setting FrameworkDIR64
Setting FrameworkVersion
Setting FrameworkVersion64
Setting FSHARPINSTALLDIR
Setting HTMLHelpDir
Setting INCLUDE
Setting LIB
Setting LIBPATH
Setting NETFXSDKDir
Setting Path
Setting Platform
Setting UCRTVersion
Setting UniversalCRTSdkDir
Setting VCIDEInstallDir
Setting VCINSTALLDIR
Setting VCToolsInstallDir
Setting VCToolsRedistDir
Setting VCToolsVersion
Setting VisualStudioVersion
Setting VS160COMNTOOLS
Setting VSCMD_ARG_app_plat
Setting VSCMD_ARG_HOST_ARCH
Setting VSCMD_ARG_TGT_ARCH
Setting VSCMD_VER
Setting VSINSTALLDIR
Setting VSSDK150INSTALL
Setting VSSDKINSTALL
Setting WindowsLibPath
Setting WindowsSdkBinPath
Setting WindowsSdkDir
Setting WindowsSDKLibVersion
Setting WindowsSdkVerBinPath
Setting WindowsSDKVersion
Setting WindowsSDK_ExecutablePath_x64
Setting WindowsSDK_ExecutablePath_x86
Setting __devinit_path
Setting __DOTNET_ADD_64BIT
Setting __DOTNET_PREFERRED_BITNESS
Setting __VSCMD_PREINIT_PATH
Setting __VSCMD_script_err_count
Configured Developer Command Prompt

ilammy added 2 commits March 20, 2021 17:40
Instead of using a hardcoded list of variables to export, use a more
smart approach: first inspect the original environment, then look what
variables have changed as a result of "vcvarsall.bat" invocation, and
export all those new values.

Also, log the variables we export to be more debugging-friendly.
@ilammy ilammy merged commit dd5e2fa into master Mar 20, 2021
@ilammy ilammy deleted the autodetect-vars branch March 20, 2021 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant