osbase/build/mkoci/index: add package
This adds the mkoci/index package, which contains a Bazel rule for
building a multi-platform OCI index for an image.
rules_oci also has an image index rule, but it is not suitable for us.
That rule tries to read the platform from the container image config,
meaning it only works for container images. The rule here works for
arbitrary OCI artifact types. To make this work, the rule which
generates the image must put the platform into the descriptor in
index.json.
Because the index is not for any specific platform, there is a new "all"
platform where the index is generated.
Change-Id: I4ab1b87609d10b77c2f7fc42ee427f87d9f5ddc2
Reviewed-on: https://review.monogon.dev/c/monogon/+/4476
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/build/platforms/BUILD.bazel b/build/platforms/BUILD.bazel
index bca656a..c318c63 100644
--- a/build/platforms/BUILD.bazel
+++ b/build/platforms/BUILD.bazel
@@ -1,3 +1,9 @@
+# Platform for platform-independent targets.
+platform(
+ name = "all",
+ visibility = ["//visibility:public"],
+)
+
# Generic platform for Linux targets.
platform(
name = "linux_x86_64",