[ci] Fix skipping of omindextest on mingw32
[xapian.git] / .github / workflows / ci.yml
blob05d2046f957fc4c2751a9dac99bfeb88642c07fa
1 name: CI
3 # Use bash by default on all platforms.
4 defaults:
5   run:
6     shell: bash
8 on:
9   push:
10     paths-ignore:
11       - '.appveyor.yml'
12       - NEWS
13       - 'xapian-maintainer-tools/**'
14   pull_request:
15     branches: master
16     paths-ignore:
17       - '.appveyor.yml'
18       - NEWS
19       - 'xapian-maintainer-tools/**'
21   # Allows you to run this workflow manually from the Actions tab
22   workflow_dispatch:
24 jobs:
25   makedist:
26     name: 'make dist'
27     runs-on: 'ubuntu-latest'
28     env:
29       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
30     steps:
31     - name: Check out repository code
32       uses: actions/checkout@v4
33       with:
34         show-progress: false
35     - name: Install CCache
36       uses: hendrikmuhs/ccache-action@v1
37       with:
38         key: ${{ github.job }}
39     - name: Cache bootstrap tools
40       uses: actions/cache@v4
41       with:
42         path: |
43           BUILD
44           INST
45         key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles( 'bootstrap', 'patches/**' ) }}
46     - name: Install package dependencies
47       run: |
48         sudo apt-get update
49         sudo apt-get install \
50             doxygen \
51             graphviz \
52             help2man \
53             python3-docutils \
54             pngcrush \
55             python3-sphinx \
56             uuid-dev \
57             libpcre2-dev \
58             libmagic-dev \
59             lua5.4 \
60             liblua5.4-dev \
61             mono-devel \
62             python3-dev \
63             tcl \
64             tcl-dev \
65             libicu-dev \
66             pkg-config \
67             libpoppler-glib-dev \
68             libglib2.0-dev \
69             libe-book-dev \
70             libetonyek-dev \
71             libgepub-0.6-dev \
72             libgmime-3.0-dev \
73             libarchive-dev \
74             libabw-dev \
75             libcdr-dev \
76             libextractor-dev \
77             libextractor-plugins-all \
78             libmwaw-dev \
79             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
80             libtesseract-dev \
81             tesseract-ocr-eng
82     - name: bootstrap source tree
83       run: |
84         # If we restored cached bootstrap tools their timestamps will be older
85         # than checked out files, but we stored them based on a hash of the
86         # files in git that determine what gets built so we know they are in
87         # fact up to date.  Just touch any stamp files that exist.
88         touch --no-create INST/*.stamp
89         export PATH=/usr/lib/ccache:$PATH
90         echo verbose=off > ~/.wgetrc
91         ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
92     - name: configure
93       run: ./configure CC='ccache gcc' CXX='ccache g++'
94     - name: make
95       run: make -j2
96     - name: Run tests
97       run: make -j2 check AUTOMATED_TESTING=1 VERBOSE=1
98     - name: Create distribution tarball
99       run: |
100         make dist
101     - uses: actions/upload-artifact@v4
102       with:
103         path: |
104           xapian-core/xapian-core-*.tar.xz
105           xapian-applications/omega/xapian-omega-*.tar.xz
106           xapian-bindings/xapian-bindings-*.tar.xz
107           xapian-letor/xapian-letor-*.tar.xz
108         # Files are already compressed so don't try to compress again.
109         compression-level: 0
110         retention-days: 1
111         if-no-files-found: error
112     - name: Check generated files are in .gitignore
113       # grep '^' passes through all input while giving a non-zero exit status
114       # if that input is empty.
115       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
117   clang-santisers:
118     runs-on: 'ubuntu-latest'
119     env:
120       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
121     needs: makedist
122     steps:
123     - name: Install CCache
124       uses: hendrikmuhs/ccache-action@v1
125       with:
126         key: ${{ github.job }}
127     - name: Fetch distribution
128       uses: actions/download-artifact@v4
129     - name: Unpack distribution
130       run: |
131         mv artifact/* .
132         rmdir artifact
133         pushd xapian-core
134         tar --strip-components=1 -xf xapian-core-*.tar.xz
135         popd
136         pushd xapian-applications/omega
137         tar --strip-components=1 -xf xapian-omega-*.tar.xz
138         popd
139         # pushd xapian-bindings
140         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
141         # popd
142         pushd xapian-letor
143         tar --strip-components=1 -xf xapian-letor-*.tar.xz
144         popd
145     - name: Install package dependencies
146       run: |
147         sudo apt-get update
148         sudo apt-get install \
149             python3-sphinx \
150             uuid-dev \
151             libpcre2-dev \
152             libmagic-dev \
153             lua5.4 \
154             liblua5.4-dev \
155             mono-devel \
156             python3-dev \
157             tcl \
158             tcl-dev \
159             libicu-dev \
160             pkg-config \
161             libpoppler-glib-dev \
162             libglib2.0-dev \
163             libe-book-dev \
164             libetonyek-dev \
165             libgepub-0.6-dev \
166             libgmime-3.0-dev \
167             libarchive-dev \
168             libabw-dev \
169             libcdr-dev \
170             libextractor-dev \
171             libmwaw-dev \
172             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
173             libtesseract-dev \
174             tesseract-ocr-eng
175     - name: configure
176       run: |
177         # We use clang here because (at least currently) it supports a few
178         # extra sanitiser checks compared to GCC.
179         export CC='ccache clang'
180         export CXX='ccache clang++'
181         # float-divide-by-zero, nullability and unsigned-overflow aren't
182         # undefined behaviour checks, but they catch for things we don't expect
183         # our code to do.
184         export CXXFLAGS='-fsanitize=address,undefined,float-divide-by-zero,local-bounds,nullability,unsigned-integer-overflow -fsanitize-address-use-after-scope -fsanitize-recover=all -g -O2 -fno-omit-frame-pointer'
185         pushd xapian-core
186         ./configure --enable-werror
187         export XAPIAN_CONFIG=$PWD/xapian-config
188         popd
189         pushd xapian-applications/omega
190         ./configure --enable-werror
191         popd
192         # pushd xapian-bindings
193         ## PHP calls dlopen() with "RTLD_DEEPBIND flag which is incompatible
194         ## with sanitizer runtime".
195         ##
196         ## Other bindings should work, but need to debug why they fail to
197         ## work properly currently (with Lua, Python and Tcl we fail to find the
198         ## symbol __ubsan_handle_function_type_mismatch when the module is
199         ## loaded which seems like a setup problem).
200         # ./configure --enable-werror --without-lua --without-php --without-python3 --without-tcl
201         # popd
202         pushd xapian-letor
203         ./configure --enable-werror
204         popd
205     - name: make
206       run: |
207         make -j2 -C xapian-core
208         make -j2 -C xapian-applications/omega
209         # make -j2 -C xapian-bindings MACOS_SIP_HACK_ENV='env LSAN_OPTIONS=leak_check_at_exit=0 LD_PRELOAD=libasan.so.8:libubsan.so.1'
210         make -j2 -C xapian-letor
211     - name: Run tests
212       run: |
213         export AUTOMATED_TESTING=1
214         export VERBOSE=1
215         make -j2 -C xapian-core check
216         make -j2 -C xapian-applications/omega check
217         # make -j2 -C xapian-bindings check MACOS_SIP_HACK_ENV='env LSAN_OPTIONS=leak_check_at_exit=0 LD_PRELOAD=libasan.so.8:libubsan.so.1'
218         make -j2 -C xapian-letor check
220   GLIBCXX_DEBUG:
221     runs-on: 'ubuntu-20.04'
222     env:
223       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
224     needs: makedist
225     steps:
226     - name: Install CCache
227       uses: hendrikmuhs/ccache-action@v1
228       with:
229         key: ${{ github.job }}
230     - name: Fetch distribution
231       uses: actions/download-artifact@v4
232     - name: Unpack distribution
233       run: |
234         mv artifact/* .
235         rmdir artifact
236         pushd xapian-core
237         tar --strip-components=1 -xf xapian-core-*.tar.xz
238         popd
239         pushd xapian-applications/omega
240         tar --strip-components=1 -xf xapian-omega-*.tar.xz
241         popd
242         pushd xapian-bindings
243         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
244         popd
245         pushd xapian-letor
246         tar --strip-components=1 -xf xapian-letor-*.tar.xz
247         popd
248     - name: Install package dependencies
249       run: |
250         sudo apt-get update
251         sudo apt-get install \
252             python3-sphinx \
253             uuid-dev \
254             libpcre2-dev \
255             libmagic-dev \
256             lua5.3 \
257             liblua5.3-dev \
258             mono-devel \
259             python3-dev \
260             tcl \
261             tcl-dev \
262             libicu-dev \
263             pkg-config \
264             libpoppler-glib-dev \
265             libglib2.0-dev \
266             libe-book-dev \
267             libetonyek-dev \
268             libgepub-0.6-dev \
269             libgmime-2.6-dev \
270             libarchive-dev \
271             libabw-dev \
272             libcdr-dev \
273             libextractor-dev \
274             libmwaw-dev \
275             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer
276       # tesseract's C++ API uses std::vector so would need rebuilding with
277       # -D_GLIBCXX_DEBUG too.
278       #      libtesseract-dev \
279       #      tesseract-ocr-eng
280     - name: configure
281       run: |
282         export CC='ccache gcc'
283         export CXX='ccache g++'
284         export CPPFLAGS='-D_GLIBCXX_DEBUG'
285         pushd xapian-core
286         ./configure --enable-werror
287         export XAPIAN_CONFIG=$PWD/xapian-config
288         popd
289         pushd xapian-applications/omega
290         ./configure --enable-werror
291         popd
292         pushd xapian-bindings
293         ./configure --enable-werror
294         popd
295         pushd xapian-letor
296         ./configure --enable-werror
297         popd
298     - name: make
299       run: |
300         make -j2 -C xapian-core
301         make -j2 -C xapian-applications/omega
302         make -j2 -C xapian-bindings
303         make -j2 -C xapian-letor
304     - name: Run tests
305       run: |
306         export AUTOMATED_TESTING=1
307         export VERBOSE=1
308         make -j2 -C xapian-core check
309         make -j2 -C xapian-applications/omega check
310         make -j2 -C xapian-bindings check
311         make -j2 -C xapian-letor check
313   FORTIFY_SOURCE_3:
314     # _FORTIFY_SOURCE level 3 requires GCC 12, so currently we need to use
315     # Ubuntu 22.04 and the gcc-12 and g++12 packages.
316     runs-on: 'ubuntu-22.04'
317     env:
318       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
319     needs: makedist
320     steps:
321     - name: Install CCache
322       uses: hendrikmuhs/ccache-action@v1
323       with:
324         key: ${{ github.job }}
325     - name: Fetch distribution
326       uses: actions/download-artifact@v4
327     - name: Unpack distribution
328       run: |
329         mv artifact/* .
330         rmdir artifact
331         pushd xapian-core
332         tar --strip-components=1 -xf xapian-core-*.tar.xz
333         popd
334         pushd xapian-applications/omega
335         tar --strip-components=1 -xf xapian-omega-*.tar.xz
336         popd
337         pushd xapian-bindings
338         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
339         popd
340         pushd xapian-letor
341         tar --strip-components=1 -xf xapian-letor-*.tar.xz
342         popd
343     - name: Install package dependencies
344       run: |
345         sudo apt-get update
346         sudo apt-get install \
347             gcc-12 \
348             g++-12 \
349             python3-sphinx \
350             uuid-dev \
351             libpcre2-dev \
352             libmagic-dev \
353             lua5.4 \
354             liblua5.4-dev \
355             mono-devel \
356             python3-dev \
357             tcl \
358             tcl-dev \
359             libicu-dev \
360             pkg-config \
361             libpoppler-glib-dev \
362             libglib2.0-dev \
363             libe-book-dev \
364             libetonyek-dev \
365             libgepub-0.6-dev \
366             libgmime-3.0-dev \
367             libarchive-dev \
368             libabw-dev \
369             libcdr-dev \
370             libextractor-dev \
371             libextractor-plugins-all \
372             libmwaw-dev \
373             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
374             libtesseract-dev \
375             tesseract-ocr-eng
376     - name: configure
377       run: |
378         export CC='ccache gcc-12'
379         export CXX='ccache g++-12'
380         # Make this build use builddir != srcdir as we aim to support that and
381         # so want to catch regressions in support.  This build seems a good
382         # choice for that as it's as full a build as any.
383         mkdir -p _build/xapian-core _build/xapian-applications/omega _build/xapian-bindings _build/xapian-letor
384         cd _build
385         # Ubuntu's GCC packages define _FORTIFY_SOURCE=2 by default, so we need
386         # to undefine it before we define it to avoid a warning (which becomes
387         # an error with -Werror).
388         export CPPFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
389         pushd xapian-core
390         ../../xapian-core/configure --enable-werror
391         export XAPIAN_CONFIG=$PWD/xapian-config
392         popd
393         pushd xapian-applications/omega
394         ../../../xapian-applications/omega/configure --enable-werror
395         popd
396         pushd xapian-bindings
397         ../../xapian-bindings/configure --enable-werror
398         popd
399         pushd xapian-letor
400         ../../xapian-letor/configure --enable-werror
401         popd
402     - name: make
403       run: |
404         cd _build
405         make -j2 -C xapian-core
406         make -j2 -C xapian-applications/omega
407         make -j2 -C xapian-bindings
408         make -j2 -C xapian-letor
409     - name: Run tests
410       run: |
411         export AUTOMATED_TESTING=1
412         export VERBOSE=1
413         cd _build
414         make -j2 -C xapian-core check
415         make -j2 -C xapian-applications/omega check
416         make -j2 -C xapian-bindings check
417         make -j2 -C xapian-letor check
419   assertions:
420     runs-on: 'ubuntu-22.04'
421     env:
422       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
423     needs: makedist
424     steps:
425     - name: Install CCache
426       uses: hendrikmuhs/ccache-action@v1
427       with:
428         key: ${{ github.job }}
429     - name: Fetch distribution
430       uses: actions/download-artifact@v4
431     - name: Unpack distribution
432       run: |
433         mv artifact/* .
434         rmdir artifact
435         pushd xapian-core
436         tar --strip-components=1 -xf xapian-core-*.tar.xz
437         popd
438         pushd xapian-applications/omega
439         tar --strip-components=1 -xf xapian-omega-*.tar.xz
440         popd
441         pushd xapian-bindings
442         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
443         popd
444         pushd xapian-letor
445         tar --strip-components=1 -xf xapian-letor-*.tar.xz
446         popd
447     - name: Install package dependencies
448       run: |
449         sudo apt-get update
450         sudo apt-get install \
451             python3-sphinx \
452             uuid-dev \
453             libpcre2-dev \
454             libmagic-dev \
455             lua5.4 \
456             liblua5.4-dev \
457             mono-devel \
458             python3-dev \
459             tcl \
460             tcl-dev \
461             libicu-dev \
462             pkg-config \
463             libpoppler-glib-dev \
464             libglib2.0-dev \
465             libe-book-dev \
466             libetonyek-dev \
467             libgepub-0.6-dev \
468             libgmime-3.0-dev \
469             libarchive-dev \
470             libabw-dev \
471             libcdr-dev \
472             libextractor-dev \
473             libextractor-plugins-all \
474             libmwaw-dev \
475             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
476             libtesseract-dev \
477             tesseract-ocr-eng
478     - name: configure
479       run: |
480         export CC='ccache gcc'
481         export CXX='ccache g++'
482         pushd xapian-core
483         ./configure --enable-werror --enable-assertions
484         export XAPIAN_CONFIG=$PWD/xapian-config
485         popd
486         pushd xapian-applications/omega
487         ./configure --enable-werror
488         popd
489         pushd xapian-bindings
490         ./configure --enable-werror
491         popd
492         pushd xapian-letor
493         ./configure --enable-werror
494         popd
495     - name: make
496       run: |
497         make -j2 -C xapian-core
498         make -j2 -C xapian-applications/omega
499         make -j2 -C xapian-bindings
500         make -j2 -C xapian-letor
501     - name: Run tests
502       run: |
503         export AUTOMATED_TESTING=1
504         export VERBOSE=1
505         make -j2 -C xapian-core check
506         make -j2 -C xapian-applications/omega check
507         make -j2 -C xapian-bindings check
508         make -j2 -C xapian-letor check
510   debug-log:
511     runs-on: 'ubuntu-22.04'
512     env:
513       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
514     needs: makedist
515     steps:
516     - name: Install CCache
517       uses: hendrikmuhs/ccache-action@v1
518       with:
519         key: ${{ github.job }}
520     - name: Fetch distribution
521       uses: actions/download-artifact@v4
522     - name: Unpack distribution
523       run: |
524         mv artifact/* .
525         rmdir artifact
526         pushd xapian-core
527         tar --strip-components=1 -xf xapian-core-*.tar.xz
528         popd
529         pushd xapian-applications/omega
530         tar --strip-components=1 -xf xapian-omega-*.tar.xz
531         popd
532         pushd xapian-bindings
533         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
534         popd
535         pushd xapian-letor
536         tar --strip-components=1 -xf xapian-letor-*.tar.xz
537         popd
538     - name: Install package dependencies
539       run: |
540         sudo apt-get update
541         sudo apt-get install \
542             python3-sphinx \
543             uuid-dev \
544             libpcre2-dev \
545             libmagic-dev \
546             lua5.4 \
547             liblua5.4-dev \
548             mono-devel \
549             python3-dev \
550             tcl \
551             tcl-dev \
552             libicu-dev \
553             pkg-config \
554             libpoppler-glib-dev \
555             libglib2.0-dev \
556             libe-book-dev \
557             libetonyek-dev \
558             libgepub-0.6-dev \
559             libgmime-3.0-dev \
560             libarchive-dev \
561             libabw-dev \
562             libcdr-dev \
563             libextractor-dev \
564             libextractor-plugins-all \
565             libmwaw-dev \
566             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
567             libtesseract-dev \
568             tesseract-ocr-eng
569     - name: configure
570       run: |
571         export CC='ccache gcc'
572         export CXX='ccache g++'
573         pushd xapian-core
574         ./configure --enable-werror --enable-log
575         export XAPIAN_CONFIG=$PWD/xapian-config
576         popd
577         pushd xapian-applications/omega
578         ./configure --enable-werror
579         popd
580         pushd xapian-bindings
581         ./configure --enable-werror
582         popd
583         pushd xapian-letor
584         ./configure --enable-werror
585         popd
586     - name: make
587       run: |
588         make -j2 -C xapian-core
589         make -j2 -C xapian-applications/omega
590         make -j2 -C xapian-bindings
591         make -j2 -C xapian-letor
592     - name: Run tests
593       run: |
594         export AUTOMATED_TESTING=1
595         export VERBOSE=1
596         make -j2 -C xapian-core check
597         make -j2 -C xapian-applications/omega check
598         make -j2 -C xapian-bindings check
599         make -j2 -C xapian-letor check
601   clang:
602     runs-on: 'ubuntu-20.04'
603     env:
604       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
605     needs: makedist
606     steps:
607     - name: Install CCache
608       uses: hendrikmuhs/ccache-action@v1
609       with:
610         key: ${{ github.job }}
611     - name: Fetch distribution
612       uses: actions/download-artifact@v4
613     - name: Unpack distribution
614       run: |
615         mv artifact/* .
616         rmdir artifact
617         pushd xapian-core
618         tar --strip-components=1 -xf xapian-core-*.tar.xz
619         popd
620         pushd xapian-applications/omega
621         tar --strip-components=1 -xf xapian-omega-*.tar.xz
622         popd
623         pushd xapian-bindings
624         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
625         popd
626         pushd xapian-letor
627         tar --strip-components=1 -xf xapian-letor-*.tar.xz
628         popd
629     - name: Install package dependencies
630       run: |
631         env
632         sudo apt-get update
633         sudo apt-get install \
634             clang \
635             libc++-dev
636         sudo apt-get install \
637             python3-sphinx \
638             uuid-dev \
639             libpcre2-dev \
640             libmagic-dev \
641             python3-dev \
642             tcl \
643             tcl-dev \
644             libicu-dev \
645             pkg-config \
646             libpoppler-glib-dev \
647             libglib2.0-dev \
648             libe-book-dev \
649             libetonyek-dev \
650             libgepub-0.6-dev \
651             libgmime-2.6-dev \
652             libarchive-dev \
653             libabw-dev \
654             libcdr-dev \
655             libextractor-dev \
656             libmwaw-dev \
657             libtesseract-dev \
658             tesseract-ocr-eng
659             # libreoffice support doesn't work when compiled with clang on Linux
660     - name: configure
661       run: |
662         export CC='ccache clang'
663         # Build with the llvm c++ library to catch more portability issues.
664         export CXX='ccache clang++ -stdlib=libc++'
665         pushd xapian-core
666         ./configure --enable-werror
667         export XAPIAN_CONFIG=$PWD/xapian-config
668         popd
669         pushd xapian-applications/omega
670         ./configure --enable-werror
671         popd
672         pushd xapian-bindings
673         ./configure --enable-werror --with-python3 --with-tcl
674         popd
675         pushd xapian-letor
676         ./configure --enable-werror
677         popd
678     - name: make
679       run: |
680         make -j2 -C xapian-core
681         make -j2 -C xapian-applications/omega
682         make -j2 -C xapian-bindings
683         make -j2 -C xapian-letor
684     - name: Run tests
685       run: |
686         export AUTOMATED_TESTING=1
687         export VERBOSE=1
688         make -j2 -C xapian-core check
689         make -j2 -C xapian-applications/omega check
690         make -j2 -C xapian-bindings check
691         make -j2 -C xapian-letor check
693   # Test with the oldest clang version we easily can.
694   clang6:
695     runs-on: 'ubuntu-20.04'
696     env:
697       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
698     needs: makedist
699     steps:
700     - name: Install CCache
701       uses: hendrikmuhs/ccache-action@v1
702       with:
703         key: ${{ github.job }}
704     - name: Fetch distribution
705       uses: actions/download-artifact@v4
706     - name: Unpack distribution
707       run: |
708         mv artifact/* .
709         rmdir artifact
710         pushd xapian-core
711         tar --strip-components=1 -xf xapian-core-*.tar.xz
712         popd
713         pushd xapian-applications/omega
714         tar --strip-components=1 -xf xapian-omega-*.tar.xz
715         popd
716         pushd xapian-bindings
717         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
718         popd
719         pushd xapian-letor
720         tar --strip-components=1 -xf xapian-letor-*.tar.xz
721         popd
722     - name: Install package dependencies
723       run: |
724         env
725         sudo apt-get update
726         sudo apt-get install \
727             clang-6.0
728         sudo apt-get install \
729             python3-sphinx \
730             uuid-dev \
731             libpcre2-dev \
732             libmagic-dev \
733             python3-dev \
734             tcl \
735             tcl-dev \
736             pkg-config \
737             libpoppler-glib-dev \
738             libglib2.0-dev \
739             libe-book-dev \
740             libetonyek-dev \
741             libgepub-0.6-dev \
742             libgmime-2.6-dev \
743             libarchive-dev \
744             libabw-dev \
745             libcdr-dev \
746             libextractor-dev \
747             libmwaw-dev \
748             libtesseract-dev \
749             tesseract-ocr-eng
750             # libreoffice support doesn't work when compiled with clang on Linux
751     - name: configure
752       run: |
753         export CC='ccache clang-6.0'
754         export CXX='ccache clang++-6.0'
755         pushd xapian-core
756         ./configure --enable-werror
757         export XAPIAN_CONFIG=$PWD/xapian-config
758         popd
759         pushd xapian-applications/omega
760         ./configure --enable-werror
761         popd
762         pushd xapian-bindings
763         ./configure --enable-werror --with-python3 --with-tcl
764         popd
765         pushd xapian-letor
766         ./configure --enable-werror
767         popd
768     - name: make
769       run: |
770         make -j2 -C xapian-core
771         make -j2 -C xapian-applications/omega
772         make -j2 -C xapian-bindings
773         make -j2 -C xapian-letor
774     - name: Run tests
775       run: |
776         export AUTOMATED_TESTING=1
777         export VERBOSE=1
778         make -j2 -C xapian-core check
779         make -j2 -C xapian-applications/omega check
780         make -j2 -C xapian-bindings check
781         make -j2 -C xapian-letor check
783   # GCC 7 is the oldest GCC we currently aim to support.
784   # Ubuntu 20.04 has GCC 7.5.0.
785   GCC7:
786     name: 'GCC 7'
787     runs-on: 'ubuntu-20.04'
788     env:
789       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
790     needs: makedist
791     steps:
792     - name: Install CCache
793       uses: hendrikmuhs/ccache-action@v1
794       with:
795         key: ${{ github.job }}
796     - name: Fetch distribution
797       uses: actions/download-artifact@v4
798     - name: Unpack distribution
799       run: |
800         mv artifact/* .
801         rmdir artifact
802         pushd xapian-core
803         tar --strip-components=1 -xf xapian-core-*.tar.xz
804         popd
805         pushd xapian-applications/omega
806         tar --strip-components=1 -xf xapian-omega-*.tar.xz
807         popd
808         pushd xapian-bindings
809         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
810         popd
811         pushd xapian-letor
812         tar --strip-components=1 -xf xapian-letor-*.tar.xz
813         popd
814     - name: Install package dependencies
815       run: |
816         sudo apt-get update
817         sudo apt-get install \
818             gcc-7 \
819             g++-7
820         sudo apt-get install \
821             python3-sphinx \
822             uuid-dev \
823             libpcre2-dev \
824             libmagic-dev \
825             lua5.3 \
826             liblua5.3-dev \
827             mono-devel \
828             python3-dev \
829             tcl \
830             tcl-dev \
831             libpoppler-glib-dev \
832             libglib2.0-dev \
833             libe-book-dev \
834             libetonyek-dev \
835             libgepub-0.6-dev \
836             libgmime-2.6-dev \
837             libarchive-dev \
838             libabw-dev \
839             libcdr-dev \
840             libextractor-dev \
841             libmwaw-dev \
842             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
843             libtesseract-dev \
844             tesseract-ocr-eng
845     - name: configure
846       run: |
847         export CC='ccache gcc-7'
848         export CXX='ccache g++-7'
849         pushd xapian-core
850         ./configure --enable-werror
851         export XAPIAN_CONFIG=$PWD/xapian-config
852         popd
853         pushd xapian-applications/omega
854         ./configure --enable-werror
855         popd
856         pushd xapian-bindings
857         ./configure --enable-werror
858         popd
859         pushd xapian-letor
860         ./configure --enable-werror
861         popd
862     - name: make
863       run: |
864         make -j2 -C xapian-core
865         make -j2 -C xapian-applications/omega
866         make -j2 -C xapian-bindings
867         make -j2 -C xapian-letor
868     - name: Run tests
869       run: |
870         export AUTOMATED_TESTING=1
871         export VERBOSE=1
872         make -j2 -C xapian-core check
873         make -j2 -C xapian-applications/omega check
874         make -j2 -C xapian-bindings check
875         make -j2 -C xapian-letor check
877   Emscripten:
878     runs-on: 'ubuntu-20.04'
879     needs: makedist
880     env:
881       EM_COMPILER_WRAPPER: ccache
882     steps:
883     - name: Install CCache
884       uses: hendrikmuhs/ccache-action@v1
885       with:
886         key: ${{ github.job }}
887     - name: Fetch distribution
888       uses: actions/download-artifact@v4
889     - name: Unpack distribution
890       run: |
891         mv artifact/* .
892         rmdir artifact
893         pushd xapian-core
894         tar --strip-components=1 -xf xapian-core-*.tar.xz
895         popd
896     - name: Setup emsdk
897       uses: mymindstorm/setup-emsdk@v13
898       with:
899         # With 3.1.51 `emcc -c` seems to fail.
900         version: 3.1.50
901         # This is the name of the cache folder.
902         # The cache folder will be placed in the build directory,
903         #  so make sure it doesn't conflict with anything!
904         actions-cache-folder: 'emsdk-cache'
905     - name: Use Node.js
906       uses: actions/setup-node@v4
907     - name: configure
908       run: |
909         cd xapian-core
910         export CPPFLAGS='-DFLINTLOCK_USE_FLOCK'
911         export CXXFLAGS='-Oz -s USE_ZLIB=1 -fno-rtti'
912         emconfigure ./configure --enable-werror --disable-shared
913     - name: make
914       run: |
915         cd xapian-core
916         emmake make
917     - name: Run tests
918       run: |
919         cd xapian-core
920         em++ -Oz -s USE_ZLIB=1 -std=c++11 -s WASM=1 -Iinclude emscripten/xapianjstest.cc .libs/libxapian-1.5.a -o emscripten/xapianjstest.js
921         cd emscripten
922         node xapianjstest.js
924   debian-stable:
925     runs-on: 'ubuntu-latest'
926     container: debian:stable
927     env:
928       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
929     needs: makedist
930     steps:
931     - name: Install package dependencies
932       run: |
933         apt-get update
934         apt-get install -y \
935             xz-utils \
936             python3-sphinx \
937             uuid-dev \
938             libpcre2-dev \
939             libmagic-dev \
940             lua5.4 \
941             liblua5.4-dev \
942             mono-devel \
943             python3-dev \
944             tcl \
945             tcl-dev \
946             libicu-dev \
947             pkg-config \
948             libpoppler-glib-dev \
949             libglib2.0-dev \
950             libe-book-dev \
951             libetonyek-dev \
952             libgepub-0.7-dev \
953             libgmime-3.0-dev \
954             libarchive-dev \
955             libabw-dev \
956             libcdr-dev \
957             libextractor-dev \
958             libmwaw-dev \
959             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
960             libtesseract-dev \
961             tesseract-ocr-eng
962     - name: Install CCache
963       uses: hendrikmuhs/ccache-action@v1
964       with:
965         key: ${{ github.job }}
966     - name: Fetch distribution
967       uses: actions/download-artifact@v4
968     - name: Unpack distribution
969       run: |
970         mv artifact/* .
971         rmdir artifact
972         pushd xapian-core
973         tar --strip-components=1 -xf xapian-core-*.tar.xz
974         popd
975         pushd xapian-applications/omega
976         tar --strip-components=1 -xf xapian-omega-*.tar.xz
977         popd
978         pushd xapian-bindings
979         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
980         popd
981         pushd xapian-letor
982         tar --strip-components=1 -xf xapian-letor-*.tar.xz
983         popd
984     - name: configure
985       run: |
986         export CC='ccache gcc'
987         export CXX='ccache g++'
988         pushd xapian-core
989         ./configure --enable-werror
990         export XAPIAN_CONFIG=$PWD/xapian-config
991         popd
992         pushd xapian-applications/omega
993         ./configure --enable-werror
994         popd
995         pushd xapian-bindings
996         ./configure --enable-werror
997         popd
998         pushd xapian-letor
999         ./configure --enable-werror
1000         popd
1001     - name: make
1002       run: |
1003         make -j2 -C xapian-core
1004         make -j2 -C xapian-applications/omega
1005         make -j2 -C xapian-bindings
1006         make -j2 -C xapian-letor
1007     - name: Run tests
1008       run: |
1009         export AUTOMATED_TESTING=1
1010         export VERBOSE=1
1011         make -j2 -C xapian-core check
1012         make -j2 -C xapian-applications/omega check
1013         make -j2 -C xapian-bindings check
1014         make -j2 -C xapian-letor check
1016   macos-15:
1017     runs-on: 'macos-15'
1018     needs: makedist
1019     steps:
1020     - name: Install CCache
1021       uses: hendrikmuhs/ccache-action@v1
1022       with:
1023         key: ${{ github.job }}
1024     - name: Fetch distribution
1025       uses: actions/download-artifact@v4
1026     - name: Unpack distribution
1027       run: |
1028         mv artifact/* .
1029         rmdir artifact
1030         pushd xapian-core
1031         tar --strip-components=1 -xf xapian-core-*.tar.xz
1032         popd
1033         pushd xapian-applications/omega
1034         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1035         popd
1036         pushd xapian-bindings
1037         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1038         popd
1039         pushd xapian-letor
1040         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1041         popd
1042     - name: Install package dependencies
1043       run: |
1044         # Workaround apparent homebrew bug 2024-01-17
1045         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1046         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1047         brew update
1048         brew install -q \
1049             gmime \
1050             icu4c \
1051             libabw \
1052             libarchive \
1053             libcdr \
1054             libetonyek \
1055             libextractor \
1056             libiconv \
1057             libmagic \
1058             libmwaw \
1059             lua \
1060             pcre2 \
1061             php \
1062             pkgconfig \
1063             poppler \
1064             pygments \
1065             python \
1066             tcl-tk
1067         pip3 install --user --break-system-packages Sphinx
1068         # mono-mdk: "make check" fails on arm64 macos-15 (but works on
1069         # x86_64 macos-12 and macos-13).  Last checked 2024-05-05.
1070         #
1071         # libeatmydata doesn't currently actually do anything on macOS:
1072         # https://github.com/stewartsmith/libeatmydata/issues/34
1073         # It's also started failing to even run in homebrew so don't install
1074         # for now.
1075         #
1076         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1077         # worked).
1078         # tesseract
1079     - name: configure
1080       run: |
1081         export CC='ccache gcc'
1082         export CXX='ccache g++'
1083         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1084         pushd xapian-core
1085         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1086         export XAPIAN_CONFIG=$PWD/xapian-config
1087         popd
1088         pushd xapian-applications/omega
1089         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1090         popd
1091         pushd xapian-bindings
1092         # Homebrew package mono-mdk-for-visual-studio is pre-installed in the
1093         # image so we need to select the bindings we want except for csharp
1094         # as that currently fails on aarch64 macos.
1095         ./configure --enable-werror --with-java --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
1096         popd
1097         pushd xapian-letor
1098         ./configure --enable-werror
1099         popd
1100     - name: make
1101       run: |
1102         make -j3 -C xapian-core
1103         make -j3 -C xapian-core install
1104         make -j3 -C xapian-applications/omega
1105         make -j3 -C xapian-bindings
1106         make -j3 -C xapian-letor
1107     - name: Run tests
1108       run: |
1109         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1110         export AUTOMATED_TESTING=1
1111         export VERBOSE=1
1112         make -j3 -C xapian-core check
1113         make -j3 -C xapian-applications/omega check
1114         make -j3 -C xapian-bindings check
1115         make -j3 -C xapian-letor check
1116     - name: Save log files
1117       if: ${{ failure() }}
1118       uses: actions/upload-artifact@v4
1119       with:
1120         name: logs-${{ github.job }}-${{ github.sha }}
1121         overwrite: true
1122         path: |
1123           **/*.log
1125   macos-14:
1126     runs-on: 'macos-14'
1127     needs: makedist
1128     steps:
1129     - name: Install CCache
1130       uses: hendrikmuhs/ccache-action@v1
1131       with:
1132         key: ${{ github.job }}
1133         restore-keys: macos # temporary, so the ccache migrates
1134     - name: Fetch distribution
1135       uses: actions/download-artifact@v4
1136     - name: Unpack distribution
1137       run: |
1138         mv artifact/* .
1139         rmdir artifact
1140         pushd xapian-core
1141         tar --strip-components=1 -xf xapian-core-*.tar.xz
1142         popd
1143         pushd xapian-applications/omega
1144         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1145         popd
1146         pushd xapian-bindings
1147         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1148         popd
1149         pushd xapian-letor
1150         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1151         popd
1152     - name: Install package dependencies
1153       run: |
1154         # Workaround apparent homebrew bug 2024-01-17
1155         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1156         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1157         brew update
1158         brew install -q \
1159             gmime \
1160             icu4c \
1161             libabw \
1162             libarchive \
1163             libcdr \
1164             libetonyek \
1165             libextractor \
1166             libiconv \
1167             libmagic \
1168             libmwaw \
1169             lua \
1170             pcre2 \
1171             php \
1172             pkgconfig \
1173             poppler \
1174             pygments \
1175             python \
1176             tcl-tk
1177         pip3 install --user --break-system-packages Sphinx
1178         # mono-mdk: "make check" fails on aarch64 macos-14 (but works on
1179         # x86_64 macos-12 and macos-13):
1180         # System.DllNotFoundException: _XapianSharp assembly:<unknown assembly> type:<unknown type> member:(null)
1181         # Last checked 2024-10-24.
1182         #
1183         # libeatmydata doesn't currently actually do anything on macOS:
1184         # https://github.com/stewartsmith/libeatmydata/issues/34
1185         # It's also started failing to even run in homebrew so don't install
1186         # for now.
1187         #
1188         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1189         # worked).
1190         # tesseract
1191     - name: configure
1192       run: |
1193         export CC='ccache gcc'
1194         export CXX='ccache g++'
1195         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1196         pushd xapian-core
1197         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1198         export XAPIAN_CONFIG=$PWD/xapian-config
1199         popd
1200         pushd xapian-applications/omega
1201         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1202         popd
1203         pushd xapian-bindings
1204         # Homebrew package mono-mdk-for-visual-studio is pre-installed in the
1205         # image so we need to select the bindings we want except for csharp
1206         # as that currently fails on aarch64 macos.
1207         ./configure --enable-werror --with-java --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
1208         popd
1209         pushd xapian-letor
1210         ./configure --enable-werror
1211         popd
1212     - name: make
1213       run: |
1214         make -j3 -C xapian-core
1215         make -j3 -C xapian-core install
1216         make -j3 -C xapian-applications/omega
1217         make -j3 -C xapian-bindings
1218         make -j3 -C xapian-letor
1219     - name: Run tests
1220       run: |
1221         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1222         export AUTOMATED_TESTING=1
1223         export VERBOSE=1
1224         make -j3 -C xapian-core check
1225         make -j3 -C xapian-applications/omega check
1226         make -j3 -C xapian-bindings check
1227         make -j3 -C xapian-letor check
1228     - name: Save log files
1229       if: ${{ failure() }}
1230       uses: actions/upload-artifact@v4
1231       with:
1232         name: logs-${{ github.job }}-${{ github.sha }}
1233         overwrite: true
1234         path: |
1235           **/*.log
1237   macos-13:
1238     runs-on: 'macos-13'
1239     needs: makedist
1240     steps:
1241     - name: Install CCache
1242       uses: hendrikmuhs/ccache-action@v1
1243       with:
1244         key: ${{ github.job }}
1245     - name: Fetch distribution
1246       uses: actions/download-artifact@v4
1247     - name: Unpack distribution
1248       run: |
1249         mv artifact/* .
1250         rmdir artifact
1251         pushd xapian-core
1252         tar --strip-components=1 -xf xapian-core-*.tar.xz
1253         popd
1254         pushd xapian-applications/omega
1255         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1256         popd
1257         pushd xapian-bindings
1258         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1259         popd
1260         pushd xapian-letor
1261         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1262         popd
1263     - name: Install package dependencies
1264       run: |
1265         # Workaround apparent homebrew bug 2024-10-24
1266         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1267         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1268         brew update
1269         brew install -q \
1270             gmime \
1271             icu4c \
1272             libabw \
1273             libarchive \
1274             libcdr \
1275             libetonyek \
1276             libextractor \
1277             libiconv \
1278             libmagic \
1279             libmwaw \
1280             lua \
1281             mono-mdk \
1282             pcre2 \
1283             pkgconfig \
1284             poppler \
1285             pygments \
1286             python \
1287             tcl-tk
1288         pip3 install --user --break-system-packages Sphinx
1289         # libeatmydata doesn't currently actually do anything on macOS:
1290         # https://github.com/stewartsmith/libeatmydata/issues/34
1291         # It's also started failing to even run in homebrew so don't install
1292         # for now.
1293         #
1294         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1295         # worked).
1296         # tesseract
1297     - name: configure
1298       run: |
1299         export CC='ccache gcc'
1300         export CXX='ccache g++'
1301         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1302         pushd xapian-core
1303         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1304         export XAPIAN_CONFIG=$PWD/xapian-config
1305         popd
1306         pushd xapian-applications/omega
1307         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1308         popd
1309         pushd xapian-bindings
1310         ./configure --enable-werror --with-csharp --with-java --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
1311         popd
1312         pushd xapian-letor
1313         ./configure --enable-werror
1314         popd
1315     - name: make
1316       run: |
1317         make -j4 -C xapian-core
1318         make -j4 -C xapian-core install
1319         make -j4 -C xapian-applications/omega
1320         make -j4 -C xapian-bindings
1321         make -j4 -C xapian-letor
1322     - name: Run tests
1323       run: |
1324         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1325         export AUTOMATED_TESTING=1
1326         export VERBOSE=1
1327         make -j4 -C xapian-core check
1328         make -j4 -C xapian-applications/omega check
1329         make -j4 -C xapian-bindings check
1330         make -j4 -C xapian-letor check
1331     - name: Save log files
1332       if: ${{ failure() }}
1333       uses: actions/upload-artifact@v4
1334       with:
1335         name: logs-${{ github.job }}-${{ github.sha }}
1336         overwrite: true
1337         path: |
1338           **/*.log
1340   mingw64-i686-cross:
1341     runs-on: 'ubuntu-22.04'
1342     needs: makedist
1343     steps:
1344     - name: Install CCache
1345       uses: hendrikmuhs/ccache-action@v1
1346       with:
1347         key: ${{ github.job }}
1348     - name: Fetch distribution
1349       uses: actions/download-artifact@v4
1350     - name: Unpack distribution
1351       run: |
1352         mv artifact/* .
1353         rmdir artifact
1354         pushd xapian-core
1355         tar --strip-components=1 -xf xapian-core-*.tar.xz
1356         popd
1357         pushd xapian-letor
1358         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1359         popd
1360     - name: Install package dependencies
1361       run: |
1362         sudo apt-get update
1363         sudo apt-get install \
1364             g++-mingw-w64-i686-win32 \
1365             mingw-w64-i686-dev \
1366             binutils-mingw-w64-i686 \
1367             libz-mingw-w64-dev \
1368             mingw-w64-tools
1369     - name: configure
1370       run: |
1371         export EATMYDATA=
1372         export PATH=/usr/lib/ccache:$PATH
1373         pushd xapian-core
1374         ./configure --enable-werror --host i686-w64-mingw32
1375         export XAPIAN_CONFIG=$PWD/xapian-config
1376         popd
1377         pushd xapian-letor
1378         ./configure --enable-werror --host i686-w64-mingw32
1379         popd
1380     - name: make
1381       run: |
1382         export PATH=/usr/lib/ccache:$PATH
1383         make -j2 -C xapian-core
1384         make -j2 -C xapian-letor
1385     - name: Run tests
1386       run: |
1387         # Stop mono binfmt trying to run .exe files.
1388         sudo apt-get purge mono-runtime
1389         sudo dpkg --add-architecture i386
1390         sudo apt-get update
1391         sudo apt-get install wine32 wine-binfmt:amd64 wine:amd64
1392         export AUTOMATED_TESTING=1
1393         export VERBOSE=1
1394         export WINEPATH="$PWD/xapian-core/.libs;/usr/lib/gcc/i686-w64-mingw32/`i686-w64-mingw32-g++ --version 2>/dev/null|head -n1|sed 's/.*) //;s/ .*//'`"
1395         make -j2 -C xapian-core check
1396         export WINEPATH="$PWD/xapian-letor/.libs;$WINEPATH"
1397         make -j2 -C xapian-letor check
1399   mingw64-x86-64-cross:
1400     runs-on: 'ubuntu-22.04'
1401     needs: makedist
1402     steps:
1403     - name: Install CCache
1404       uses: hendrikmuhs/ccache-action@v1
1405       with:
1406         key: ${{ github.job }}
1407     - name: Fetch distribution
1408       uses: actions/download-artifact@v4
1409     - name: Unpack distribution
1410       run: |
1411         mv artifact/* .
1412         rmdir artifact
1413         pushd xapian-core
1414         tar --strip-components=1 -xf xapian-core-*.tar.xz
1415         export XAPIAN_CONFIG=$PWD/xapian-config
1416         popd
1417         pushd xapian-letor
1418         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1419         popd
1420     - name: Install package dependencies
1421       run: |
1422         sudo apt-get update
1423         # Stop mono binfmt trying to run .exe files.
1424         sudo apt-get purge mono-runtime
1425         sudo apt-get install \
1426             g++-mingw-w64-x86-64-win32 \
1427             mingw-w64-x86-64-dev \
1428             binutils-mingw-w64-x86-64 \
1429             libz-mingw-w64-dev \
1430             mingw-w64-tools \
1431             wine-binfmt \
1432             wine \
1433             wine64
1434         sudo dpkg --add-architecture i386
1435         sudo apt-get update
1436         sudo apt-get install wine32
1437     - name: configure
1438       run: |
1439         export EATMYDATA=
1440         export PATH=/usr/lib/ccache:$PATH
1441         pushd xapian-core
1442         ./configure --enable-werror --host x86_64-w64-mingw32
1443         export XAPIAN_CONFIG=$PWD/xapian-config
1444         popd
1445         pushd xapian-letor
1446         ./configure --enable-werror --host x86_64-w64-mingw32
1447         popd
1448     - name: make
1449       run: |
1450         export PATH=/usr/lib/ccache:$PATH
1451         make -j2 -C xapian-core
1452         make -j2 -C xapian-letor
1453     - name: Run tests
1454       run: |
1455         export AUTOMATED_TESTING=1
1456         export VERBOSE=1
1457         export WINEPATH="$PWD/xapian-core/.libs;/usr/lib/gcc/x86_64-w64-mingw32/`x86_64-w64-mingw32-g++ --version 2>/dev/null|head -n1|sed 's/.*) //;s/ .*//'`"
1458         make -j2 -C xapian-core check
1459         export WINEPATH="$PWD/xapian-letor/.libs;$WINEPATH"
1460         make -j2 -C xapian-letor check
1462   Fedora:
1463     runs-on: 'ubuntu-22.04'
1464     container: fedora:35
1465     needs: makedist
1466     steps:
1467     - name: Install build tools
1468       run: dnf install -y --nodocs ccache xz
1469     - name: Install CCache
1470       uses: hendrikmuhs/ccache-action@v1
1471       with:
1472         key: ${{ github.job }}
1473     - name: Fetch distribution
1474       uses: actions/download-artifact@v4
1475     - name: Unpack distribution
1476       run: |
1477         mv artifact/* .
1478         rmdir artifact
1479         pushd xapian-core
1480         tar --strip-components=1 -xf xapian-core-*.tar.xz
1481         popd
1482         pushd xapian-applications/omega
1483         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1484         popd
1485         pushd xapian-bindings
1486         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1487         popd
1488         pushd xapian-letor
1489         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1490         popd
1491     - name: Install package dependencies
1492       run: |
1493         dnf install -y --nodocs \
1494         gcc-c++ file-devel libuuid-devel pcre2-devel perl zlib-devel make pkg-config \
1495         python3-devel python3-setuptools python3-sphinx \
1496         ruby ruby-devel rubygems rubygem-rdoc rubygem-json rubygem-test-unit \
1497         tcl-devel
1498     - name: configure
1499       run: |
1500         export CC='ccache gcc'
1501         export CXX='ccache g++'
1502         pushd xapian-core
1503         ./configure --enable-werror
1504         export XAPIAN_CONFIG=$PWD/xapian-config
1505         popd
1506         pushd xapian-applications/omega
1507         ./configure --enable-werror
1508         popd
1509         pushd xapian-bindings
1510         ./configure --enable-werror
1511         popd
1512         pushd xapian-letor
1513         ./configure --enable-werror
1514         popd
1515     - name: make
1516       run: |
1517         make -j2 -C xapian-core
1518         make -j2 -C xapian-applications/omega
1519         make -j2 -C xapian-bindings
1520         make -j2 -C xapian-letor
1521     - name: Run tests
1522       run: |
1523         export AUTOMATED_TESTING=1
1524         export VERBOSE=1
1525         make -j2 -C xapian-core check
1526         make -j2 -C xapian-applications/omega check
1527         make -j2 -C xapian-bindings check
1528         make -j2 -C xapian-letor check
1530   android-cross:
1531     runs-on: 'ubuntu-22.04'
1532     env:
1533       # Override github default because 27.1.12297006 fails with link errors in
1534       # a shared build, such as:
1535       # ld.lld: error: non-exported symbol '__aeabi_uidivmod' in '/usr/local/lib/android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-arm-android.a(aeabi_uidivmod.S.o)' is referenced by DSO './.libs/libxapian-1.5.so'
1536       ANDROID_NDK: '/usr/local/lib/android/sdk/ndk/26.3.11579264'
1537       host_triplet: 'armv7a-linux-androideabi34'
1538     needs: makedist
1539     steps:
1540     - name: Install CCache
1541       uses: hendrikmuhs/ccache-action@v1
1542       with:
1543         key: ${{ github.job }}
1544     - name: Fetch distribution
1545       uses: actions/download-artifact@v4
1546     - name: Unpack distribution
1547       run: |
1548         mv artifact/* .
1549         rmdir artifact
1550         pushd xapian-core
1551         tar --strip-components=1 -xf xapian-core-*.tar.xz
1552         popd
1553     - name: configure
1554       run: |
1555         PATH=$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
1556         cd xapian-core
1557         ./configure --enable-werror \
1558             --host=$host_triplet \
1559             CC="ccache ${host_triplet}-clang" \
1560             CXX="ccache ${host_triplet}-clang++" \
1561             PKG_CONFIG=/bin/false
1562     - name: make
1563       run: |
1564         PATH=$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
1565         make -j2 -C xapian-core
1566       # FIXME: Run tests under android emulator?
1568   cygwin:
1569     # We only test 64-bit cygwin as 32-bit support has been dropped as of
1570     # Cygwin 3.4:
1571     # https://cygwin.com/pipermail/cygwin/2022-November/252542.html
1572     runs-on: 'windows-latest'
1573     needs: makedist
1574     defaults:
1575       run:
1576         # `-o igncr` needed as GHA supplies shell fragments with DOS EOLs.
1577         shell: 'C:\tools\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0}'
1578     steps:
1579     - name: Install Cygwin
1580       uses: egor-tensin/setup-cygwin@v4
1581       with:
1582         packages: gcc-g++ make file-devel libpcre2-devel zlib-devel perl
1583     - name: Install CCache
1584       uses: hendrikmuhs/ccache-action@v1
1585       with:
1586         key: ${{ github.job }}
1587     - name: Fetch distribution
1588       uses: actions/download-artifact@v4
1589     - name: Unpack distribution
1590       run: |
1591         mv artifact/* .
1592         rmdir artifact
1593         pushd xapian-core
1594         tar --strip-components=1 -xf xapian-core-*.tar.xz
1595         popd
1596         pushd xapian-applications/omega
1597         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1598         popd
1599         pushd xapian-bindings
1600         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1601         popd
1602         pushd xapian-letor
1603         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1604         popd
1605     - name: configure
1606       run: |
1607         export CC='ccache gcc'
1608         export CXX='ccache g++'
1609         pushd xapian-core
1610         ./configure --enable-werror
1611         export XAPIAN_CONFIG=$PWD/xapian-config
1612         popd
1613         pushd xapian-applications/omega
1614         ./configure --enable-werror
1615         popd
1616         # pushd xapian-bindings
1617         # ./configure --enable-werror
1618         # popd
1619         pushd xapian-letor
1620         ./configure --enable-werror
1621         popd
1622     - name: make
1623       run: |
1624         make -j2 -C xapian-core
1625         make -j2 -C xapian-applications/omega
1626         # make -j2 -C xapian-bindings
1627         make -j2 -C xapian-letor
1628     - name: Run tests
1629       run: |
1630         export AUTOMATED_TESTING=1
1631         export VERBOSE=1
1632         make -j2 -C xapian-core check
1633         make -j2 -C xapian-applications/omega check
1634         # make -j2 -C xapian-bindings check
1635         make -j2 -C xapian-letor check
1637   msys2-mingw32:
1638     runs-on: 'windows-latest'
1639     needs: makedist
1640     defaults:
1641       run:
1642         shell: msys2 {0}
1643     steps:
1644     - uses: msys2/setup-msys2@v2
1645       with:
1646         msystem: mingw32
1647         install: base-devel
1648         pacboy: >-
1649           file:p
1650           gcc:p
1651           pcre2:p
1652           zlib:p
1653     - name: Install CCache
1654       uses: hendrikmuhs/ccache-action@v1
1655       with:
1656         key: ${{ github.job }}
1657         variant: sccache
1658     - name: Fetch distribution
1659       uses: actions/download-artifact@v4
1660     - name: Unpack distribution
1661       run: |
1662         mv artifact/* .
1663         rmdir artifact
1664         pushd xapian-core
1665         tar --strip-components=1 -xf xapian-core-*.tar.xz
1666         popd
1667         pushd xapian-applications/omega
1668         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1669         popd
1670         # pushd xapian-bindings
1671         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1672         # popd
1673         pushd xapian-letor
1674         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1675         popd
1676     - name: configure
1677       run: |
1678         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1679         export CC='sccache gcc'
1680         export CXX='sccache g++'
1681         pushd xapian-core
1682         ./configure --enable-werror
1683         export XAPIAN_CONFIG=$PWD/xapian-config
1684         popd
1685         pushd xapian-applications/omega
1686         ./configure --enable-werror
1687         popd
1688         # pushd xapian-bindings
1689         # ./configure --enable-werror
1690         # popd
1691         pushd xapian-letor
1692         ./configure --enable-werror
1693         popd
1694     - name: make
1695       run: |
1696         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1697         make -j2 -C xapian-core
1698         make -j2 -C xapian-applications/omega
1699         # make -j2 -C xapian-bindings
1700         make -j2 -C xapian-letor
1701     - name: Run tests
1702       run: |
1703         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1704         export AUTOMATED_TESTING=1
1705         export VERBOSE=1
1706         make -j2 -C xapian-core check
1707         # omindextest started to fail 2024-12-09 (last good run 2024-12-05),
1708         # apparently in omindex, with:
1709         #   *** stack smashing detected ***: terminated
1710         # Rerunning the last good run fails the same way so this appears to be
1711         # down to a bug introduced in one of the dependencies rather than a
1712         # bug in xapian-omega.  The 32-bit msys2 environments are deprecated
1713         # so this doesn't seem worth investing a lot of time into so just
1714         # replace omindextest with a simple script which skips this test.
1715         printf '#!/bin/sh\nexit 77\n' > xapian-applications/omega/omindextest
1716         chmod 755 xapian-applications/omega/omindextest
1717         make -j2 -C xapian-applications/omega check
1718         # make -j2 -C xapian-bindings check
1719         make -j2 -C xapian-letor check
1721   msys2-mingw64:
1722     runs-on: 'windows-latest'
1723     needs: makedist
1724     defaults:
1725       run:
1726         shell: msys2 {0}
1727     steps:
1728     - uses: msys2/setup-msys2@v2
1729       with:
1730         msystem: mingw64
1731         install: base-devel
1732         pacboy: >-
1733           file:p
1734           gcc:p
1735           pcre2:p
1736           zlib:p
1737     - name: Install CCache
1738       uses: hendrikmuhs/ccache-action@v1
1739       with:
1740         key: ${{ github.job }}
1741         variant: sccache
1742     - name: Fetch distribution
1743       uses: actions/download-artifact@v4
1744     - name: Unpack distribution
1745       run: |
1746         mv artifact/* .
1747         rmdir artifact
1748         pushd xapian-core
1749         tar --strip-components=1 -xf xapian-core-*.tar.xz
1750         popd
1751         pushd xapian-applications/omega
1752         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1753         popd
1754         # pushd xapian-bindings
1755         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1756         # popd
1757         pushd xapian-letor
1758         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1759         popd
1760     - name: configure
1761       run: |
1762         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1763         export CC='sccache gcc'
1764         export CXX='sccache g++'
1765         pushd xapian-core
1766         ./configure --enable-werror
1767         export XAPIAN_CONFIG=$PWD/xapian-config
1768         popd
1769         pushd xapian-applications/omega
1770         ./configure --enable-werror
1771         popd
1772         # pushd xapian-bindings
1773         # ./configure --enable-werror
1774         # popd
1775         pushd xapian-letor
1776         ./configure --enable-werror
1777         popd
1778     - name: make
1779       run: |
1780         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1781         make -j2 -C xapian-core
1782         make -j2 -C xapian-applications/omega
1783         # make -j2 -C xapian-bindings
1784         make -j2 -C xapian-letor
1785     - name: Run tests
1786       run: |
1787         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1788         export AUTOMATED_TESTING=1
1789         export VERBOSE=1
1790         make -j2 -C xapian-core check
1791         make -j2 -C xapian-applications/omega check
1792         # make -j2 -C xapian-bindings check
1793         make -j2 -C xapian-letor check
1795   msys2-ucrt64:
1796     runs-on: 'windows-latest'
1797     needs: makedist
1798     defaults:
1799       run:
1800         shell: msys2 {0}
1801     steps:
1802     - uses: msys2/setup-msys2@v2
1803       with:
1804         msystem: ucrt64
1805         install: base-devel
1806         pacboy: >-
1807           file:p
1808           gcc:p
1809           pcre2:p
1810           zlib:p
1811     - name: Install CCache
1812       uses: hendrikmuhs/ccache-action@v1
1813       with:
1814         key: ${{ github.job }}
1815         variant: sccache
1816     - name: Fetch distribution
1817       uses: actions/download-artifact@v4
1818     - name: Unpack distribution
1819       run: |
1820         mv artifact/* .
1821         rmdir artifact
1822         pushd xapian-core
1823         tar --strip-components=1 -xf xapian-core-*.tar.xz
1824         popd
1825         pushd xapian-applications/omega
1826         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1827         popd
1828         # pushd xapian-bindings
1829         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1830         # popd
1831         pushd xapian-letor
1832         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1833         popd
1834     - name: configure
1835       run: |
1836         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1837         export CC='sccache gcc'
1838         export CXX='sccache g++'
1839         pushd xapian-core
1840         ./configure --enable-werror
1841         export XAPIAN_CONFIG=$PWD/xapian-config
1842         popd
1843         pushd xapian-applications/omega
1844         ./configure --enable-werror
1845         popd
1846         # pushd xapian-bindings
1847         # ./configure --enable-werror
1848         # popd
1849         pushd xapian-letor
1850         ./configure --enable-werror
1851         popd
1852     - name: make
1853       run: |
1854         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1855         make -j2 -C xapian-core
1856         make -j2 -C xapian-applications/omega
1857         # make -j2 -C xapian-bindings
1858         make -j2 -C xapian-letor
1859     - name: Run tests
1860       run: |
1861         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1862         export AUTOMATED_TESTING=1
1863         export VERBOSE=1
1864         make -j2 -C xapian-core check
1865         make -j2 -C xapian-applications/omega check
1866         # make -j2 -C xapian-bindings check
1867         make -j2 -C xapian-letor check
1869   msvc2019:
1870     runs-on: 'windows-2019'
1871     needs: makedist
1872     defaults:
1873       run:
1874         shell: msys2 {0}
1875     steps:
1876     - uses: msys2/setup-msys2@v2
1877       with:
1878         release: true # Use the pre-installed MSYS2
1879         path-type: inherit
1880         install: base-devel
1881     - name: Install CCache
1882       uses: hendrikmuhs/ccache-action@v1
1883       with:
1884         key: ${{ github.job }}
1885         variant: sccache
1886     - name: Fetch distribution
1887       uses: actions/download-artifact@v4
1888     - name: Unpack distribution
1889       run: |
1890         mv artifact/* .
1891         rmdir artifact
1892         pushd xapian-core
1893         tar --strip-components=1 -xf xapian-core-*.tar.xz
1894         popd
1895         # Need libmagic for omega
1896         # pushd xapian-applications/omega
1897         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1898         # popd
1899         # pushd xapian-bindings
1900         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1901         # popd
1902         pushd xapian-letor
1903         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1904         popd
1905     - name: Set up Visual Studio shell
1906       uses: egor-tensin/vs-shell@v2
1907       with:
1908         arch: x64
1909     - name: Build zlib
1910       shell: bash
1911       run: |
1912         # Setup sccache for cl.
1913         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
1914         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1915         # We find "link" from coreutils rather than from MSVC.  The coreutils
1916         # "link" is not a useful tool to us, so just delete it rather than
1917         # trying to reorder PATH.
1918         rm /usr/bin/link.exe || true
1919         mkdir zlib
1920         pushd zlib
1921         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
1922         # Don't build zlib with -MD as it seems this flag needs to be used
1923         # consistently across the build.  Don't use -Zi -Fd"zlib" as
1924         # ccache/sccache don't seem to be able to handle that.
1925         #
1926         # Don't build zlib with a fixed base address on x64 as that gives
1927         # linker warning LNK4281.
1928         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
1929         # Only build the shared library.
1930         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
1931         popd
1932     - name: configure
1933       run: |
1934         export AR=lib
1935         export CC="cl -nologo"
1936         export CXX="$PWD/xapian-core/compile cl -nologo"
1937         export CPPFLAGS="-I$PWD/zlib"
1938         # Standard C++ stack unwinding; assume extern "C" functions never throw.
1939         export CXXFLAGS=-EHsc
1940         export LD=link
1941         export LDFLAGS="-L$PWD/zlib"
1942         export NM=dumpbin
1943         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1944         pushd xapian-core
1945         ./configure --enable-werror --disable-shared
1946         export XAPIAN_CONFIG=$PWD/xapian-config
1947         popd
1948         # pushd xapian-applications/omega
1949         # ./configure --enable-werror
1950         # popd
1951         # pushd xapian-bindings
1952         # ./configure --enable-werror
1953         # popd
1954         pushd xapian-letor
1955         ./configure --enable-werror --disable-shared
1956         popd
1957     - name: make
1958       run: |
1959         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1960         make -j2 -C xapian-core
1961         # make -j2 -C xapian-applications/omega
1962         # make -j2 -C xapian-bindings
1963         make -j2 -C xapian-letor
1964     - name: Run tests
1965       run: |
1966         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1967         export AUTOMATED_TESTING=1
1968         export VERBOSE=1
1969         make -j2 -C xapian-core check
1970         # make -j2 -C xapian-applications/omega check
1971         # make -j2 -C xapian-bindings check
1972         make -j2 -C xapian-letor check
1974   msvc2022:
1975     runs-on: 'windows-2022'
1976     needs: makedist
1977     defaults:
1978       run:
1979         shell: msys2 {0}
1980     steps:
1981     - uses: msys2/setup-msys2@v2
1982       with:
1983         release: true # Use the pre-installed MSYS2
1984         path-type: inherit
1985         install: base-devel
1986     - name: Install CCache
1987       uses: hendrikmuhs/ccache-action@v1
1988       with:
1989         key: ${{ github.job }}
1990         variant: sccache
1991     - name: Fetch distribution
1992       uses: actions/download-artifact@v4
1993     - name: Unpack distribution
1994       run: |
1995         mv artifact/* .
1996         rmdir artifact
1997         pushd xapian-core
1998         tar --strip-components=1 -xf xapian-core-*.tar.xz
1999         popd
2000         # Need libmagic for omega
2001         # pushd xapian-applications/omega
2002         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
2003         # popd
2004         # pushd xapian-bindings
2005         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2006         # popd
2007         pushd xapian-letor
2008         tar --strip-components=1 -xf xapian-letor-*.tar.xz
2009         popd
2010     - name: Set up Visual Studio shell
2011       uses: egor-tensin/vs-shell@v2
2012       with:
2013         arch: x64
2014     - name: Build zlib
2015       shell: bash
2016       run: |
2017         # Setup sccache for cl.
2018         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
2019         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2020         # We find "link" from coreutils rather than from MSVC.  The coreutils
2021         # "link" is not a useful tool to us, so just delete it rather than
2022         # trying to reorder PATH.
2023         rm /usr/bin/link.exe || true
2024         mkdir zlib
2025         pushd zlib
2026         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2027         # Don't build zlib with -MD as it seems this flag needs to be used
2028         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2029         # ccache/sccache don't seem to be able to handle that.
2030         #
2031         # Don't build zlib with a fixed base address on x64 as that gives
2032         # linker warning LNK4281.
2033         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
2034         # Only build the shared library.
2035         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
2036         popd
2037     - name: configure
2038       run: |
2039         export AR=lib
2040         export CC="cl -nologo"
2041         export CXX="$PWD/xapian-core/compile cl -nologo"
2042         export CPPFLAGS="-I$PWD/zlib"
2043         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2044         export CXXFLAGS=-EHsc
2045         export LD=link
2046         export LDFLAGS="-L$PWD/zlib"
2047         export NM=dumpbin
2048         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2049         pushd xapian-core
2050         ./configure --enable-werror --disable-shared
2051         export XAPIAN_CONFIG=$PWD/xapian-config
2052         popd
2053         # pushd xapian-applications/omega
2054         # ./configure --enable-werror
2055         # popd
2056         # pushd xapian-bindings
2057         # ./configure --enable-werror
2058         # popd
2059         pushd xapian-letor
2060         ./configure --enable-werror --disable-shared
2061         popd
2062     - name: make
2063       run: |
2064         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2065         make -j2 -C xapian-core
2066         # make -j2 -C xapian-applications/omega
2067         # make -j2 -C xapian-bindings
2068         make -j2 -C xapian-letor
2069     - name: Run tests
2070       run: |
2071         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2072         export AUTOMATED_TESTING=1
2073         export VERBOSE=1
2074         make -j2 -C xapian-core check
2075         # make -j2 -C xapian-applications/omega check
2076         # make -j2 -C xapian-bindings check
2077         make -j2 -C xapian-letor check
2079   msvc2019-x86:
2080     runs-on: 'windows-2019'
2081     needs: makedist
2082     defaults:
2083       run:
2084         shell: msys2 {0}
2085     steps:
2086     - uses: msys2/setup-msys2@v2
2087       with:
2088         release: true # Use the pre-installed MSYS2
2089         path-type: inherit
2090         install: base-devel
2091     - name: Install CCache
2092       uses: hendrikmuhs/ccache-action@v1
2093       with:
2094         key: ${{ github.job }}
2095         variant: sccache
2096     - name: Fetch distribution
2097       uses: actions/download-artifact@v4
2098     - name: Unpack distribution
2099       run: |
2100         mv artifact/* .
2101         rmdir artifact
2102         pushd xapian-core
2103         tar --strip-components=1 -xf xapian-core-*.tar.xz
2104         popd
2105         # Need libmagic for omega
2106         # pushd xapian-applications/omega
2107         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
2108         # popd
2109         # pushd xapian-bindings
2110         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2111         # popd
2112         pushd xapian-letor
2113         tar --strip-components=1 -xf xapian-letor-*.tar.xz
2114         popd
2115     - name: Set up Visual Studio shell
2116       uses: egor-tensin/vs-shell@v2
2117       with:
2118         arch: x86
2119     - name: Build zlib
2120       shell: bash
2121       run: |
2122         # Setup sccache for cl.
2123         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
2124         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2125         # We find "link" from coreutils rather than from MSVC.  The coreutils
2126         # "link" is not a useful tool to us, so just delete it rather than
2127         # trying to reorder PATH.
2128         rm /usr/bin/link.exe || true
2129         mkdir zlib
2130         pushd zlib
2131         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2132         # Don't build zlib with -MD as it seems this flag needs to be used
2133         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2134         # ccache/sccache don't seem to be able to handle that.
2135         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/' win32/Makefile.msc
2136         # Only build the static library.
2137         nmake -nologo -f 'win32\Makefile.msc' zlib.lib
2138         popd
2139     - name: configure
2140       run: |
2141         export AR=lib
2142         export CC="cl -nologo"
2143         export CXX="$PWD/xapian-core/compile cl -nologo"
2144         export CPPFLAGS="-I$PWD/zlib"
2145         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2146         export CXXFLAGS=-EHsc
2147         export LD=link
2148         export LDFLAGS="-L$PWD/zlib"
2149         export NM=dumpbin
2150         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2151         pushd xapian-core
2152         ./configure --enable-werror --disable-shared
2153         export XAPIAN_CONFIG=$PWD/xapian-config
2154         popd
2155         # pushd xapian-applications/omega
2156         # ./configure --enable-werror
2157         # popd
2158         # pushd xapian-bindings
2159         # ./configure --enable-werror
2160         # popd
2161         pushd xapian-letor
2162         ./configure --enable-werror --disable-shared
2163         popd
2164     - name: make
2165       run: |
2166         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2167         make -j2 -C xapian-core
2168         # make -j2 -C xapian-applications/omega
2169         # make -j2 -C xapian-bindings
2170         make -j2 -C xapian-letor
2171     - name: Run tests
2172       run: |
2173         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2174         export AUTOMATED_TESTING=1
2175         export VERBOSE=1
2176         make -j2 -C xapian-core check
2177         # make -j2 -C xapian-applications/omega check
2178         # make -j2 -C xapian-bindings check
2179         make -j2 -C xapian-letor check
2181   msvc2022-x86:
2182     runs-on: 'windows-2022'
2183     needs: makedist
2184     defaults:
2185       run:
2186         shell: msys2 {0}
2187     steps:
2188     - uses: msys2/setup-msys2@v2
2189       with:
2190         release: true # Use the pre-installed MSYS2
2191         path-type: inherit
2192         install: base-devel
2193     - name: Install CCache
2194       uses: hendrikmuhs/ccache-action@v1
2195       with:
2196         key: ${{ github.job }}
2197         variant: sccache
2198     - name: Fetch distribution
2199       uses: actions/download-artifact@v4
2200     - name: Unpack distribution
2201       run: |
2202         mv artifact/* .
2203         rmdir artifact
2204         pushd xapian-core
2205         tar --strip-components=1 -xf xapian-core-*.tar.xz
2206         popd
2207         # Need libmagic for omega
2208         # pushd xapian-applications/omega
2209         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
2210         # popd
2211         # pushd xapian-bindings
2212         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2213         # popd
2214         pushd xapian-letor
2215         tar --strip-components=1 -xf xapian-letor-*.tar.xz
2216         popd
2217     - name: Set up Visual Studio shell
2218       uses: egor-tensin/vs-shell@v2
2219       with:
2220         arch: x86
2221     - name: Build zlib
2222       shell: bash
2223       run: |
2224         # Setup sccache for cl.
2225         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
2226         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2227         # We find "link" from coreutils rather than from MSVC.  The coreutils
2228         # "link" is not a useful tool to us, so just delete it rather than
2229         # trying to reorder PATH.
2230         rm /usr/bin/link.exe || true
2231         mkdir zlib
2232         pushd zlib
2233         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2234         # Don't build zlib with -MD as it seems this flag needs to be used
2235         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2236         # ccache/sccache don't seem to be able to handle that.
2237         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/' win32/Makefile.msc
2238         # Only build the static library.
2239         nmake -nologo -f 'win32\Makefile.msc' zlib.lib
2240         popd
2241     - name: configure
2242       run: |
2243         export AR=lib
2244         export CC="cl -nologo"
2245         export CXX="$PWD/xapian-core/compile cl -nologo"
2246         export CPPFLAGS="-I$PWD/zlib"
2247         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2248         export CXXFLAGS=-EHsc
2249         export LD=link
2250         export LDFLAGS="-L$PWD/zlib"
2251         export NM=dumpbin
2252         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2253         pushd xapian-core
2254         ./configure --enable-werror --disable-shared
2255         export XAPIAN_CONFIG=$PWD/xapian-config
2256         popd
2257         # pushd xapian-applications/omega
2258         # ./configure --enable-werror
2259         # popd
2260         # pushd xapian-bindings
2261         # ./configure --enable-werror
2262         # popd
2263         pushd xapian-letor
2264         ./configure --enable-werror --disable-shared
2265         popd
2266     - name: make
2267       run: |
2268         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2269         make -j2 -C xapian-core
2270         # make -j2 -C xapian-applications/omega
2271         # make -j2 -C xapian-bindings
2272         make -j2 -C xapian-letor
2273     - name: Run tests
2274       run: |
2275         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2276         export AUTOMATED_TESTING=1
2277         export VERBOSE=1
2278         make -j2 -C xapian-core check
2279         # make -j2 -C xapian-applications/omega check
2280         # make -j2 -C xapian-bindings check
2281         make -j2 -C xapian-letor check
2283   freebsd:
2284     runs-on: 'ubuntu-22.04'
2285     needs: makedist
2286     steps:
2287     - name: Install CCache
2288       uses: hendrikmuhs/ccache-action@v1
2289       with:
2290         key: ${{ github.job }}
2291     - name: Fetch distribution
2292       uses: actions/download-artifact@v4
2293     - name: Unpack distribution
2294       run: |
2295         mv artifact/* .
2296         rmdir artifact
2297         # Do actual unpacking in the VM, mostly to help reduce the size of the
2298         # rsync output in the logs.
2299     - uses: vmactions/freebsd-vm@v1
2300       # Limit wasted resources if the VM action gets into an infinite loop.
2301       timeout-minutes: 60
2302       with:
2303         # The default is csh!
2304         usesh: true
2305         prepare: |
2306           set -e
2307           pkg install -y bash ccache lua54 openjdk17 openjdk17-jre perl5 php82 pcre2 pkgconf py311-sphinx python3 ruby rubygem-rdoc rubygem-test-unit tcl86
2308           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2309           ccache --set-config=max_size='500M'
2310           ccache --set-config=compression=true
2311         run: |
2312           set -e
2313           export CC='ccache cc'
2314           export CXX='ccache c++'
2315           export JAVA_HOME=/usr/local/openjdk17
2316           export TCLSH=tclsh8.6
2317           mv xapian-* "$HOME"
2318           cd
2319           cd xapian-core
2320           tar --strip-components=1 -xf xapian-core-*.tar.xz
2321           ./configure --enable-werror
2322           export XAPIAN_CONFIG=$PWD/xapian-config
2323           cd ..
2324           cd xapian-applications/omega
2325           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2326           ./configure --enable-werror
2327           cd ../..
2328           cd xapian-bindings
2329           tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2330           ./configure --enable-werror --with-java --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
2331           cd ..
2332           cd xapian-letor
2333           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2334           ./configure --enable-werror
2335           cd ..
2336           # Everything gets run in one script so use V=0 to reduce the size of
2337           # the log, but re-run without V=0 on failure to show the compiler
2338           # command line.
2339           make -j2 -C xapian-core V=0 || make -C xapian-core
2340           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2341           make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2342           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2343           export AUTOMATED_TESTING=1
2344           export VERBOSE=1
2345           make -j2 -C xapian-core check V=0
2346           make -j2 -C xapian-applications/omega check V=0
2347           make -j2 -C xapian-bindings check V=0
2348           make -j2 -C xapian-letor check V=0
2350   dragonfly:
2351     runs-on: 'ubuntu-22.04'
2352     needs: makedist
2353     steps:
2354     - name: Install CCache
2355       uses: hendrikmuhs/ccache-action@v1
2356       with:
2357         key: ${{ github.job }}
2358     - name: Fetch distribution
2359       uses: actions/download-artifact@v4
2360     - name: Unpack distribution
2361       run: |
2362         mv artifact/* .
2363         rmdir artifact
2364         # Do actual unpacking in the VM, mostly to help reduce the size of the
2365         # rsync output in the logs.
2366     - uses: vmactions/dragonflybsd-vm@v1
2367       # Limit wasted resources if the VM action gets into an infinite loop.
2368       timeout-minutes: 60
2369       with:
2370         # The default is csh!
2371         usesh: true
2372         prepare: |
2373           set -e
2374           pkg install -y bash ccache lua54 openjdk17 openjdk17-jre perl5 php82 pcre2 pkgconf py39-sphinx python3 ruby rubygem-rdoc rubygem-test-unit tcl86
2375           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2376           ccache --set-config=max_size='500M'
2377           ccache --set-config=compression=true
2378         run: |
2379           set -e
2380           export CC='ccache cc'
2381           export CXX='ccache c++'
2382           export JAVA_HOME=/usr/local/openjdk17
2383           export TCLSH=tclsh8.6
2384           mv xapian-* "$HOME"
2385           cd
2386           cd xapian-core
2387           tar --strip-components=1 -xf xapian-core-*.tar.xz
2388           ./configure --enable-werror
2389           export XAPIAN_CONFIG=$PWD/xapian-config
2390           cd ..
2391           cd xapian-applications/omega
2392           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2393           ./configure --enable-werror
2394           cd ../..
2395           cd xapian-bindings
2396           tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2397           ./configure --enable-werror --with-java --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
2398           cd ..
2399           cd xapian-letor
2400           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2401           ./configure --enable-werror
2402           cd ..
2403           # Everything gets run in one script so use V=0 to reduce the size of
2404           # the log, but re-run without V=0 on failure to show the compiler
2405           # command line.
2406           make -j2 -C xapian-core V=0 || make -C xapian-core
2407           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2408           make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2409           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2410           export AUTOMATED_TESTING=1
2411           export VERBOSE=1
2412           make -j2 -C xapian-core check V=0
2413           make -j2 -C xapian-applications/omega check V=0
2414           make -j2 -C xapian-bindings check V=0
2415           make -j2 -C xapian-letor check V=0
2417   netbsd:
2418     runs-on: 'ubuntu-22.04'
2419     needs: makedist
2420     steps:
2421     - name: Install CCache
2422       uses: hendrikmuhs/ccache-action@v1
2423       with:
2424         key: ${{ github.job }}
2425     - name: Fetch distribution
2426       uses: actions/download-artifact@v4
2427     - name: Unpack distribution
2428       run: |
2429         mv artifact/* .
2430         rmdir artifact
2431         # Do actual unpacking in the VM, mostly to help reduce the size of the
2432         # rsync output in the logs.
2433     - uses: vmactions/netbsd-vm@v1
2434       # Limit wasted resources if the VM action gets into an infinite loop.
2435       timeout-minutes: 60
2436       with:
2437         # Default is ksh, which should be OK.
2438         # usesh: true
2439         prepare: |
2440           set -e
2441           /usr/sbin/pkg_add -u ccache perl pcre2
2442           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2443           ccache --set-config=max_size='500M'
2444           ccache --set-config=compression=true
2445         run: |
2446           set -e
2447           ulimit
2448           export CC='ccache cc'
2449           export CXX='ccache c++'
2450           mv xapian-* "$HOME"
2451           cd
2452           cd xapian-core
2453           tar --strip-components=1 -xf xapian-core-*.tar.xz
2454           ./configure --enable-werror
2455           export XAPIAN_CONFIG=$PWD/xapian-config
2456           cd ..
2457           cd xapian-applications/omega
2458           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2459           ./configure --enable-werror
2460           cd ../..
2461           # cd xapian-bindings
2462           # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2463           # cd ..
2464           cd xapian-letor
2465           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2466           ./configure --enable-werror
2467           cd ..
2468           # Everything gets run in one script so use V=0 to reduce the size of
2469           # the log, but re-run without V=0 on failure to show the compiler
2470           # command line.
2471           make -j2 -C xapian-core V=0 || make -C xapian-core
2472           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2473           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2474           export AUTOMATED_TESTING=1
2475           export VERBOSE=1
2476           make -j2 -C xapian-core check V=0
2477           make -j2 -C xapian-applications/omega check V=0
2478           make -j2 -C xapian-letor check V=0
2479           # Avoid bloating output with a huge file tree visualisation.
2480           rm -rf xapian-*
2482   openbsd:
2483     runs-on: 'ubuntu-22.04'
2484     needs: makedist
2485     steps:
2486     - name: Install CCache
2487       uses: hendrikmuhs/ccache-action@v1
2488       with:
2489         key: ${{ github.job }}
2490     - name: Fetch distribution
2491       uses: actions/download-artifact@v4
2492     - name: Unpack distribution
2493       run: |
2494         mv artifact/* .
2495         rmdir artifact
2496         # Do actual unpacking in the VM, mostly to help reduce the size of the
2497         # rsync output in the logs.
2498     - uses: vmactions/openbsd-vm@v1
2499       # Limit wasted resources if the VM action gets into an infinite loop.
2500       timeout-minutes: 60
2501       with:
2502         # Default is ksh, which should be OK.
2503         # usesh: true
2504         prepare: |
2505           set -e
2506           pkg_add ccache gtar-- libmagic
2507           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2508           ccache --set-config=max_size='500M'
2509           ccache --set-config=compression=true
2510         run: |
2511           set -e
2512           export CC='ccache cc'
2513           export CXX='ccache c++'
2514           mv xapian-* "$HOME"
2515           cd
2516           cd xapian-core
2517           gtar --strip-components=1 -xf xapian-core-*.tar.xz
2518           ./configure --enable-werror
2519           export XAPIAN_CONFIG=$PWD/xapian-config
2520           $XAPIAN_CONFIG --ltlibs || true
2521           $XAPIAN_CONFIG --libs || true
2522           $XAPIAN_CONFIG --cxxflags || true
2523           cd ..
2524           cd xapian-applications/omega
2525           gtar --strip-components=1 -xf xapian-omega-*.tar.xz
2526           ./configure --enable-werror
2527           cd ../..
2528           # cd xapian-bindings
2529           # gtar --strip-components=1 -xf xapian-bindings-*.tar.xz
2530           # ./configure --enable-werror
2531           # cd ..
2532           cd xapian-letor
2533           gtar --strip-components=1 -xf xapian-letor-*.tar.xz
2534           ./configure --enable-werror
2535           cd ..
2536           # Everything gets run in one script so use V=0 to reduce the size of
2537           # the log, but re-run without V=0 on failure to show the compiler
2538           # command line.
2539           make -j2 -C xapian-core V=0 || make -C xapian-core
2540           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2541           # make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2542           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2543           export AUTOMATED_TESTING=1
2544           export VERBOSE=1
2545           make -j2 -C xapian-core check V=0
2546           make -j2 -C xapian-applications/omega check V=0
2547           # make -j2 -C xapian-bindings check V=0
2548           make -j2 -C xapian-letor check V=0
2549           # Avoid bloating output with a huge file tree visualisation.
2550           rm -rf xapian-*
2552   checkpatch:
2553     name: 'Automated run of xapian-check-patch'
2554     runs-on: 'ubuntu-latest'
2555     steps:
2556     - name: Check out repository code
2557       uses: actions/checkout@v4
2558       with:
2559         fetch-depth: 0
2560         show-progress: false
2561     - name: "Automated run of xapian-check-patch"
2562       # Run the style checking script, checking changes between the common
2563       # ancestor of the target branch of the PR (or master if this isn't a PR)
2564       # and the revision being checked.
2565       run: |
2566         case ${GITHUB_BASE_REF:+PR}:`git remote get-url origin` in
2567           PR:*)
2568             BASE=origin/$GITHUB_BASE_REF ;;
2569           :https://github.com/xapian/xapian)
2570             BASE=origin/master ;;
2571           *)
2572             git remote add xapian https://github.com/xapian/xapian.git
2573             git fetch --no-tags xapian master
2574             BASE=xapian/master ;;
2575         esac
2576         git diff "${BASE}.." --|xapian-maintainer-tools/xapian-check-patch