Put all VS runtime dirs in PATH This fixes the SDE builders after https://boringssl-review.googlesource.com/c/boringssl/+/75008/ VS comes with some runtime dlls for things like the debug version of their C runtime. These are not generally available on Windows machines (notably not on our CI machines), so debug builds need to get them from MSVC. Annoyingly, those directories are not part of the SetEnv.{arch}.json files in MSVC, so I had to put them in by hand elsewhere. I attempted to match what the old package and the GN goop was doing, but it resulted in a mysterious error on 64-bit debug builds. So the version I landed just filtered by CPU. This worked except that win64_sde broke with a different error. Looks like the sde.exe launcher is 32-bit (though why it needs MSVC dlls, I'm not sure). After some more wrestling, it turns out the problem was the directory order! Due to a bug and some incorrect sorting, I put them in order sysarm64, sys64, sys32. The correct order is sys64, sys32, sysarm64. The order is actually significant. There are some x86_64 dlls in sysarm64 that confuse Windows. (arm64ec perhaps?) Anyway, go back to putting them all in there. This is probably also wrong, to be honest, but this matches what we were doing before. We can dig into this further later. Change-Id: Id8108f40baa761b50e30135f21a72345130ef729 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/78547 Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
diff --git a/util/bot/vs_env.py b/util/bot/vs_env.py index 9b572ee..b650795 100644 --- a/util/bot/vs_env.py +++ b/util/bot/vs_env.py
@@ -27,9 +27,10 @@ sdk_dir = os.path.join(sdk_root, 'Windows Kits', '10') os.environ['WINDOWSSDKDIR'] = sdk_dir # Include the VS runtime in the PATH in case it's not machine-installed. - runtime_dir = {'x86': 'sys32', 'x64': 'sys64', 'arm64': 'sysarm64'} - os.environ['PATH'] = os.path.join(sdk_root, runtime_dir[cpu]) + \ - os.pathsep + os.environ['PATH'] + runtime_dirs = \ + [os.path.join(sdk_root, d) for d in ['sys64', 'sys32', 'sysarm64']] + os.environ['PATH'] = \ + os.pathsep.join(runtime_dirs) + os.pathsep + os.environ['PATH'] # Set up the architecture-specific environment from the SetEnv files. See # _LoadToolchainEnv() from setup_toolchain.py in Chromium.