-
-
Notifications
You must be signed in to change notification settings - Fork 3k
395 lines (390 loc) · 12.6 KB
/
ci.yml
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
name: CI
on:
push:
branches:
- master
pull_request:
# schedule:
# - cron: '0 0 * * 1'
jobs:
# build-offline:
# name: linux-offline
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Building r2 without network access
# run: |
# ./preconfigure
# echo UNPLUG
# sudo rm -f /etc/resolv.conf || true
# ping av.com || true
# ./configure --with-rpath --prefix=/usr
# make -j ; sudo make install
build-oldlibs:
name: linux-acr-oldlibsbug
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setting up bad libnames
run: |
mkdir -p /tmp/fakelibs /tmp/fakeincs
for a in anal asm cons crypto flag lang parse reg search syscall util ; do touch /tmp/fakelibs/libr_$a.a ; touch /tmp/fakelibs/libr_$a.so ; done
touch /tmp/fakeincs/r_util.h
chmod 000 /tmp/fakelibs/*
export CFLAGS=-I/tmp/fakeincs/
export LDFLAGS=-L/tmp/fakelibs/
sys/install.sh
build-nocs:
name: linux-nocs
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Linting
run: sys/lint.sh
- name: Building without capstone but with ssl
env:
CFLAGS: -O0
run: |
cp -f dist/plugins-cfg/plugins.nocs.cfg plugins.cfg
./configure --without-capstone --with-rpath --with-ssl && make -j
sudo make install
- name: Running c/m with self-hosted libmagic
run:
time r2 -a gb -e search.verbose=false -qc/m test/bins/mach0/ls-m1 > /tmp/m.1 2>&1 || true
cat /tmp/m.1
- name: Uninstall test
run: |
sudo make uninstall
- name: Building with libmagic
env:
CFLAGS: -O0
run: |
sudo apt update
sudo apt install -y libmagic-dev
git clean -xdf ; rm -rf shlr/capstone
cp -f dist/plugins-cfg/plugins.nocs.cfg plugins.cfg
./configure --with-sysmagic --without-capstone --with-rpath && make -j
sudo make install
- name: Running c/m with system libmagic
run:
time r2 -a gb -e search.verbose=false -qc/m test/bins/mach0/ls-m1 > /tmp/m.2 2>&1 || true
cat /tmp/m.2
- name: Compare magic times and results
run: |
echo ===== m.1
cat /tmp/m.1
echo ===== m.2
cat /tmp/m.2
build-acr-gperf:
name: linux-acr-gperf
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install meson ninja r2pipe wget
sudo apt update --assume-yes
sudo apt install gperf
- name: Installing with symlinks
run: |
export CFLAGS="-O0 -Werror -Wno-unused-result -Wno-stringop-truncation"
sys/install.sh
- name: Running tests
run: r2r -o /tmp/r2r.json test/db/cmd
- uses: actions/upload-artifact@v3
with:
name: r2r.json
path: /tmp/r2r.json
# TODO: Add job to build with capstone-next, for now v5 is stable
build-syscapstone:
name: linux-sys-capstone
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing capstone v5
run: |
git clone --branch v5 --single-branch --depth=1 https://github.com/capstone-engine/capstone
cd capstone && ( git log | head ) && sh make.sh && sudo make install
- name: Installing r2 with sys-capstone
run: |
export CFLAGS="-O0 -Werror -Wno-unused-result -Wno-stringop-truncation"
sys/install.sh
- name: Checking if capstone was cloned
run: if [ -d shlr/capstone ]; then echo "Capstone wasnt supposed to be cloned"; return 1; fi
build-resymlink:
name: linux-acr-resymlink
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing with symlinks
run: |
export CFLAGS="-O0 -Werror -Wno-unused-result -Wno-stringop-truncation"
sys/install.sh
- name: Uninstalling
run: sudo make uninstall
- name: Reinstalling without symlinks
run: sudo make install
linux-test:
runs-on: ubuntu-20.04
# if: contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building Radare2
run: |
pip install r2pipe wheel
export CFLAGS="-O2 -Wno-unused-result"
sys/install.sh
- name: Running tests
run: |
export LD_LIBRARY_PATH=/usr/local/lib
make tests
- uses: actions/upload-artifact@v3
with:
name: results.json
path: test/results.json
linux-static-meson:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
continue-on-error: true
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing the musl runtime
run: |
sudo apt update --assume-yes
sudo apt install musl-tools
sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf
sudo pip3 install meson ninja
- name: Static r2 build with meson
run: |
CFLAGS="-static" LDFLAGS="-static" meson --prefix=${HOME}/.local --buildtype release --default-library static build
ninja -C build && ninja -C build install
- name: meson gpl-less build
run: |
meson -Dnogpl=true build-nogpl
ninja -C build-nogpl
macos-test:
runs-on: macos-12
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install r2pipe
brew install pkg-config
- name: Building Radare2
run: export CFLAGS="-O2"; sys/install.sh
- name: Running tests
run: pip3 install r2pipe; make tests
build-rpath-linux:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: linux-rpath
continue-on-error: true
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: build and run
run: |
# test and build rpath installation
export CFLAGS=-O0
./configure --prefix=/tmp --with-rpath
make -j
make install
ldd /tmp/bin/r2
/tmp/bin/r2 -v
/tmp/bin/rabin2 -l /tmp/bin/r2
build-rpath-macos:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: macos-rpath
continue-on-error: true
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: build and run
run: |
# test and build rpath installation
export CFLAGS=-O0
./configure --prefix=/tmp --with-rpath
make -j
make install
/tmp/bin/r2 -v
/tmp/bin/rabin2 -l /tmp/bin/r2
build-spaces:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: linux-meson-spaces
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
#- name: XXX this is not possible with make Install from a directory with spaces
# run: |
# git config pull.rebase false
# git clone --depth 1 https://github.com/radareorg/radare2 "spa ces" ; cd "spa ces" ; ./sys/install.sh > /dev/null ; cd ..
# r2 -v
# - name: Install to a directory with spaces using ACR/MAKE
# run: |
# git config --global pull.rebase false
# git clone --depth 1 https://github.com/radareorg/radare2
# cd radare2
# ./configure --prefix=/usr/local; make uninstall
# ./configure --prefix=/usr; make uninstall
# ./sys/install.sh "/usr/spa ces" > /dev/null
# LD_LIBRARY_PATH="/usr/spa ces/lib" PATH="/usr/spa ces/bin:$PATH" r2 -v
# cd ..
- name: Build on a directory with spaces (meson only)
run: |
export PATH=${HOME}/.local/bin:${HOME}/Library/Python/3.9/bin:${PATH}
sudo apt-get --assume-yes install python3-wheel gperf python3-setuptools cabextract gperf
sudo pip3 install meson ninja
git config --global pull.rebase false
git clone --depth 1 . "spa ces"
cd "spa ces"
export CFLAGS="-O0 -Werror -Wno-unused-result -Wno-stringop-truncation"
meson --prefix="/tmp/r 2" build
ninja -C build
ninja -C build install
cd ..
find "/tmp/r 2"
LD_LIBRARY_PATH="/tmp/r 2/lib/x86_64-linux-gnu/" "/tmp/r 2/bin/r2" -v
linux-tinyasan-fuzz:
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building Radare2
run: |
pip install r2pipe
sudo sh -c 'echo 0 > /proc/sys/kernel/randomize_va_space'
export SANITIZE=address
sys/sanitize.sh
- name: Installing tools for the testsuite
run: sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf
- name: Running tests
run: |
export ASAN_OPTIONS="detect_leaks=0 detect_stack_use_after_return=1"
export R2R_TIMEOUT=3600
export R2R_SKIP_ARCHOS=1
export LD_LIBRARY_PATH=/usr/local/lib
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
r2r -t 3600 test/db/cmd
- name: Run fuzz tests
run: |
export ASAN_OPTIONS="detect_leaks=0 detect_stack_use_after_return=1"
export R2R_SKIP_ARCHOS=1
export R2R_TIMEOUT=3600
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
make -C test fuzz-tests
linux-asan-fuzz:
runs-on: ubuntu-20.04
continue-on-error: true
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Building Radare2
run: |
pip install r2pipe
sudo sh -c 'echo 0 > /proc/sys/kernel/randomize_va_space'
sys/sanitize.sh
- name: Installing tools for the testsuite
run: sudo apt-get --assume-yes install python3-wheel python3-setuptools cabextract gperf
- name: Running tests
run: |
export ASAN_OPTIONS="detect_leaks=0 detect_stack_use_after_return=1"
export R2R_SKIP_ARCHOS=1
export R2R_TIMEOUT=3600
export LD_LIBRARY_PATH=/usr/local/lib
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
make tests
- name: Run fuzz tests
run: |
export ASAN_OPTIONS="detect_leaks=0 detect_stack_use_after_return=1"
export R2R_TIMEOUT=3600
export R2R_SKIP_ARCHOS=1
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
make -C test fuzz-tests
w64-make:
runs-on: windows-2019
steps:
- name: Win configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee
pip install ninja r2pipe wget
- name: Build with meson + ninja
shell: cmd
run: |
call preconfigure
call configure release
call make
- name: Test executable
# continue-on-error: true
shell: cmd
run: |
cd prefix\bin
radare2 -v
- name: Test executable again
# continue-on-error: true
shell: cmd
run: |
cd prefix\bin
radare2 -qc "?e Hello" -
w32-mingw:
if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
name: w32-mingw
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compiling
run: |
export PATH=${HOME}/.local/bin:${HOME}/Library/Python/3.9/bin:${PATH}
sudo apt-get --assume-yes install python3-wheel gperf python3-setuptools cabextract gperf gcc-mingw-w64
sys/mingw32.sh
- uses: actions/upload-artifact@v3
with:
name: w32-mingw
path: radare2*.zip
w64-mingw:
name: w64-mingw
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compiling
run: |
export PATH=${HOME}/.local/bin:${HOME}/Library/Python/3.9/bin:${PATH}
sudo apt-get --assume-yes install python3-wheel gperf python3-setuptools cabextract gperf gcc-mingw-w64
sys/mingw64.sh
- uses: actions/upload-artifact@v3
with:
name: w64-mingw
path: radare2*.zip