-
Notifications
You must be signed in to change notification settings - Fork 0
265 lines (235 loc) · 10.4 KB
/
Copy pathlibinstruments.yml
File metadata and controls
265 lines (235 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
name: libinstruments CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
OPENSSL_COMMIT: ac3cef223a4c61d6bee34527b6d4c8c6432494a7
LIBPLIST_COMMIT: 15164ebe870590376b2286b09dc97890a07dd373
LIBIMOBILEDEVICE_GLUE_COMMIT: da770a7687f35fbb981db4d7b47b1b032cd5c2c7
LIBUSBMUXD_COMMIT: 93eb168bf6b07472d17781328c21df0c60300524
LIBTATSU_COMMIT: 60a39f36d719344360ec2e87563ed43f61f0530f
LIBIMOBILEDEVICE_COMMIT: c4f111800d2b08d6c65ec075ad49c4a60e9e4309
PICOTLS_COMMIT: 5a4461d8a3948d9d26bf861e7d90cb80d8093515
PICOQUIC_COMMIT: 3335f4029b55f59a4868cacf3e92c3fb84982115
LWIP_COMMIT: 4599f551dead9eac233b91c0b9ee5879f5d0620a
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
name: Linux
quic: false
- os: windows-latest
name: Windows
quic: false
- os: ubuntu-22.04
name: Linux (QUIC)
quic: true
- os: windows-latest
name: Windows (QUIC)
quic: true
runs-on: ${{ matrix.os }}
name: Build on ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
# ── Cache built dependencies ──────────────────────────────────────────
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/deps
key: ${{ runner.os }}-deps-${{ env.OPENSSL_COMMIT }}-${{ env.LIBPLIST_COMMIT }}-${{ env.LIBIMOBILEDEVICE_GLUE_COMMIT }}-${{ env.LIBTATSU_COMMIT }}-${{ env.LIBUSBMUXD_COMMIT }}-${{ env.LIBIMOBILEDEVICE_COMMIT }}
# ── Linux: build tools ────────────────────────────────────────────────
- name: Install Linux build tools
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y \
cmake ninja-build pkg-config \
autoconf automake libtool perl \
libcurl4-openssl-dev
# ── Windows: MSYS2 setup ──────────────────────────────────────────────
- name: Set up MSYS2 (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-curl
autoconf
automake
libtool
perl
# ── Build all iMobileDevice dependencies from source (Linux) ─────────
- name: Build dependencies (Linux)
if: runner.os == 'Linux' && steps.cache-deps.outputs.cache-hit != 'true'
run: |
set -e
DEPS=${{ github.workspace }}/deps
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
# OpenSSL 1.1.1
git clone https://github.com/openssl/openssl /tmp/openssl
git -C /tmp/openssl checkout ${{ env.OPENSSL_COMMIT }}
cd /tmp/openssl
./config --prefix=$DEPS --openssldir=$DEPS/ssl no-tests no-shared
make -j$(nproc)
make install_sw
# libplist
git clone https://github.com/libimobiledevice/libplist /tmp/libplist
git -C /tmp/libplist checkout ${{ env.LIBPLIST_COMMIT }}
cd /tmp/libplist
./autogen.sh --prefix=$DEPS --without-cython
make -j$(nproc) && make install
# libimobiledevice-glue
git clone https://github.com/libimobiledevice/libimobiledevice-glue /tmp/libimobiledevice-glue
git -C /tmp/libimobiledevice-glue checkout ${{ env.LIBIMOBILEDEVICE_GLUE_COMMIT }}
cd /tmp/libimobiledevice-glue
./autogen.sh --prefix=$DEPS
make -j$(nproc) && make install
# libtatsu
git clone https://github.com/libimobiledevice/libtatsu /tmp/libtatsu
git -C /tmp/libtatsu checkout ${{ env.LIBTATSU_COMMIT }}
cd /tmp/libtatsu
./autogen.sh --prefix=$DEPS
make -j$(nproc) && make install
# libusbmuxd
git clone https://github.com/libimobiledevice/libusbmuxd /tmp/libusbmuxd
git -C /tmp/libusbmuxd checkout ${{ env.LIBUSBMUXD_COMMIT }}
cd /tmp/libusbmuxd
./autogen.sh --prefix=$DEPS
make -j$(nproc) && make install
# libimobiledevice
git clone https://github.com/libimobiledevice/libimobiledevice /tmp/libimobiledevice
git -C /tmp/libimobiledevice checkout ${{ env.LIBIMOBILEDEVICE_COMMIT }}
cd /tmp/libimobiledevice
./autogen.sh --prefix=$DEPS --without-cython --enable-openssl \
OPENSSL_CFLAGS="-I$DEPS/include" OPENSSL_LIBS="-L$DEPS/lib -lssl -lcrypto"
make -j$(nproc) && make install
# ── Build all iMobileDevice dependencies from source (Windows) ───────
- name: Build dependencies (Windows)
if: runner.os == 'Windows' && steps.cache-deps.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
set -e
DEPS="$(cygpath -u '${{ github.workspace }}')/deps"
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
# OpenSSL 1.1.1
git clone https://github.com/openssl/openssl /tmp/openssl
git -C /tmp/openssl checkout ${{ env.OPENSSL_COMMIT }}
cd /tmp/openssl
./Configure mingw64 --prefix=$DEPS --openssldir=$DEPS/ssl no-tests no-shared
make -j$(nproc)
make install_sw
# libplist
git clone https://github.com/libimobiledevice/libplist /tmp/libplist
git -C /tmp/libplist checkout ${{ env.LIBPLIST_COMMIT }}
cd /tmp/libplist
./autogen.sh --prefix=$DEPS --without-cython --host=x86_64-w64-mingw32
make -j$(nproc) && make install
# libimobiledevice-glue
git clone https://github.com/libimobiledevice/libimobiledevice-glue /tmp/libimobiledevice-glue
git -C /tmp/libimobiledevice-glue checkout ${{ env.LIBIMOBILEDEVICE_GLUE_COMMIT }}
cd /tmp/libimobiledevice-glue
./autogen.sh --prefix=$DEPS --host=x86_64-w64-mingw32
make -j$(nproc) && make install
# libtatsu
git clone https://github.com/libimobiledevice/libtatsu /tmp/libtatsu
git -C /tmp/libtatsu checkout ${{ env.LIBTATSU_COMMIT }}
cd /tmp/libtatsu
./autogen.sh --prefix=$DEPS --host=x86_64-w64-mingw32
make -j$(nproc) && make install
# libusbmuxd
git clone https://github.com/libimobiledevice/libusbmuxd /tmp/libusbmuxd
git -C /tmp/libusbmuxd checkout ${{ env.LIBUSBMUXD_COMMIT }}
cd /tmp/libusbmuxd
./autogen.sh --prefix=$DEPS --host=x86_64-w64-mingw32
make -j$(nproc) && make install
# libimobiledevice
git clone https://github.com/libimobiledevice/libimobiledevice /tmp/libimobiledevice
git -C /tmp/libimobiledevice checkout ${{ env.LIBIMOBILEDEVICE_COMMIT }}
cd /tmp/libimobiledevice
./autogen.sh --prefix=$DEPS --without-cython --enable-openssl \
--host=x86_64-w64-mingw32 \
OPENSSL_CFLAGS="-I$DEPS/include" OPENSSL_LIBS="-L$DEPS/lib -lssl -lcrypto"
make -j$(nproc) && make install
# ── QUIC deps: clone at pinned commits ───────────────────────────────
- name: Clone QUIC dependencies
if: matrix.quic
shell: bash
run: |
git clone https://github.com/private-octopus/picotls /tmp/picotls
git -C /tmp/picotls checkout ${{ env.PICOTLS_COMMIT }}
git -C /tmp/picotls submodule update --init --recursive
git clone https://github.com/private-octopus/picoquic /tmp/picoquic
git -C /tmp/picoquic checkout ${{ env.PICOQUIC_COMMIT }}
git clone https://github.com/lwip-tcpip/lwip /tmp/lwip
git -C /tmp/lwip checkout ${{ env.LWIP_COMMIT }}
# ── Configure & Build (Linux) ─────────────────────────────────────────
- name: Configure (Linux)
if: runner.os == 'Linux' && !matrix.quic
run: |
DEPS=${{ github.workspace }}/deps
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
cmake -B build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DINSTRUMENTS_BUILD_TOOL=ON \
-DCMAKE_PREFIX_PATH=$DEPS
- name: Configure (Linux, QUIC)
if: runner.os == 'Linux' && matrix.quic
run: |
DEPS=${{ github.workspace }}/deps
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
cmake -B build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DINSTRUMENTS_BUILD_TOOL=ON \
-DINSTRUMENTS_HAS_QUIC=ON \
-DCMAKE_PREFIX_PATH=$DEPS \
-DOPENSSL_ROOT_DIR=$DEPS \
-DPICOTLS_SOURCE_DIR=/tmp/picotls \
-DPICOQUIC_SOURCE_DIR=/tmp/picoquic \
-DLWIP_SOURCE_DIR=/tmp/lwip
- name: Build (Linux)
if: runner.os == 'Linux'
run: cmake --build build --parallel
# ── Configure & Build (Windows) ───────────────────────────────────────
- name: Configure & Build (Windows)
if: runner.os == 'Windows' && !matrix.quic
shell: msys2 {0}
run: |
DEPS="$(cygpath -u '${{ github.workspace }}')/deps"
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
cmake -B build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DINSTRUMENTS_BUILD_TOOL=ON \
-DCMAKE_PREFIX_PATH=$DEPS
cmake --build build --parallel
- name: Configure & Build (Windows, QUIC)
if: runner.os == 'Windows' && matrix.quic
shell: msys2 {0}
run: |
DEPS="$(cygpath -u '${{ github.workspace }}')/deps"
export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig
cmake -B build -S . \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DINSTRUMENTS_BUILD_TOOL=ON \
-DINSTRUMENTS_HAS_QUIC=ON \
-DCMAKE_PREFIX_PATH=$DEPS \
-DOPENSSL_ROOT_DIR=$DEPS \
-DPICOTLS_SOURCE_DIR=/tmp/picotls \
-DPICOQUIC_SOURCE_DIR=/tmp/picoquic \
-DLWIP_SOURCE_DIR=/tmp/lwip
cmake --build build --parallel