Skip to content

Commit

Permalink
Modify the cache URL instead of relying on platform_suffix (digital-a…
Browse files Browse the repository at this point in the history
…sset#6273)

For some reason, platform_suffix doesn’t seem to provide enough
isolation to fix the “undeclared inclusion” errors even though it does
fix the issues for me locally.

This PR tries to address the problem by switching from
`platform_suffix` to modifying the actual URL of the cache.

To avoid leaking stuff from the local cache, I’ve added a clean
--expunge for now. We should be able to remove this once nodes have
been reset tomorrow. It will slow down nodes but that is clearly
better than having everything fail.

changelog_begin
changelog_end
  • Loading branch information
cocreature authored Jun 9, 2020
1 parent acdca65 commit 20d2639
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# flag: --noremote_accept_cached
build:darwin --remote_http_cache=https://bazel-cache.da-ext.net
build:linux --remote_http_cache=https://bazel-cache.da-ext.net
build:windows-ci --remote_http_cache=https://bazel-cache.da-ext.net/v1
build --remote_upload_local_results=false
# Enable the disk cache in addition to the http cache.
build:linux --disk_cache=.bazel-cache/disk
Expand Down
2 changes: 2 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function bazel() {
# which is a workaround for this problem.
bazel shutdown

bazel clean --expunge

# Prefetch nodejs_dev_env to avoid permission denied errors on external/nodejs_dev_env/nodejs_dev_env/node.exe
# It isn’t clear where exactly those errors are coming from.
bazel fetch @nodejs_dev_env//...
Expand Down
6 changes: 4 additions & 2 deletions ci/configure-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ fi
CACHE_URL="https://storage.googleapis.com/daml-bazel-cache"

if is_windows; then
CACHE_URL="$CACHE_URL/v1"
echo "build --config windows" > .bazelrc.local
echo "build --config windows-ci" >> .bazelrc.local

Expand All @@ -74,7 +73,10 @@ if is_windows; then
SUFFIX="$(echo $PWD $RULES_HASKELL_REV | openssl dgst -md5 -binary | openssl enc -base64)"
SUFFIX="${SUFFIX:0:3}"
echo "Platform suffix: $SUFFIX"
echo "build --platform_suffix=-$SUFFIX" >> .bazelrc.local
# We include an extra version at the end that we can bump manually.
CACHE_SUFFIX="$SUFFIX-v1"
CACHE_URL="$CACHE_URL/$CACHE_SUFFIX"
echo "build:windows-ci --remote_http_cache=https://bazel-cache.da-ext.net/$CACHE_SUFFIX" >> .bazelrc.local
fi

# sets up write access to the shared remote cache if the branch is not a fork
Expand Down
1 change: 1 addition & 0 deletions compatibility/build-release-artifacts-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function bazel() {


bazel shutdown
bazel clean --expunge
bazel fetch @nodejs_dev_env//...
bazel build `
`-`-experimental_execution_log_file ${ARTIFACT_DIRS}/build_execution_windows.log `
Expand Down
1 change: 1 addition & 0 deletions compatibility/test-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ cd compatibility
cp ../.bazelrc .bazelrc

bazel shutdown
bazel clean --expunge
bazel fetch @nodejs_dev_env//...
bazel build //...
bazel shutdown
Expand Down

0 comments on commit 20d2639

Please sign in to comment.