From 524dba433d0009438c80430a2d21b2c6f8098a0a Mon Sep 17 00:00:00 2001 From: Philipp Zander Date: Thu, 22 Feb 2024 20:35:23 +0100 Subject: [PATCH] `try-import` `.bazelrc.*` files everywhere --- .github/workflows/workflow.yaml | 3 --- examples/.bazelrc | 11 ++++++++++- examples/.bazelrc.bzlmod | 7 ++++++- examples/.bazelrc.common | 1 - examples/.bazelrc.local | 1 - examples/arm/.bazelrc | 11 ++++++++++- examples/arm/.bazelrc.bzlmod | 9 +++++++-- examples/arm/.bazelrc.common | 1 - rules_haskell_nix/.bazelrc | 8 ++++++-- rules_haskell_nix/.bazelrc.bzlmod | 5 ++++- rules_haskell_tests/.bazelrc | 8 ++++++-- rules_haskell_tests/.bazelrc.bzlmod | 2 +- .../tests/bzlmod_runfiles/other_module/.bazelrc | 8 ++++++++ .../bzlmod_runfiles/other_module/.bazelrc.bzlmod | 9 +++++++-- tutorial/.bazelrc | 11 ++++++++++- tutorial/.bazelrc.bzlmod | 7 ++++++- tutorial/.bazelrc.common | 1 - tutorial/.bazelrc.local | 1 - 18 files changed, 81 insertions(+), 23 deletions(-) mode change 120000 => 100644 examples/.bazelrc delete mode 120000 examples/.bazelrc.common delete mode 120000 examples/.bazelrc.local mode change 120000 => 100644 examples/arm/.bazelrc delete mode 120000 examples/arm/.bazelrc.common mode change 120000 => 100644 tutorial/.bazelrc delete mode 120000 tutorial/.bazelrc.common delete mode 120000 tutorial/.bazelrc.local diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 03e0998e2..e33257dd7 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -97,8 +97,6 @@ jobs: build --config=$BUILD_CONFIG common --enable_bzlmod=${{ matrix.bzlmod }} EOF - cp .bazelrc.local rules_haskell_nix - cp .bazelrc.local rules_haskell_tests - name: Build & test - rules_haskell if: matrix.module == 'rules_haskell' uses: tweag/run-nix-shell@v0 @@ -208,7 +206,6 @@ jobs: $bzlmod_cache_silo_key common --enable_bzlmod=${{ matrix.bzlmod }} EOF - cp .bazelrc.local rules_haskell_tests - name: Build & test - rules_haskell if: matrix.module == 'rules_haskell' shell: bash diff --git a/examples/.bazelrc b/examples/.bazelrc deleted file mode 120000 index adb61980d..000000000 --- a/examples/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc \ No newline at end of file diff --git a/examples/.bazelrc b/examples/.bazelrc new file mode 100644 index 000000000..c7a03c92e --- /dev/null +++ b/examples/.bazelrc @@ -0,0 +1,10 @@ +import %workspace%/../.bazelrc.common +import %workspace%/../.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../.bazelrc.auth + +# User Configuration +# ------------------ +try-import %workspace%/../.bazelrc.local diff --git a/examples/.bazelrc.bzlmod b/examples/.bazelrc.bzlmod index e9e450bff..18583e59d 100644 --- a/examples/.bazelrc.bzlmod +++ b/examples/.bazelrc.bzlmod @@ -1,2 +1,7 @@ +# Disable bzlmod explicitly by default, see https://github.com/tweag/rules_haskell/issues/1977 +common --noenable_bzlmod + common:bzlmod --enable_bzlmod -common:common --registry=file://%workspace%/../registry --registry=https://bcr.bazel.build +# Note, have to use /// to make Bazel not crash on Windows +common:common --registry=file:///%workspace%/../registry --registry=https://bcr.bazel.build + diff --git a/examples/.bazelrc.common b/examples/.bazelrc.common deleted file mode 120000 index 95435188c..000000000 --- a/examples/.bazelrc.common +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc.common \ No newline at end of file diff --git a/examples/.bazelrc.local b/examples/.bazelrc.local deleted file mode 120000 index 26089d660..000000000 --- a/examples/.bazelrc.local +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc.local \ No newline at end of file diff --git a/examples/arm/.bazelrc b/examples/arm/.bazelrc deleted file mode 120000 index c70ccda07..000000000 --- a/examples/arm/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -../../.bazelrc \ No newline at end of file diff --git a/examples/arm/.bazelrc b/examples/arm/.bazelrc new file mode 100644 index 000000000..1dd98cd71 --- /dev/null +++ b/examples/arm/.bazelrc @@ -0,0 +1,10 @@ +import %workspace%/../../.bazelrc.common +import %workspace%/../../.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../../.bazelrc.auth + +# User Configuration +# ------------------ +try-import %workspace%/../../.bazelrc.local diff --git a/examples/arm/.bazelrc.bzlmod b/examples/arm/.bazelrc.bzlmod index 0ba38989a..81d9666d4 100644 --- a/examples/arm/.bazelrc.bzlmod +++ b/examples/arm/.bazelrc.bzlmod @@ -1,2 +1,7 @@ -common:bzlmod --experimental_enable_bzlmod -common:bzlmod --registry=file://%workspace%/../../registry --registry=https://bcr.bazel.build +# Disable bzlmod explicitly by default, see https://github.com/tweag/rules_haskell/issues/1977 +common --noenable_bzlmod + +common:bzlmod --enable_bzlmod +# Note, have to use /// to make Bazel not crash on Windows +common:common --registry=file:///%workspace%/../../registry --registry=https://bcr.bazel.build + diff --git a/examples/arm/.bazelrc.common b/examples/arm/.bazelrc.common deleted file mode 120000 index 1a250488a..000000000 --- a/examples/arm/.bazelrc.common +++ /dev/null @@ -1 +0,0 @@ -../../.bazelrc.common \ No newline at end of file diff --git a/rules_haskell_nix/.bazelrc b/rules_haskell_nix/.bazelrc index 43a3ba1dd..c7a03c92e 100644 --- a/rules_haskell_nix/.bazelrc +++ b/rules_haskell_nix/.bazelrc @@ -1,6 +1,10 @@ import %workspace%/../.bazelrc.common -import %workspace%/.bazelrc.bzlmod +import %workspace%/../.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../.bazelrc.auth # User Configuration # ------------------ -try-import %workspace%/.bazelrc.local +try-import %workspace%/../.bazelrc.local diff --git a/rules_haskell_nix/.bazelrc.bzlmod b/rules_haskell_nix/.bazelrc.bzlmod index e04eb49e5..18583e59d 100644 --- a/rules_haskell_nix/.bazelrc.bzlmod +++ b/rules_haskell_nix/.bazelrc.bzlmod @@ -1,4 +1,7 @@ -common:bzlmod --enable_bzlmod +# Disable bzlmod explicitly by default, see https://github.com/tweag/rules_haskell/issues/1977 +common --noenable_bzlmod +common:bzlmod --enable_bzlmod # Note, have to use /// to make Bazel not crash on Windows common:common --registry=file:///%workspace%/../registry --registry=https://bcr.bazel.build + diff --git a/rules_haskell_tests/.bazelrc b/rules_haskell_tests/.bazelrc index 43a3ba1dd..c7a03c92e 100644 --- a/rules_haskell_tests/.bazelrc +++ b/rules_haskell_tests/.bazelrc @@ -1,6 +1,10 @@ import %workspace%/../.bazelrc.common -import %workspace%/.bazelrc.bzlmod +import %workspace%/../.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../.bazelrc.auth # User Configuration # ------------------ -try-import %workspace%/.bazelrc.local +try-import %workspace%/../.bazelrc.local diff --git a/rules_haskell_tests/.bazelrc.bzlmod b/rules_haskell_tests/.bazelrc.bzlmod index 1f93e25d6..18583e59d 100644 --- a/rules_haskell_tests/.bazelrc.bzlmod +++ b/rules_haskell_tests/.bazelrc.bzlmod @@ -2,6 +2,6 @@ common --noenable_bzlmod common:bzlmod --enable_bzlmod - # Note, have to use /// to make Bazel not crash on Windows common:common --registry=file:///%workspace%/../registry --registry=https://bcr.bazel.build + diff --git a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc index 46552aed1..1c5d8e187 100644 --- a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc +++ b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc @@ -1,2 +1,10 @@ import %workspace%/../../../../.bazelrc.common import %workspace%/.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../../../../.bazelrc.auth + +# User Configuration +# ------------------ +try-import %workspace%/../../../../.bazelrc.local diff --git a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc.bzlmod b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc.bzlmod index 583573e3a..a1dc3e0b4 100644 --- a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc.bzlmod +++ b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/.bazelrc.bzlmod @@ -1,2 +1,7 @@ -common:bzlmod --experimental_enable_bzlmod -common:bzlmod --registry=file:%workspace%/../../../../registry --registry=https://bcr.bazel.build +# Disable bzlmod explicitly by default, see https://github.com/tweag/rules_haskell/issues/1977 +common --noenable_bzlmod + +common:bzlmod --enable_bzlmod +# Note, have to use /// to make Bazel not crash on Windows +common:common --registry=file:///%workspace%/../../../../registry --registry=https://bcr.bazel.build + diff --git a/tutorial/.bazelrc b/tutorial/.bazelrc deleted file mode 120000 index adb61980d..000000000 --- a/tutorial/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc \ No newline at end of file diff --git a/tutorial/.bazelrc b/tutorial/.bazelrc new file mode 100644 index 000000000..c7a03c92e --- /dev/null +++ b/tutorial/.bazelrc @@ -0,0 +1,10 @@ +import %workspace%/../.bazelrc.common +import %workspace%/../.bazelrc.bzlmod + +# Remote Cache Authentication +# --------------------------- +try-import %workspace%/../.bazelrc.auth + +# User Configuration +# ------------------ +try-import %workspace%/../.bazelrc.local diff --git a/tutorial/.bazelrc.bzlmod b/tutorial/.bazelrc.bzlmod index e9e450bff..18583e59d 100644 --- a/tutorial/.bazelrc.bzlmod +++ b/tutorial/.bazelrc.bzlmod @@ -1,2 +1,7 @@ +# Disable bzlmod explicitly by default, see https://github.com/tweag/rules_haskell/issues/1977 +common --noenable_bzlmod + common:bzlmod --enable_bzlmod -common:common --registry=file://%workspace%/../registry --registry=https://bcr.bazel.build +# Note, have to use /// to make Bazel not crash on Windows +common:common --registry=file:///%workspace%/../registry --registry=https://bcr.bazel.build + diff --git a/tutorial/.bazelrc.common b/tutorial/.bazelrc.common deleted file mode 120000 index 95435188c..000000000 --- a/tutorial/.bazelrc.common +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc.common \ No newline at end of file diff --git a/tutorial/.bazelrc.local b/tutorial/.bazelrc.local deleted file mode 120000 index 26089d660..000000000 --- a/tutorial/.bazelrc.local +++ /dev/null @@ -1 +0,0 @@ -../.bazelrc.local \ No newline at end of file