Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# nested modules
docs/
e2e/
examples/
81 changes: 3 additions & 78 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,96 +1,21 @@
"Bazel dependencies"

module(
name = "rules_distroless",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
bazel_dep(name = "bazel_features", version = "1.20.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.2.8")
bazel_dep(name = "rules_java", version = "8.8.0")
bazel_dep(name = "rules_shell", version = "0.4.1")

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 = "8.0.1", dev_dependency = True)
bazel_dep(name = "rules_oci", version = "2.0.0", dev_dependency = True)
bazel_dep(name = "container_structure_test", version = "1.16.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.yaml",
nolock = True,
)
apt.install(
name = "noble",
lock = "//examples/ubuntu_snapshot:noble.lock.json",
manifest = "//examples/ubuntu_snapshot:noble.yaml",
)
apt.install(
name = "resolution_test",
manifest = "apt/tests/resolution/security.yaml",
nolock = True,
)
apt.install(
name = "resolution_test_empty_lock",
lock = "//apt/tests/resolution:empty.lock.json",
manifest = "apt/tests/resolution/security.yaml",
)
apt.install(
name = "arch_all_test",
manifest = "apt/tests/resolution/arch_all.yaml",
nolock = True,
)
apt.install(
name = "clang",
manifest = "apt/tests/resolution/clang.yaml",
nolock = True,
)
use_repo(apt, "arch_all_test", "arch_all_test_resolve", "bullseye", "bullseye_nolock", "clang", "noble", "resolution_test", "resolution_test_empty_lock_resolve", "resolution_test_resolve")
19 changes: 5 additions & 14 deletions apt/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

exports_files([
"apt.bzl",
"extensions.bzl",
])

Expand All @@ -15,25 +14,17 @@ bzl_library(
],
)

bzl_library(
name = "apt",
srcs = ["apt.bzl"],
visibility = ["//visibility:public"],
deps = [
"//apt/private:deb_resolve",
"//apt/private:deb_translate_lock",
],
)

bzl_library(
name = "extensions",
srcs = ["extensions.bzl"],
visibility = ["//visibility:public"],
deps = [
"//apt/private:apt_deb_repository",
"//apt/private:apt_dep_resolver",
"//apt/private:deb_import",
"//apt/private:deb_resolve",
"//apt/private:deb_translate_lock",
"//apt/private:lockfile",
"@bazel_features//:features",
"//apt/private:translate_dependency_set",
"//apt/private:util",
"//apt/private:version_constraint",
],
)
140 changes: 0 additions & 140 deletions apt/apt.bzl

This file was deleted.

Loading