Skip to content

Commit

Permalink
Do not share cache between modules for windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ylecornec committed Jun 8, 2023
1 parent 7f69170 commit fe7a6dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,20 @@ build:ci-linux-nixpkgs --config=linux-nixpkgs
build:ci-macos-bindist --config=macos-bindist
build:ci-macos-nixpkgs --config=macos-nixpkgs
build:ci-windows-bindist --config=windows-bindist
build:ci-windows-bindist-rules-haskell --config=ci-windows-bindist
build:ci-windows-bindist-rules-haskell-tests --config=ci-windows-bindist

# Windows is prone to leaking absolute paths into the remote cache which can
# poison the cache. Increment this number to use a fresh cache. Errors of the
# following form might indicate such an issue:
# poison the cache, so we do not share the cache between different modules.
# Increment these numbers to use a fresh cache.
# Errors of the following form might indicate such an issue:
#
# ERROR: D:/a/rules_haskell/rules_haskell/tests/runfiles/BUILD.bazel:20:10: Compiling tests/runfiles/main.cc failed: undeclared inclusion(s) in rule '//tests/runfiles:cc-runner':
# this rule is missing dependency declarations for the following files included by 'tests/runfiles/main.cc':
# '.../execroot/rules_haskell/external/rules_haskell_ghc_windows_amd64/mingw/include/c++/9.2.0/cstdlib'
# '.../execroot/rules_haskell/external/rules_haskell_ghc_windows_amd64/mingw/include/c++/9.2.0/x86_64-w64-mingw32/bits/c++config.h'
build:ci-windows-bindist --remote_default_exec_properties=cache-silo-key=windows-v2
build:ci-windows-bindist-rules-haskell --remote_default_exec_properties=cache-silo-key=windows-rules-haskell-v0
build:ci-windows-bindist-rules-haskell-tests --remote_default_exec_properties=cache-silo-key=windows-rules-haskell-tests-v0

# XXX: @com_google_protobuf sets `use_default_shell_env = True`, so we enable
# strict action env to avoid changes in `PATH` invalidating the cache.
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,11 @@ jobs:
# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
# See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
[[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
case ${{ runner.os }} in
macOS) BUILD_CONFIG=ci-macos-bindist;;
Linux) BUILD_CONFIG=ci-linux-bindist;;
Windows) BUILD_CONFIG=ci-windows-bindist;;
case "${{ runner.os }},${{ matrix.module }}" in
macOS,*) BUILD_CONFIG=ci-macos-bindist;;
Linux,*) BUILD_CONFIG=ci-linux-bindist;;
Windows,rules_haskell) BUILD_CONFIG=ci-windows-bindist-rules-haskell;;
Windows,rules_haskell_tests) BUILD_CONFIG=ci-windows-bindist-rules-haskell-tests;;
esac
if [ -z "$BUILDBUDDY_API_KEY" ]; then
cache_setting='--noremote_upload_local_results'
Expand Down

0 comments on commit fe7a6dd

Please sign in to comment.