Bump Bazel to 4.0.0
This bumps Bazel to 4.0.0 because we want to use ProtoModule. The update was relatively painless,
no incompat-flags needed to be switched back off. `bazel_gazelle` is pinned on a master version
since they haven't released a Bazel 4-comaptible version yet and I have one patch against Kubernetes's
infra repo which is going upstream.
Test Plan: Build system change, should be covered by existing tests
X-Origin-Diff: phab/D701
GitOrigin-RevId: 24f675e6ba33efb9f46191eccca95088d7d2d1f1
diff --git a/build/fietsje/planner.go b/build/fietsje/planner.go
index a609884..d006039 100644
--- a/build/fietsje/planner.go
+++ b/build/fietsje/planner.go
@@ -142,11 +142,14 @@
// inject adds a dependency to a collection as if requested by the high-level dependency of the collection. This should
// be used sparingly, for instance when high-level dependencies contain bazel code that uses some external workspaces
// from Go modules, and those workspaces are not defined in parsed transitive dependency definitions like go.mod/sum.
-func (c *collection) inject(importpath, version string) *collection {
+func (c *collection) inject(importpath, version string, opts ...buildOpt) *collection {
d := c.highlevel.child(importpath, version)
c.transitive[importpath] = d
c.p.available[importpath] = d
c.p.enabled[importpath] = true
+ for _, o := range opts {
+ o(c.transitive[importpath])
+ }
return c
}