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

@@ -42,7 +42,7 @@ jobs:
publish: ${{vars.PUBLISH != 'false'}} publish: ${{vars.PUBLISH != 'false'}}
build_nix: ${{vars.BUILD_NIX != 'false'}} build_nix: ${{vars.BUILD_NIX != 'false'}}
build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || contains(github.ref, 'tags/v')}} build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || contains(github.ref, 'tags/v')}}
check_pkgs: ${{vars.CHECK_PKGS || 'false'}} check_pkgs: ${{vars.CHECK_PKGS || github.ref == 'refs/heads/test'}}
complement: ${{vars.COMPLEMENT != 'false'}} complement: ${{vars.COMPLEMENT != 'false'}}
complement_runner: 'het' complement_runner: 'het'
docker_repo: ${{vars.DOCKER_REPO}} docker_repo: ${{vars.DOCKER_REPO}}

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" ENV dst_path="${install_prefix}/bin/tuwunel"
COPY --from=bins $src_path $dst_path COPY --from=bins $src_path $dst_path
RUN <<EOF RUN <<EOF
ret=$(ldd "${dst_path}") ldd -v "${dst_path}"
ret=$?
if [ "$ret" = "0" ] && [ "$assert_linkage" = "static" ]; then if [ "$ret" = "0" ] && [ "$assert_linkage" = "static" ]; then
echo "($ret) expected a static binary"
exit 1 exit 1
elif [ "$ret" != "0" ] && [ "$assert_linkage" = "dynamic" ]; then elif [ "$ret" != "0" ] && [ "$assert_linkage" = "dynamic" ]; then
echo "($ret) expected a dynamic binary"
exit 1 exit 1
fi fi
set -eux set -eux
ldd -v ${dst_path} || true du -h "${dst_path}"
du -h ${dst_path} sha1sum "${dst_path}"
sha1sum ${dst_path}
EOF EOF

View File

@@ -868,6 +868,12 @@ target "install" {
} }
args = { args = {
install_prefix = install_prefix 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":
""
)
} }
} }