docker: Add conditions to set assert_linkage for Dockerfile.install

ci: Check packages when using test branch.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-11-22 01:54:46 +00:00
parent 11c4cbf54e
commit deb5c65885
3 changed files with 13 additions and 5 deletions

View File

@@ -15,15 +15,17 @@ ENV src_path="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}/tuwunel
ENV dst_path="${install_prefix}/bin/tuwunel"
COPY --from=bins $src_path $dst_path
RUN <<EOF
ret=$(ldd "${dst_path}")
ldd -v "${dst_path}"
ret=$?
if [ "$ret" = "0" ] && [ "$assert_linkage" = "static" ]; then
echo "($ret) expected a static binary"
exit 1
elif [ "$ret" != "0" ] && [ "$assert_linkage" = "dynamic" ]; then
echo "($ret) expected a dynamic binary"
exit 1
fi
set -eux
ldd -v ${dst_path} || true
du -h ${dst_path}
sha1sum ${dst_path}
du -h "${dst_path}"
sha1sum "${dst_path}"
EOF

View File

@@ -868,6 +868,12 @@ target "install" {
}
args = {
install_prefix = install_prefix
assert_linkage = (
substr(cargo_profile, 0, 5) == "bench"? "static":
substr(cargo_profile, 0, 7) == "release"? "static":
substr(rust_toolchain, 0, 6) == "stable"? "static":
""
)
}
}