Skip to content

Commit

Permalink
deps: update bazel (modules) (major) (#3540)
Browse files Browse the repository at this point in the history
* deps: update bazel (modules)

* deps: tidy all modules

* Copy private go_bin_for_host rule from `rules_go` to `/bazel/ci`

---------

Signed-off-by: Daniel Weiße <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: edgelessci <[email protected]>
Co-authored-by: Daniel Weiße <[email protected]>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent 7a7b6b3 commit 54878dd
Show file tree
Hide file tree
Showing 12 changed files with 405 additions and 89 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "hermetic_cc_toolchain", version = "3.1.1")
bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "rules_python", version = "1.0.0")

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
Expand Down
439 changes: 363 additions & 76 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bazel/ci/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
load("@com_github_ash2k_bazel_tools//multirun:def.bzl", "multirun")
load("@gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go/private/rules:go_bin_for_host.bzl", "go_bin_for_host")
load("//bazel/ci:go_bin_for_host.bzl", "go_bin_for_host")
load("//bazel/ci:proto_targets.bzl", "proto_targets")
load("//bazel/sh:def.bzl", "noop_warn", "repo_command", "sh_template")

Expand Down
29 changes: 29 additions & 0 deletions bazel/ci/go_bin_for_host.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Go toolchain for the host platformS
Inspired by https://github.com/bazel-contrib/rules_go/blob/6e4fdcfeb1a333b54ab39ae3413d4ded46d8958d/go/private/rules/go_bin_for_host.bzl
"""

load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")

GO_TOOLCHAIN = "@io_bazel_rules_go//go:toolchain"

def _ensure_target_cfg(ctx):
if "-exec" in ctx.bin_dir.path or "/host/" in ctx.bin_dir.path:
fail("exec not found")

def _go_bin_for_host_impl(ctx):
_ensure_target_cfg(ctx)
sdk = ctx.toolchains[GO_TOOLCHAIN].sdk
sdk_files = ctx.runfiles([sdk.go] + sdk.headers + sdk.libs + sdk.srcs + sdk.tools)
return [
DefaultInfo(
files = depset([sdk.go]),
runfiles = sdk_files,
),
]

go_bin_for_host = rule(
implementation = _go_bin_for_host_impl,
toolchains = [GO_TOOLCHAIN],
exec_compatible_with = HOST_CONSTRAINTS,
)
2 changes: 1 addition & 1 deletion bootstrapper/initproto/init.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion debugd/service/debugd.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion disk-mapper/recoverproto/recover.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/versions/components/components.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion joinservice/joinproto/join.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion keyservice/keyserviceproto/keyservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion upgrade-agent/upgradeproto/upgrade.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion verify/verifyproto/verify.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54878dd

Please sign in to comment.