File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090 run : |
9191 cargo build --release --locked --target ${{ matrix.target }}
9292
93+ - name : Verify dynamic dependencies (unix)
94+ if : runner.os != 'Windows'
95+ shell : bash
96+ run : |
97+ set -euxo pipefail
98+ BIN="target/${{ matrix.target }}/release/sshpod"
99+ chmod +x ./scripts/check-dynamic-deps.sh
100+ ./scripts/check-dynamic-deps.sh "$BIN"
101+
93102 - name : Package (unix)
94103 if : runner.os != 'Windows'
95104 id : package_unix
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ whoami = "1"
1414log = " 0.4"
1515env_logger = " 0.11"
1616flate2 = " 1"
17- xz2 = " 0.1"
17+ xz2 = { version = " 0.1" , features = [ " static " ] }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ if [[ $# -ne 1 ]]; then
5+ echo " usage: $0 <binary>" >&2
6+ exit 2
7+ fi
8+
9+ bin=" $1 "
10+
11+ if [[ ! -f " $bin " ]]; then
12+ echo " binary not found: $bin " >&2
13+ exit 2
14+ fi
15+
16+ case " $( uname -s) " in
17+ Darwin)
18+ unexpected=0
19+ while IFS= read -r dep; do
20+ [[ -z " $dep " ]] && continue
21+ case " $dep " in
22+ /System/Library/* |/usr/lib/* )
23+ ;;
24+ * )
25+ echo " unexpected dynamic dependency: $dep " >&2
26+ unexpected=1
27+ ;;
28+ esac
29+ done < <( otool -L " $bin " | tail -n +2 | awk ' {print $1}' )
30+ exit " $unexpected "
31+ ;;
32+ Linux)
33+ unexpected=0
34+ while IFS= read -r dep; do
35+ [[ -z " $dep " ]] && continue
36+ case " $dep " in
37+ libc.so.* |libgcc_s.so.* |libm.so.* |libpthread.so.* |librt.so.* |libdl.so.* |libutil.so.* |libresolv.so.* |libanl.so.* |libnsl.so.* |ld-linux-* .so.* |ld64.so.* )
38+ ;;
39+ * )
40+ echo " unexpected dynamic dependency: $dep " >&2
41+ unexpected=1
42+ ;;
43+ esac
44+ done < <( readelf -d " $bin " | sed -n ' s/.*Shared library: \[\(.*\)\]/\1/p' )
45+ exit " $unexpected "
46+ ;;
47+ * )
48+ echo " unsupported host OS: $( uname -s) " >&2
49+ exit 2
50+ ;;
51+ esac
You can’t perform that action at this time.
0 commit comments