lukka / run-cmake

GitHub Action to build C++ applications with CMake (CMakePresets.json), Ninja and vcpkg on GitHub.
MIT License
176 stars 19 forks source link

Failure of tests on Windows agents due to NPM_CONFIG_CACHE defined multiple time and different casing #26

Closed lukka closed 2 years ago

lukka commented 3 years ago

Functional test using VS generator fails with the following error. The problem is that during the execution of the workflow, the NPM_CONFIG_CACHE environment variable gets defined with different casing multiple time, and starting a process in .NET fails at using an environment having the same variable defined multiple time (and with different casing).

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'NPM_CONFIG_CACHE'  Key being added: 'npm_config_cache' [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3838789Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3839853Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at System.Collections.Hashtable.Add(Object key, Object value) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3841250Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at System.Collections.Specialized.StringDictionaryWithComparer.Add(String key, String value) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3842298Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3843763Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3845031Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3846428Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3847758Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
2020-09-05T05:47:19.3848715Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\a\run-cmake\run-cmake\__tests__\build Directory\VS-x64-Release\ZERO_CHECK.vcxproj]
lukka commented 2 years ago

closing as not relevant anymore