diff --git a/.bcr/patches/go_dev_dep.patch b/.bcr/patches/go_dev_dep.patch new file mode 100644 index 000000000..e20f3a18c --- /dev/null +++ b/.bcr/patches/go_dev_dep.patch @@ -0,0 +1,16 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index f05c57a..4cb6104 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -28,9 +28,9 @@ register_toolchains( + # To allow /tools to be built from source + # NOTE: when publishing to BCR, we patch this to be dev_dependency, as we publish pre-built binaries + # along with our releases. +-bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go") ++bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go", dev_dependency = True) + +-go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") ++go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps", dev_dependency = True) + go_deps.from_file(go_mod = "//:go.mod") + use_repo( + go_deps, diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a5010d5b6..31136c253 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -173,10 +173,6 @@ jobs: if: matrix.bzlmodEnabled run: echo "bzlmod_flag=--enable_bzlmod" >> $GITHUB_OUTPUT - - name: Make dev dependencies available (bzlmod) - if: matrix.bzlmodEnabled - run: sed -i${{ matrix.os == 'macos-latest' && ' ""' || '' }} 's/dev_dependency = True/dev_dependency = False/g' MODULE.bazel - - name: Write rbe credentials if: ${{ matrix.config == 'rbe' }} working-directory: ${{ matrix.folder }} diff --git a/MODULE.bazel b/MODULE.bazel index 38819f5a5..f05c57a40 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -26,13 +26,11 @@ register_toolchains( ) # To allow /tools to be built from source -bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go") +# NOTE: when publishing to BCR, we patch this to be dev_dependency, as we publish pre-built binaries +# along with our releases. +bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go") -go_deps = use_extension( - "@gazelle//:extensions.bzl", - "go_deps", - dev_dependency = True, -) +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod") use_repo( go_deps,