Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support multiple components #85

Merged
Merged
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
16 changes: 7 additions & 9 deletions apt/private/resolve.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,14 @@ def internal_resolve(rctx, yq_toolchain_prefix, manifest, include_transitive):

sources = []

dist = None
for src in manifest["sources"]:
(distr, _, comp) = src["channel"].partition(" ")
if not dist:
dist = distr
sources.append((
src["url"],
distr,
comp,
))
distr, components = src["channel"].split(" ", 1)
for comp in components.split(" "):
sources.append((
src["url"],
distr,
comp,
))

pkgindex = package_index.new(rctx, sources = sources, archs = manifest["archs"])
pkgresolution = package_resolution.new(index = pkgindex)
Expand Down
1 change: 1 addition & 0 deletions e2e/smoke/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PACKAGES = [
"@bullseye//dpkg",
"@bullseye//apt",
"@bullseye//perl",
"@bullseye//nvidia-kernel-common",
]

# Creates /var/lib/dpkg/status with installed package information.
Expand Down
18 changes: 18 additions & 0 deletions e2e/smoke/bullseye.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,15 @@
"url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_amd64.deb",
"version": "1.1.1w-0+deb11u1"
},
{
"arch": "amd64",
"dependencies": [],
"key": "nvidia-kernel-common_20151021-p-13_amd64",
"name": "nvidia-kernel-common",
"sha256": "fa4b007bf64cf8cf0e9b3aaae5dd388fcec3a589ce2475f16d64347945691533",
"url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_amd64.deb",
"version": "20151021+13"
},
{
"arch": "arm64",
"dependencies": [],
Expand Down Expand Up @@ -2379,6 +2388,15 @@
"sha256": "d9159af073e95641e7eda440fa1d7623873b8c0034c9826a353f890bed107f3c",
"url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_arm64.deb",
"version": "1.1.1w-0+deb11u1"
},
{
"arch": "arm64",
"dependencies": [],
"key": "nvidia-kernel-common_20151021-p-13_arm64",
"name": "nvidia-kernel-common",
"sha256": "5a1f10cffc5407a6b63dcdf3f72af842ad9e39a808bb9418a4805aa0be345c65",
"url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_arm64.deb",
"version": "20151021+13"
}
],
"version": 1
Expand Down
4 changes: 3 additions & 1 deletion e2e/smoke/bullseye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version: 1

sources:
- channel: bullseye main
- channel: bullseye main contrib
url: https://snapshot.debian.org/archive/debian/20240210T223313Z
- channel: bullseye-security main
url: https://snapshot.debian.org/archive/debian-security/20240210T223313Z
Expand All @@ -33,3 +33,5 @@ packages:
- "perl"
# test cacerts() compatibility
- "ca-certificates"
# test multiple components: contrib
- "nvidia-kernel-common"
1 change: 1 addition & 0 deletions e2e/smoke/test_linux_amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ commandTests:
- ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\]
- perl/now 5\.32\.1-4\+deb11u3 amd64 \[installed,local\]
- tzdata/now 2024a-0\+deb11u1 all \[installed,local\]
- nvidia-kernel-common/now 20151021\+13 amd64 \[installed,local\]
- name: "whoami"
command: "whoami"
expectedOutput: [r00t]
Expand Down
1 change: 1 addition & 0 deletions e2e/smoke/test_linux_arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ commandTests:
- ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\]
- perl/now 5\.32\.1-4\+deb11u3 arm64 \[installed,local\]
- tzdata/now 2024a-0\+deb11u1 all \[installed,local\]
- nvidia-kernel-common/now 20151021\+13 arm64 \[installed,local\]
- name: "whoami"
command: "whoami"
expectedOutput: [r00t]
Expand Down
1 change: 1 addition & 0 deletions examples/debian_snapshot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ PACKAGES = [
"@bullseye//apt",
"@bullseye//perl",
"@bullseye//openssl",
"@bullseye//nvidia-kernel-common",
]

# Creates /var/lib/dpkg/status with installed package information.
Expand Down
18 changes: 18 additions & 0 deletions examples/debian_snapshot/bullseye.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,15 @@
"url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_amd64.deb",
"version": "1.1.1w-0+deb11u1"
},
{
"arch": "amd64",
"dependencies": [],
"key": "nvidia-kernel-common_20151021-p-13_amd64",
"name": "nvidia-kernel-common",
"sha256": "fa4b007bf64cf8cf0e9b3aaae5dd388fcec3a589ce2475f16d64347945691533",
"url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_amd64.deb",
"version": "20151021+13"
},
{
"arch": "arm64",
"dependencies": [],
Expand Down Expand Up @@ -2379,6 +2388,15 @@
"sha256": "d9159af073e95641e7eda440fa1d7623873b8c0034c9826a353f890bed107f3c",
"url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_arm64.deb",
"version": "1.1.1w-0+deb11u1"
},
{
"arch": "arm64",
"dependencies": [],
"key": "nvidia-kernel-common_20151021-p-13_arm64",
"name": "nvidia-kernel-common",
"sha256": "5a1f10cffc5407a6b63dcdf3f72af842ad9e39a808bb9418a4805aa0be345c65",
"url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_arm64.deb",
"version": "20151021+13"
}
],
"version": 1
Expand Down
4 changes: 3 additions & 1 deletion examples/debian_snapshot/bullseye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version: 1

sources:
- channel: bullseye main
- channel: bullseye main contrib
url: https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z
- channel: bullseye-security main
url: https://snapshot-cloudflare.debian.org/archive/debian-security/20240210T223313Z
Expand All @@ -33,3 +33,5 @@ packages:
- "perl"
# test cacerts() compatibility
- "ca-certificates"
# test multiple components: contrib
- "nvidia-kernel-common"
1 change: 1 addition & 0 deletions examples/debian_snapshot/test_linux_amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ commandTests:
- ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\]
- perl/now 5\.32\.1-4\+deb11u3 amd64 \[installed,local\]
- tzdata/now 2024a-0\+deb11u1 all \[installed,local\]
- nvidia-kernel-common/now 20151021\+13 amd64 \[installed,local\]
- name: "whoami"
command: "whoami"
expectedOutput: [r00t]
Expand Down
1 change: 1 addition & 0 deletions examples/debian_snapshot/test_linux_arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ commandTests:
- ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\]
- perl/now 5\.32\.1-4\+deb11u3 arm64 \[installed,local\]
- tzdata/now 2024a-0\+deb11u1 all \[installed,local\]
- nvidia-kernel-common/now 20151021\+13 arm64 \[installed,local\]
- name: "whoami"
command: "whoami"
expectedOutput: [r00t]
Expand Down
Loading