Skip to content

Commit 995973d

Browse files
authored
Merge pull request #711 from zeromq/linux-arm-compat
ci: build Linux Arm64 binaries on Ubuntu 20 - update vcpkg baseline
2 parents 4e561cf + f74551e commit 995973d

File tree

5 files changed

+59
-51
lines changed

5 files changed

+59
-51
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
1111
runs-on: ${{ matrix.os }}
1212
# prettier-ignore
13-
name: ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }}
13+
name: ${{ matrix.os }}-${{ matrix.node_arch }}-${{ matrix.dockerfile }}-${{ matrix.distro }}-${{ matrix.base_image }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -60,7 +60,8 @@ jobs:
6060
- os: ubuntu-24.04
6161
node_arch: arm64
6262
cpp_arch: amd64_arm64
63-
distro: bookworm
63+
distro: none
64+
base_image: aminya/setup-cpp-ubuntu-gcc:20.04-1.3.0
6465
native: false
6566

6667
# Musl Alpine Arm
@@ -175,21 +176,24 @@ jobs:
175176
176177
- name: Build Linux Arm64
177178
if: ${{ matrix.distro }}
178-
uses: uraimo/run-on-arch-action@v2.8.1
179+
uses: uraimo/run-on-arch-action@v3.0.0
179180
with:
180181
arch: aarch64
181182
distro: ${{ matrix.distro }}
183+
base_image: ${{ matrix.base_image }}
182184
githubToken: ${{ github.token }}
183185
setup: |
184186
mkdir -p "${PWD}/build"
185187
dockerRunArgs: |
186188
--volume "${PWD}/build:/build"
189+
shell: /bin/bash
187190
env: |
188191
VCPKG_FORCE_SYSTEM_BINARIES: 1
189192
install: |
190193
${{ steps.read-installer-script.outputs.install_deps }}
191194
192195
run: |
196+
(test -f $HOME/.cpprc && . $HOME/.cpprc || true) && \
193197
pnpm install && \
194198
pnpm run build
195199

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ if(APPLE)
109109
endif()
110110

111111
run_vcpkg(VCPKG_URL "https://github.com/microsoft/vcpkg.git" VCPKG_REV
112-
"ee2d2a100103e0f3613c60655dcf15be7d5157b8")
112+
"608d1dbcd6969679f82b1ca6b89d58939c9b228e")
113113

114114
# Name of the project (will be the name of the plugin)
115115
project(addon LANGUAGES C CXX)

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@
7878
"overrides": {
7979
"typescript": "~4.9.5",
8080
"node-gyp": "10.0.1"
81-
}
81+
},
82+
"onlyBuiltDependencies": [
83+
"core-js",
84+
"electron"
85+
]
8286
},
8387
"files": [
8488
"CHANGELOG.md",

script/install-deps.sh

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,35 @@
22

33
set -x
44

5+
VCPKG_COMMIT="608d1dbcd6969679f82b1ca6b89d58939c9b228e"
6+
57
# Ubuntu/Debian
68
apt=$(command -v apt-get || true)
79
if [ -n "$apt" ]; then
810
apt-get update -q -y
11+
12+
# if setup-cpp not installed
13+
if [ -z "$(command -v setup-cpp || true)" ]; then
14+
apt-get install --no-install-recommends -y \
15+
bash \
16+
gnupg \
17+
ca-certificates \
18+
curl
19+
20+
# install latest nodejs
21+
mkdir -p /etc/apt/keyrings
22+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
23+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
24+
apt-get update -qq
25+
apt-get install -y --no-install-recommends nodejs
26+
27+
npx -y setup-cpp --compiler gcc --python true --cmake true --ninja true --make true --vcpkg $VCPKG_COMMIT
28+
fi
29+
930
apt-get install --no-install-recommends -y \
10-
bash \
11-
build-essential \
12-
curl \
13-
git \
14-
g++ \
15-
make \
16-
ninja-build \
17-
pkg-config \
18-
unzip \
19-
zip \
20-
python3 \
21-
tar \
22-
cmake \
23-
ninja-build \
2431
automake \
2532
autoconf \
26-
libtool \
27-
nodejs \
28-
npm
33+
libtool
2934
fi
3035

3136
# Alpine Linux
@@ -34,46 +39,41 @@ if [ -n "$apk" ]; then
3439
apk update
3540
apk add --no-cache bash build-base curl git g++ make ninja-build pkgconfig unzip zip python3 tar cmake musl-dev automake autoconf libtool nodejs npm
3641
cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
42+
43+
# vcpkg
44+
export VCPKG_FORCE_SYSTEM_BINARIES=1
45+
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
46+
cd ~/vcpkg || exit 1
47+
git checkout "$VCPKG_COMMIT"
48+
~/vcpkg/bootstrap-vcpkg.sh
49+
cd - || exit 1
3750
fi
3851

3952
# Fedora/RHEL
4053
dnf=$(command -v dnf || true)
4154
if [ -n "$dnf" ]; then
4255
dnf update -q -y
56+
57+
# if setup-cpp not installed
58+
if [ -z "$(command -v setup-cpp || true)" ]; then
59+
dnf install -y \
60+
bash \
61+
nodejs
62+
63+
npx -y setup-cpp --compiler gcc --python true --cmake true --ninja true --make true --vcpkg $VCPKG_COMMIT --git true
64+
fi
65+
4366
dnf install -y \
44-
bash \
45-
build-essential \
46-
curl \
47-
git \
48-
g++ \
49-
make \
50-
ninja-build \
51-
pkg-config \
52-
unzip \
53-
zip \
54-
python3 \
55-
tar \
56-
cmake \
57-
ninja-build \
5867
automake \
5968
autoconf \
60-
libtool \
61-
nodejs
69+
libtool
6270
fi
6371

64-
# pnpm
65-
npm i -g pnpm
66-
67-
export VCPKG_FORCE_SYSTEM_BINARIES=1
68-
69-
# vcpkg
70-
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
71-
cd ~/vcpkg || exit 1
72-
git checkout "ee2d2a100103e0f3613c60655dcf15be7d5157b8"
73-
~/vcpkg/bootstrap-vcpkg.sh
74-
cd - || exit 1
75-
7672
# zeromq
7773
cd ~/vcpkg || exit 1
74+
git checkout "$VCPKG_COMMIT" --force
7875
~/vcpkg/vcpkg install 'zeromq[draft,curve,sodium]' || (cd - || exit 1)
7976
cd - || exit 1
77+
78+
# pnpm
79+
npm i -g pnpm

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
33
"name": "zeromqjs",
44
"version-string": "6.0.8",
5-
"builtin-baseline": "ee2d2a100103e0f3613c60655dcf15be7d5157b8",
5+
"builtin-baseline": "608d1dbcd6969679f82b1ca6b89d58939c9b228e",
66
"dependencies": [
77
{
88
"name": "zeromq",

0 commit comments

Comments
 (0)