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 <andreas.herrmann@tweag.io>
This commit is contained in:
Andreas Herrmann 2020-05-05 20:02:39 +02:00 committed by GitHub
parent 0c90844184
commit 150e0366a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

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

View File

@ -44,14 +44,6 @@ cd compatibility
# Symlinks dont 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