diff --git a/ci/configure-bazel.sh b/ci/configure-bazel.sh index aeaa141e8c..7b2424eb03 100755 --- a/ci/configure-bazel.sh +++ b/ci/configure-bazel.sh @@ -47,6 +47,17 @@ fi if is_windows; then echo "build --config windows" > .bazelrc.local echo "build --config windows-ci" >> .bazelrc.local + + # Modify the output path (x64_windows-opt-co) to avoid shared action keys + # between external dependencies of the daml and compatibility workspaces. + # These are causing issues on Windows, namely sporadic failures due to + # "undeclared inclusion(s)" with the mingw toolchain. This doesn't modify all + # action keys, e.g. metadata actions like `Mnemonic: Middleman` are + # unaffected. However, all actions that produce artifacts will be affected. + # To avoid exceeding the maximum path limit on Windows we limit the suffix to + # three characters. + CONFIG=${BAZEL_CONFIG_DIR-default} + echo "build --platform_suffix=-${CONFIG:0:2}" >> .bazelrc.local fi # sets up write access to the shared remote cache if the branch is not a fork diff --git a/compatibility/test-windows.ps1 b/compatibility/test-windows.ps1 index 7314022ffb..e4a2ffdff2 100644 --- a/compatibility/test-windows.ps1 +++ b/compatibility/test-windows.ps1 @@ -44,14 +44,6 @@ cd compatibility # Symlinks don’t work on Windows. cp ../.bazelrc .bazelrc -# Modify the output path (x64_windows-opt-compat) to avoid shared action keys -# between external dependencies of the daml and compatibility workspaces. These -# are causing issues on Windows, namely sporadic failures due to "undeclared -# inclusion(s)" with the mingw toolchain. This doesn't modify all action keys, -# e.g. metadata actions like `Mnemonic: Middleman` are unaffected. However, all -# actions that produce artifacts will be affected. -Add-Content .bazelrc "build --platform_suffix=-compat" - bazel shutdown bazel build //... bazel shutdown