From 150e0366a47ca2ec0ca547a26c750ac10e39550d Mon Sep 17 00:00:00 2001 From: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com> Date: Tue, 5 May 2020 20:02:39 +0200 Subject: [PATCH] Apply platform_suffix on all Windows pipelines (#5846) * Apply plotform_suffix on all Windows pipelines To distinguish action keys between the compatibility and the main workspace and avoid the "undeclared input(s)" error. We also modify the main workspace's action cache keys to avoid poisoned cache items. CHANGELOG_BEGIN CHANGELOG_END * Avoid exceeding MAX_PATH on Windows Co-authored-by: Andreas Herrmann --- ci/configure-bazel.sh | 11 +++++++++++ compatibility/test-windows.ps1 | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) 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