Skip to content

Commit 0e508e6

Browse files
committed
fix: enforce static builds for libsession-util-nodejs
1 parent 7441566 commit 0e508e6

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/build-binaries.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
if: ${{ matrix.is_qa == true }}
168168
uses: ./actions/sed_for_qa
169169

170-
- name: Custom build for QA if needed
170+
- name: Enforce static builds for libsession-util-nodejs
171171
uses: ./actions/enforce_static_builds
172172

173173
- name: Build
@@ -342,6 +342,9 @@ jobs:
342342
with:
343343
cache_suffix: ${{ matrix.cache_suffix }}
344344

345+
- name: Enforce static builds for libsession-util-nodejs
346+
uses: ./actions/enforce_static_builds
347+
345348
- name: Build
346349
run: pnpm run build
347350

actions/enforce_static_builds/action.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
fi
1414
1515
if ! find . -name 'libsession_util_nodejs.node' | grep -q .; then
16-
echo -e "\n\n\n\n\e[31;1mNo libsession_util_nodejs.node file found\e[0m\n\n\n"
16+
echo -e "\nNo libsession_util_nodejs.node file found\n"
1717
exit 1
1818
fi
1919
@@ -25,24 +25,27 @@ runs:
2525
bad=
2626
2727
while IFS= read -r node_file; do
28+
echo "--- Checking: $node_file ---"
2829
if [ "$RUNNER_OS" == "macOS" ]; then
30+
otool -L "$node_file"
2931
if otool -L "$node_file" | \
30-
grep -Ev '^.*\.node:|^\t(/usr/lib/lib(System\.|c\+\+|objc))|/System/Library/Frameworks/(CoreFoundation|NetworkExtension|Foundation|Network)\.framework'; then
32+
grep -Ev '\.node:|@rpath/libsession_util_nodejs|/usr/lib/libc\+\+|/usr/lib/libSystem'; then
3133
bad=1
3234
fi
3335
elif [ "$RUNNER_OS" == "Linux" ]; then
34-
if ldd "$node_file" | grep -Ev '(linux-vdso|ld-linux-(x86-64|armhf|aarch64)|lib(pthread|dl|rt|stdc\+\+|gcc_s|c|m))\.so'; then
36+
ldd "$node_file"
37+
if ldd "$node_file" | grep -Ev 'linux-vdso|ld-linux|libstdc\+\+|libgcc_s|libc\.so|libm\.so'; then
3538
bad=1
3639
fi
3740
else
38-
echo -e "\n\n\n\n\e[31;1mDon't know how to check linked libs on $RUNNER_OS\e[0m\n\n\n"
41+
echo -e "\nDon't know how to check linked libs on $RUNNER_OS\n"
3942
exit 1
4043
fi
4144
done < <(find . -name 'libsession_util_nodejs.node')
4245
4346
if [ -n "$bad" ]; then
44-
echo -e "\n\n\n\n\e[31;1mlibsession-util-nodejs links to unexpected libraries\e[0m\n\n\n"
47+
echo -e "\nlibsession-util-nodejs links to unexpected libraries\n"
4548
exit 1
4649
fi
4750
48-
echo -e "\n\n\n\n\e[32;1mNo unexpected linked libraries found\e[0m\n\n\n"
51+
echo -e "\nNo unexpected linked libraries found\n"

0 commit comments

Comments
 (0)