-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
* 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
There are no files selected for viewing
Large diffs are not rendered by default.
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, | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.