fix: use file command to verify static linking in Alpine

This commit is contained in:
Marco Cadetg
2025-12-26 21:49:54 +01:00
parent 482a823239
commit 5c13f1d696
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -212,7 +212,8 @@ jobs:
- name: Verify static linking
run: |
file target/release/rustnet
ldd target/release/rustnet 2>&1 | grep -q "statically linked" || \
# Use file command to verify (ldd behaves differently inside Alpine)
file target/release/rustnet | grep -q "static-pie linked" || \
(echo "ERROR: Binary is not statically linked" && exit 1)
- name: Create release archive
+3 -2
View File
@@ -48,8 +48,9 @@ jobs:
echo "=== Size ==="
ls -lh target/release/rustnet
echo ""
# Verify it's actually static
if ldd target/release/rustnet 2>&1 | grep -q "statically linked"; then
# Verify it's actually static using file command
# (ldd behaves differently inside Alpine vs glibc systems)
if file target/release/rustnet | grep -q "static-pie linked"; then
echo "✅ Binary is statically linked!"
else
echo "❌ ERROR: Binary is NOT statically linked"