Skip to content

Commit

Permalink
chore: rules_go is a non-dev dep at HEAD (#554)
Browse files Browse the repository at this point in the history
This ensures if you get a SHA of bazel-lib you build the tools/ from head
  • Loading branch information
alexeagle authored Sep 27, 2023
1 parent a4e997d commit 14d6c50
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .bcr/patches/go_dev_dep.patch
Original file line number Diff line number Diff line change
@@ -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,
4 changes: 0 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 4 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 14d6c50

Please sign in to comment.