-
Notifications
You must be signed in to change notification settings - Fork 0
480 lines (447 loc) · 21.4 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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# This is the continuous integration job for `scribbu`. It will run on
# both MacOS & Ubuntu, using various versions of `boost`. I'd also
# like to try installing & building against multple `gcc` versions.
# The intent here is get as many lints & checks as possible out of my
# personal checklist & into automation, being run every night.
name: Continuous Integration
on:
workflow_dispatch:
push:
pull_request:
types: [opened, edited, reopened] # don't say `synchronize`-- that is taken care of by `push`
schedule:
- cron: '01 02 * * *'
jobs:
build:
name: build
strategy:
matrix:
os: [macos-12, ubuntu-22.04]
boost: [oldest, pinned, latest]
include:
- os: macos-12
boost: oldest
boost-ver: 1_63_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.63.0/source/boost_1_63_0.tar.bz2
- os: macos-12
boost: pinned
boost-ver: 1_74_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2
- os: macos-12
boost: latest
boost-ver: 1_82_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2
- os: ubuntu-22.04
boost: oldest
boost-ver: 1_63_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.63.0/source/boost_1_63_0.tar.bz2
- os: ubuntu-22.04
boost: pinned
boost-ver: 1_74_0
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2
- os: ubuntu-22.04
boost: latest
boost-ver: latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check for TODO-s left in code
shell: bash
run: |
set -x
if find . -not -path '*/.git/*' -not -name 'tbt-lexer.cc' -not -name 'tbt-lexer.hh' '(' -iname '*.hh' -or -iname '*cc' ')' -print0 | xargs -0 -e grep -nE 'TODO|TOOD|\\todo|\\tood'; then
echo "You have TODO-s"
exit 1
fi
- name: Get build number
shell: bash
run: |
set -x
pwd
version=`awk '/^AC_INIT/ {print substr($2, 2, length($2)-3)}' configure.ac`
echo "Building scribbu version $version."
echo "SCRIBBU_BUILD_NUMBER=${version}" >> $GITHUB_ENV
- name: Install pre-requisites (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
set -x
pwd
sudo apt-get update
sudo apt-get install -y autoconf automake libtool openssl guile-3.0-dev doxygen flex bison graphviz libunistring-dev texlive tzdata locales
- name: Install pre-requisites (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
# This seems wrong on multiple levels, but see here:
# <https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6339258>
set +e
pwd
brew cleanup
# Will exit with non-zero status if it finds problems, but can be handy
# for trouble-shooting:
brew doctor
brew update
brew upgrade
brew install autoconf automake libtool openssl doxygen flex bison graphviz texinfo
brew install --cask basictex
type -p guile || brew install guile
set -e
- name: Cache boost (Ubuntu)
# On Ubuntu, we install "pinned" & "latest" directly from the packages.
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
id: cache-boost-ubuntu
uses: actions/cache@v2
with:
path: boost_${{ matrix.boost-ver }}/installdir
key: ${{ runner.os }}-${{ matrix.boost-ver }}
- name: Cache boost (MacOS)
if: matrix.os == 'macos-12'
id: cache-boost-macos
uses: actions/cache@v2
with:
path: boost_${{ matrix.boost-ver }}/installdir
key: ${{ runner.os }}-${{ matrix.boost-ver }}
- name: Install boost (Ubuntu, latest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
run: |
set -x
pwd
sudo apt-get install -y libboost-all-dev
- name: Install boost (Ubuntu, pinned)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'pinned'
shell: bash
run: |
set -x
pwd
sudo apt-get install -y libboost1.74-all-dev
- name: Get boost (Ubuntu, oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest' && steps.cache-boost-ubuntu.outputs.cache-hit != 'true'
run: |
set -x
pwd
curl -L -o boost_${{ matrix.boost-ver }}.tar.bz2 ${{ matrix.boost-dl }}
md5sum boost_${{ matrix.boost-ver }}.tar.bz2
tar xf boost_${{ matrix.boost-ver }}.tar.bz2
cd boost_${{ matrix.boost-ver }}
mkdir installdir
# libboost_python fails for boost 1.58.0-- I don't need it, so didn't bother debugging it
./bootstrap.sh --prefix=./installdir --without-libraries=python || cat bootstrap.log
./b2 && ./b2 install
- name: Get boost (MacOS)
if: matrix.os == 'macos-12' && steps.cache-boost-macos.outputs.cache-hit != 'true'
run: |
set -x
pwd
curl -L -o boost_${{ matrix.boost-ver }}.tar.bz2 ${{ matrix.boost-dl }}
ls -l boost_${{ matrix.boost-ver }}.tar.bz2
md5 boost_${{ matrix.boost-ver }}.tar.bz2
cc --version
tar xf boost_${{ matrix.boost-ver }}.tar.bz2
mkdir boost_${{ matrix.boost-ver }}/installdir
- name: Patch boost source (MacOS)
if: matrix.os == 'macos-12' && steps.cache-boost-macos.outputs.cache-hit != 'true' && matrix.boost == 'oldest'
run: |
cd boost_${{ matrix.boost-ver }}/tools/build/src/engine
cp build.sh build.sh.bak
awk '/darwin\)/{print; print " BOOST_JAM_OPT_JAM=\"$BOOST_JAM_OPT_JAM $CFLAGS $LIBS\""; next }1' build.sh > build.sh.tmp
mv build.sh.tmp build.sh
chmod a+x build.sh
# cat build.sh
cp execcmd.c execcmd.c.bak
awk '/#include "execcmd.h"/{print; print "#include \"output.h\""; next }1' execcmd.c > execcmd.c.tmp
mv execcmd.c.tmp execcmd.c
# cat execcmd.c
cp make.c make.c.bak
awk '/#include "make.h"/{print; print "#include \"output.h\""; next }1' make.c > make.c.tmp
mv make.c.tmp make.c
# cat make.c
cp filesys.c filesys.c.bak
awk '/#include "filesys.h"/{print; print "int filelist_empty( FILELIST * list );"; next }1' filesys.c > filesys.c.tmp
mv filesys.c.tmp filesys.c
# cat filesys.c
cp modules/path.c modules/path.c.bak
awk '/#include "..\/timestamp.h"/{print; print "#include \"../filesys.h\""; next }1' modules/path.c > modules/path.c.tmp
mv modules/path.c.tmp modules/path.c
# cat modules/path.c
cp fileunix.c fileunix.c.bak
awk '/#include "jam.h"/{print; print "int filelist_empty( FILELIST * list );"; next }1' fileunix.c > fileunix.c.tmp
awk '/#include "jam.h"/{print; print "#include \"filesys.h\""; next }1' fileunix.c.tmp > fileunix.c.tmp.1
awk '/#include "filesys.h"/{print; print "int file_collect_archive_content_( file_archive_info_t * const archive );"; next }1' fileunix.c.tmp.1 > fileunix.c
# cat fileunix.c
cd ../tools
cp darwin.jam darwin.jam.bak
head -n138 darwin.jam > darwin.jam.tmp
tail -n +145 darwin.jam >> darwin.jam.tmp
mv darwin.jam.tmp darwin.jam
- name: Build boost (MacOS)
if: matrix.os == 'macos-12' && steps.cache-boost-macos.outputs.cache-hit != 'true'
shell: bash
run: |
pwd
set -x
cd boost_${{ matrix.boost-ver }}
pwd
ls
export CFLAGS="-Wno-error=implicit-function-declaration"
./bootstrap.sh --prefix=./installdir || { cat bootstrap.log; exit 1; }
./b2
./b2 install
- name: Patch boost library dependencies (MacOS, non-oldest)
if: matrix.os == 'macos-12' && matrix.boost != 'oldest' # && steps.cache-boost-macos.outputs.cache-hit != 'true'
run: |
cd boost_${{ matrix.boost-ver }}/installdir/lib
pwd
ls
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
echo ================================================
here=$(pwd)
install_name_tool -change @rpath/libboost_atomic.dylib ${here}/libboost_atomic.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_chrono.dylib ${here}/libboost_chrono.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_filesystem.dylib ${here}/libboost_filesystem.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_thread.dylib ${here}/libboost_thread.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_date_time.dylib ${here}/libboost_date_time.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_regex.dylib ${here}/libboost_regex.dylib libboost_log.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_chrono.dylib
install_name_tool -change @rpath/libboost_system.dylib ${here}/libboost_system.dylib libboost_thread.dylib
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
echo ================================================
- name: Patch boost library dependencies (MacOS, oldest)
if: matrix.os == 'macos-12' && matrix.boost == 'oldest' # && steps.cache-boost-macos.outputs.cache-hit != 'true'
run: |
cd boost_${{ matrix.boost-ver }}/installdir/lib
pwd
ls
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
otool -L libboost_unit_test_framework.dylib
otool -L libboost_timer.dylib
echo ================================================
here=$(pwd)
install_name_tool -change libboost_atomic.dylib ${here}/libboost_atomic.dylib libboost_log.dylib
install_name_tool -change libboost_chrono.dylib ${here}/libboost_chrono.dylib libboost_log.dylib
install_name_tool -change libboost_filesystem.dylib ${here}/libboost_filesystem.dylib libboost_log.dylib
install_name_tool -change libboost_thread.dylib ${here}/libboost_thread.dylib libboost_log.dylib
install_name_tool -change libboost_date_time.dylib ${here}/libboost_date_time.dylib libboost_log.dylib
install_name_tool -change libboost_system.dylib ${here}/libboost_system.dylib libboost_log.dylib
install_name_tool -change libboost_regex.dylib ${here}/libboost_regex.dylib libboost_log.dylib
install_name_tool -change libboost_system.dylib ${here}/libboost_system.dylib libboost_chrono.dylib
install_name_tool -change libboost_system.dylib ${here}/libboost_system.dylib libboost_thread.dylib
install_name_tool -change libboost_timer.dylib ${here}/libboost_timer.dylib libboost_unit_test_framework.dylib
install_name_tool -change libboost_chrono.dylib ${here}/libboost_chrono.dylib libboost_timer.dylib
echo ================================================
otool -L libboost_log.dylib
otool -L libboost_chrono.dylib
otool -L libboost_thread.dylib
otool -L libboost_unit_test_framework.dylib
otool -L libboost_timer.dylib
echo ================================================
- name: Configure scribbu (Ubuntu, oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
./configure --with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd)
- name: Configure scribbu (Ubuntu, non-oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
./configure
- name: Configure scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
autoconf --version
automake --version
set -x
pwd
ls
./bootstrap
eval "$(/usr/libexec/path_helper)"
PATH="/usr/local/opt/bison/bin:/usr/local/opt/texinfo/bin:$PATH" ./configure --with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd) --with-openssl=/usr/local/opt/openssl CPPFLAGS="-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -I/usr/local/opt/[email protected]/include" LDFLAGS="-L/usr/local/opt/[email protected]/lib"
- name: Make scribbu (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
set -x
pwd
make -j 4
- name: Make scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
pwd
eval "$(/usr/libexec/path_helper)"
PATH="/usr/local/opt/bison/bin:/usr/local/opt/texinfo/bin:$PATH" make -j 4
- name: Patch boost binary dependencies (MacOS, oldest)
if: matrix.os == 'macos-12' && matrix.boost == 'oldest'
shell: bash
run: |
set -x
pwd
echo "===================================="
otool -L src/.libs/scribbu
echo "===================================="
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change libboost_iostreams.dylib ${there}/libboost_iostreams.dylib src/.libs/scribbu
install_name_tool -change libboost_log.dylib ${there}/libboost_log.dylib src/.libs/scribbu
install_name_tool -change libboost_program_options.dylib ${there}/libboost_program_options.dylib src/.libs/scribbu
install_name_tool -change libboost_regex.dylib ${there}/libboost_regex.dylib src/.libs/scribbu
install_name_tool -change libboost_system.dylib ${there}/libboost_system.dylib src/.libs/scribbu
there=$(cd scribbu/.libs; pwd)
echo "Changing the load location for scribbu lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib src/.libs/scribbu
echo "===================================="
otool -L src/.libs/scribbu
src/.libs/scribbu --version
echo "===================================="
cd test && make unit
echo "===================================="
otool -L .libs/unit
echo "===================================="
there=$(cd ../boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change libboost_iostreams.dylib ${there}/libboost_iostreams.dylib .libs/unit
install_name_tool -change libboost_log.dylib ${there}/libboost_log.dylib .libs/unit
install_name_tool -change libboost_program_options.dylib ${there}/libboost_program_options.dylib .libs/unit
install_name_tool -change libboost_regex.dylib ${there}/libboost_regex.dylib .libs/unit
install_name_tool -change libboost_system.dylib ${there}/libboost_system.dylib .libs/unit
install_name_tool -change libboost_unit_test_framework.dylib ${there}/libboost_unit_test_framework.dylib .libs/unit
there=$(cd ../scribbu/.libs; pwd)
echo "Changing the load location for unit lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib .libs/unit
echo "===================================="
otool -L .libs/unit
.libs/unit --help
- name: Patch boost binary dependencies (MacOS, non-oldest)
if: matrix.os == 'macos-12' && matrix.boost != 'oldest'
shell: bash
run: |
set -x
pwd
echo "===================================="
otool -L src/.libs/scribbu
echo "===================================="
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change @rpath/libboost_iostreams.dylib ${there}/libboost_iostreams.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_log.dylib ${there}/libboost_log.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_program_options.dylib ${there}/libboost_program_options.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_regex.dylib ${there}/libboost_regex.dylib src/.libs/scribbu
install_name_tool -change @rpath/libboost_system.dylib ${there}/libboost_system.dylib src/.libs/scribbu
there=$(cd scribbu/.libs; pwd)
echo "Changing the load location for scribbu lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib src/.libs/scribbu
echo "===================================="
otool -L src/.libs/scribbu
src/.libs/scribbu --version
echo "===================================="
cd test && make unit
echo "===================================="
otool -L .libs/unit
echo "===================================="
there=$(cd ../boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
echo "Changing the load location for boost libs to ${there}."
install_name_tool -change @rpath/libboost_iostreams.dylib ${there}/libboost_iostreams.dylib .libs/unit
install_name_tool -change @rpath/libboost_log.dylib ${there}/libboost_log.dylib .libs/unit
install_name_tool -change @rpath/libboost_program_options.dylib ${there}/libboost_program_options.dylib .libs/unit
install_name_tool -change @rpath/libboost_regex.dylib ${there}/libboost_regex.dylib .libs/unit
install_name_tool -change @rpath/libboost_system.dylib ${there}/libboost_system.dylib .libs/unit
install_name_tool -change @rpath/libboost_unit_test_framework.dylib ${there}/libboost_unit_test_framework.dylib .libs/unit
there=$(cd ../scribbu/.libs; pwd)
echo "Changing the load location for unit lib to be ${there}."
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib .libs/unit
echo "===================================="
otool -L .libs/unit
.libs/unit --help
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
- name: Test scribbu (Ubuntu, oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
shell: bash
run: |
set -x
pwd
here=$(pwd)
ldd scribbu/.libs/libscribbu.so
find ${here}/boost_${{ matrix.boost-ver }}/installdir -iname '*.so'
export LD_LIBRARY_PATH="${here}/boost_${{ matrix.boost-ver }}/installdir/lib:$LD_LIBRARY_PATH"
pwd
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test scribbu (Ubuntu, non-oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
shell: bash
run: |
set -x
pwd
ldd scribbu/.libs/libscribbu.so
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test scribbu (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
pwd
if ! make check; then
cat test/test-suite.log
exit 1
fi
- name: Test the Autotools distribution (Ubuntu, oldest)
# I only make the Autotools distro on Ubuntu, so just test there
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
shell: bash
run: |
set -x
pwd
ls
here=$(pwd)
version=${{ env.SCRIBBU_BUILD_NUMBER }}
export DISTCHECK_CONFIGURE_FLAGS="--with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd)"
export LD_LIBRARY_PATH="${here}/boost_${{ matrix.boost-ver }}/installdir/lib:$LD_LIBRARY_PATH"
if ! make -j 4 distcheck; then
cat test/test-suite.log
test -f scribbu-${version}/_build/sub/test/test-suite.log && \
cat scribbu-${version}/_build/sub/test/test-suite.log
exit 1
fi
- name: Test the Autotools distribution (Ubuntu, non-oldest)
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
shell: bash
run: |
pwd
make -j 4 distcheck
# Given that I had to move heaven & earth to get `make check` to
# work on MacOS, I'm going to hold-off on `make distcheck` until I
# want to really support MacOS, or someone asks for it... or
# something.