Skip to content

Commit 44b8d25

Browse files
committed
build-sys: Add made up binary-dependencies key
This would be a nice thing to try to standardize, but let's just keep track of this and use it in our CI install flow too. This helps us be cross distribution a bit more. Signed-off-by: Colin Walters <[email protected]>
1 parent 6a2b7e0 commit 44b8d25

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ exclude-crate-paths = [ { name = "libz-sys", exclude = "src/zlib" },
7070
{ name = "k8s-openapi", exclude = "src/v1_27" },
7171
]
7272

73+
# This is an made up key for external binary dependencies.
74+
# setpriv is a proxy for util-linux, and systemctl is a proxy for systemd.
75+
[workspace.metadata.binary-dependencies]
76+
bins = ["skopeo", "podman", "ostree", "zstd", "setpriv", "systemctl"]
77+
7378
[workspace.lints.rust]
7479
# Require an extra opt-in for unsafe
7580
unsafe_code = "deny"

ci/installdeps.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ enabled=1
2424
enabled_metadata=1
2525
EOF
2626

27-
# Our tests depend on this
28-
dnf -y install skopeo zstd
29-
27+
# TODO: Recursively extract this from the existing cargo system-deps metadata
3028
case $OS_ID in
3129
fedora) dnf -y builddep bootc ;;
3230
*) dnf -y install libzstd-devel openssl-devel ostree-devel cargo ;;
3331
esac
32+
33+
bindeps=$(cargo metadata --format-version 1 --no-deps | jq -r '.metadata.["binary-dependencies"].bins | map("/usr/bin/" + .) | join(" ")')
34+
dnf -y install $bindeps

0 commit comments

Comments
 (0)