Skip to content

Commit 0459047

Browse files
committed
Check that all Linux executables are statically linked
1 parent c38a47e commit 0459047

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

scripts/moveArtifacts.sh

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33

4+
check_statically_linked() {
5+
local dir=$1
6+
local all_statically_linked=true
7+
8+
for file in "$dir"/*; do
9+
if [ -f "$file" ]; then
10+
if file "$file" | grep -Eq "statically linked|static-pie linked"; then
11+
echo "$file is statically linked."
12+
else
13+
echo "$file is NOT statically linked."
14+
all_statically_linked=false
15+
fi
16+
fi
17+
done
18+
19+
if $all_statically_linked; then
20+
echo "All files in $dir are statically linked executables."
21+
else
22+
echo "Error: Not all files in $dir are statically linked executables."
23+
exit 1
24+
fi
25+
}
26+
427
chmod +x binaries-*/*.exe
528

629
mv binaries-darwin darwin
@@ -11,3 +34,7 @@ mv binaries-win32 win32
1134

1235
mv lib-ocaml lib/ocaml
1336
mv ninja/COPYING ninja.COPYING
37+
38+
check_statically_linked "linux"
39+
check_statically_linked "linuxarm64"
40+

0 commit comments

Comments
 (0)