Skip to content

Commit 2d853f6

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

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-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: 7 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
@@ -27,22 +27,23 @@ runs:
2727
while IFS= read -r node_file; do
2828
if [ "$RUNNER_OS" == "macOS" ]; then
2929
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
30+
grep -Ev '^.*@rpath/libsession_util_nodejs\.node:?|^[^@\t].*\.node:|^[[:space:]]*$|^\t(/usr/lib/lib(System\.|c\+\+|objc))|/System/Library/Frameworks/(CoreFoundation|NetworkExtension|Foundation|Network)\.framework'; then
3131
bad=1
3232
fi
3333
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
34+
ldd "$node_file" | grep -Ev '(linux-vdso|ld-linux-(x86-64|armhf|aarch64)|lib(pthread|dl|rt|stdc\+\+|gcc_s|c|m))\.so'
35+
if ldd "$node_file" | grep -Ev '^.*\.node:|^[[:space:]]*$|(linux-vdso|ld-linux-(x86-64|armhf|aarch64)|lib(pthread|dl|rt|stdc\+\+|gcc_s|c|m))\.so'; then
3536
bad=1
3637
fi
3738
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"
39+
echo -e "\nDon't know how to check linked libs on $RUNNER_OS\n"
3940
exit 1
4041
fi
4142
done < <(find . -name 'libsession_util_nodejs.node')
4243
4344
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"
45+
echo -e "\nlibsession-util-nodejs links to unexpected libraries\n"
4546
exit 1
4647
fi
4748
48-
echo -e "\n\n\n\n\e[32;1mNo unexpected linked libraries found\e[0m\n\n\n"
49+
echo -e "\nNo unexpected linked libraries found\n"

0 commit comments

Comments
 (0)