treewide: enable pure Go by default
Pure can be safely enabled by default. For those targets which need cgo,
we can set `pure = "off"` on the go_binary or go_test.
This simplifies transitions, and makes the files/files_cc distinction
obsolete.
Change-Id: Ic1a985e7d347a7222f55735c1ee2016e8a7e1c65
Reviewed-on: https://review.monogon.dev/c/monogon/+/4158
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/osbase/build/mkerofs/def.bzl b/osbase/build/mkerofs/def.bzl
index ff4e137..0be0568 100644
--- a/osbase/build/mkerofs/def.bzl
+++ b/osbase/build/mkerofs/def.bzl
@@ -1,4 +1,4 @@
-load("//osbase/build:def.bzl", "build_pure_transition", "build_static_transition")
+load("//osbase/build:def.bzl", "build_static_transition")
load("//osbase/build/fsspec:def.bzl", "FSSpecInfo", "fsspec_core_impl")
def _erofs_image_impl(ctx):
@@ -10,9 +10,11 @@
return [DefaultInfo(files = depset([fs_out]))]
erofs_image = rule(
+ # Attach static transition to ensure all binaries added to the EROFS are static binaries.
+ cfg = build_static_transition,
implementation = _erofs_image_impl,
doc = """
- Build an EROFS. All files specified in files, files_cc and all specified symlinks will be contained.
+ Build an EROFS. All files specified in files and all specified symlinks will be contained.
Executable files will have their permissions set to 0555, non-executable files will have
their permissions set to 0444. All parent directories will be created with 0555 permissions.
""",
@@ -24,24 +26,13 @@
Dictionary of Labels to String, placing a given Label's output file in the EROFS at the location
specified by the String value. The specified labels must only have a single output.
""",
- # Attach pure transition to ensure all binaries added to the initramfs are pure/static binaries.
- cfg = build_pure_transition,
- ),
- "files_cc": attr.string_keyed_label_dict(
- allow_files = True,
- doc = """
- Special case of 'files' for compilation targets that need to be built with the musl toolchain like
- go_binary targets which need cgo or cc_binary targets.
- """,
- # Attach static transition to all files_cc inputs to ensure they are built with musl and static.
- cfg = build_static_transition,
),
"symlinks": attr.string_dict(
default = {},
doc = """
- Symbolic links to create. Similar format as in files and files_cc, so the key is the location of the
+ Symbolic links to create. Similar format as in `files`, so the key is the location of the
symlink itself and the value of it is target of the symlink. Only raw strings are allowed as targets,
- labels are not permitted. Include the file using files or files_cc, then symlink to its location.
+ labels are not permitted. Include the file using `files`, then symlink to its location.
""",
),
"fsspecs": attr.label_list(