diff --git a/modules/rules_distroless/0.4.0/MODULE.bazel b/modules/rules_distroless/0.4.0/MODULE.bazel new file mode 100644 index 00000000000..9d6a4063652 --- /dev/null +++ b/modules/rules_distroless/0.4.0/MODULE.bazel @@ -0,0 +1,88 @@ +"Bazel dependencies" + +module( + name = "rules_distroless", + version = "0.4.0", + compatibility_level = 1, +) + +# Bazel 8 fails without a working version of protobuf +bazel_dep(name = "protobuf", version = "29.0-rc2.bcr.1") +bazel_dep(name = "bazel_skylib", version = "1.5.0") +bazel_dep(name = "aspect_bazel_lib", version = "2.9.4") +bazel_dep(name = "rules_java", version = "8.3.2") + +bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains") +use_repo(bazel_lib_toolchains, "zstd_toolchains") +use_repo(bazel_lib_toolchains, "bsd_tar_toolchains") +use_repo(bazel_lib_toolchains, "yq_darwin_amd64") +use_repo(bazel_lib_toolchains, "yq_darwin_arm64") +use_repo(bazel_lib_toolchains, "yq_linux_amd64") +use_repo(bazel_lib_toolchains, "yq_linux_arm64") +use_repo(bazel_lib_toolchains, "yq_linux_ppc64le") +use_repo(bazel_lib_toolchains, "yq_linux_s390x") +use_repo(bazel_lib_toolchains, "yq_windows_amd64") + +# Dev dependencies +bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True, repo_name = "bazel_gazelle") +bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True) +bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True) +bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True) +bazel_dep(name = "rules_oci", version = "2.0.0-rc0", dev_dependency = True) +bazel_dep(name = "container_structure_test", version = "1.16.0", dev_dependency = True) +bazel_dep(name = "bazel_features", version = "1.20.0", dev_dependency = True) + +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "example-bullseye-ca-certificates", + build_file_content = 'exports_files(["data.tar.xz", "control.tar.xz"])', + sha256 = "b2d488ad4d8d8adb3ba319fc9cb2cf9909fc42cb82ad239a26c570a2e749c389", + urls = ["https://snapshot.debian.org/archive/debian/20231106T210201Z/pool/main/c/ca-certificates/ca-certificates_20210119_all.deb"], +) + +http_archive( + name = "example-bullseye-libc-bin", + build_file_content = 'exports_files(["data.tar.xz"])', + sha256 = "8b048ab5c7e9f5b7444655541230e689631fd9855c384e8c4a802586d9bbc65a", + urls = ["https://snapshot.debian.org/archive/debian-security/20231106T230332Z/pool/updates/main/g/glibc/libc-bin_2.31-13+deb11u7_amd64.deb"], +) + +http_archive( + name = "example-bookworm-libc-bin", + build_file_content = 'exports_files(["data.tar.xz"])', + sha256 = "38c44247c5b3e864d6db2877edd9c9a0555fc4e23ae271b73d7f527802616df5", + urls = ["https://snapshot.debian.org/archive/debian-security/20231106T230332Z/pool/updates/main/g/glibc/libc-bin_2.36-9+deb12u3_armhf.deb"], +) + +apt = use_extension( + "@rules_distroless//apt:extensions.bzl", + "apt", + dev_dependency = True, +) +apt.install( + name = "bullseye", + lock = "//examples/debian_snapshot:bullseye.lock.json", + manifest = "//examples/debian_snapshot:bullseye.yaml", +) +apt.install( + name = "bullseye_nolock", + manifest = "//examples/debian_snapshot:bullseye_nolock.yaml", + nolock = True, +) +apt.install( + name = "apt_security", + manifest = "//examples/debian_snapshot_security:security.yaml", + nolock = True, +) +apt.install( + name = "shared_dependencies", + lock = "//examples/debian_shared_dependencies:bullseye.lock.json", + manifest = "//examples/debian_shared_dependencies:bullseye.yaml", +) +apt.install( + name = "noble", + lock = "//examples/ubuntu_snapshot:noble.lock.json", + manifest = "//examples/ubuntu_snapshot:noble.yaml", +) +use_repo(apt, "apt_security", "apt_security_resolve", "bullseye", "bullseye_nolock", "noble", "shared_dependencies") diff --git a/modules/rules_distroless/0.4.0/patches/module_dot_bazel_version.patch b/modules/rules_distroless/0.4.0/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..144b1119ae4 --- /dev/null +++ b/modules/rules_distroless/0.4.0/patches/module_dot_bazel_version.patch @@ -0,0 +1,14 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -1,9 +1,9 @@ + "Bazel dependencies" + + module( + name = "rules_distroless", +- version = "0.0.0", ++ version = "0.4.0", + compatibility_level = 1, + ) + + # Bazel 8 fails without a working version of protobuf diff --git a/modules/rules_distroless/0.4.0/presubmit.yml b/modules/rules_distroless/0.4.0/presubmit.yml new file mode 100644 index 00000000000..da9b8e7ddf6 --- /dev/null +++ b/modules/rules_distroless/0.4.0/presubmit.yml @@ -0,0 +1,13 @@ +bcr_test_module: + module_path: "e2e/smoke" + matrix: + platform: ["debian10", "macos", "ubuntu2004"] + # last_rc is to get latest 8.x release. Replace with 8.x when available. + bazel: [7.x, last_rc] + tasks: + run_tests: + name: "Run test module" + bazel: ${{ bazel }} + platform: ${{ platform }} + test_targets: + - "//..." diff --git a/modules/rules_distroless/0.4.0/source.json b/modules/rules_distroless/0.4.0/source.json new file mode 100644 index 00000000000..41809eb86e1 --- /dev/null +++ b/modules/rules_distroless/0.4.0/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-BcYKs40as0VtMIkiVrfMVQWZM7obvlsr5PsjJ4jhB/0=", + "strip_prefix": "rules_distroless-0.4.0", + "url": "https://github.com/GoogleContainerTools/rules_distroless/releases/download/v0.4.0/rules_distroless-v0.4.0.tar.gz", + "patches": { + "module_dot_bazel_version.patch": "sha256-lVdrOHNzwRnwjMXN/aI0mxnd4/YUUxHZqLyW0dXzjKQ=" + }, + "patch_strip": 1 +} diff --git a/modules/rules_distroless/metadata.json b/modules/rules_distroless/metadata.json index 1119b48772b..313957cdaa4 100644 --- a/modules/rules_distroless/metadata.json +++ b/modules/rules_distroless/metadata.json @@ -26,7 +26,8 @@ "0.3.2", "0.3.3", "0.3.7", - "0.3.8" + "0.3.8", + "0.4.0" ], "yanked_versions": {} }