Skip to content

Commit

Permalink
publish-tdl.yml: Move to centos:7 devtoolset-9
Browse files Browse the repository at this point in the history
Move from prebuild/centos7-devtoolset7 to centos:7 with devtoolset-9
(the same version Holy Build Box uses, which is used in prebuilt-tdlib).
This image has a newer gcc version, hopefully fixing a compilation error
that was present with gcc 7.

Note: We don't link libstdc++ statically to reduce the binary size
(about 1.1M with statically linked libstdc++) and consequently the npm
package size. This is the same as before this commit, since
prebuildify-cross links libstdc++ dynamically as well.
  • Loading branch information
eilvelia committed Oct 7, 2023
1 parent e2420ca commit efa3623
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/publish-tdl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,28 @@ jobs:
run: npm install
- name: Clean old binaries
run: npm run clean -w tdl
# prebuildify-cross doesn't work with npm workspaces
- name: Prebuildify in docker
if: runner.os == 'Linux'
run: |
docker run -u root -v $(pwd):/app ghcr.io/prebuild/centos7-devtoolset7:2 \
npm run make-prebuild -w tdl -- --tag-libc
tree packages/tdl
# docker run -u root -v $(pwd):/app ghcr.io/prebuild/centos7-devtoolset7:2 \
# npm run make-prebuild -w tdl -- --tag-libc
cat > prebuilt-node-addon.sh <<EOF
set -ex
yum update -y
yum search devtoolset
yum install -y centos-release-scl devtoolset-9 make python3
yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
source /opt/rh/devtoolset-9/enable
gcc --version
ldd --version
cd /app
npm run make-prebuild -w tdl -- --tag-libc
EOF
docker run -v $(pwd):/app centos:7 \
bash /app/prebuilt-node-addon.sh
ldd packages/tdl/prebuilds/*/*.node
du -hs packages/tdl/prebuilds/*/*.node
- name: Prebuildify
if: runner.os != 'Linux'
run: npm run make-prebuild -w tdl
Expand Down

0 comments on commit efa3623

Please sign in to comment.