ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
338 stars 49 forks source link

Autodetect variables to export #32

Closed ilammy closed 3 years ago

ilammy commented 3 years ago

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 ```