Doc: update queries.sgml for optional subquery aliases.
[pgsql.git] / .cirrus.yml
blobf31923333ef979d47905a560d472c86656879817
1 # CI configuration file for CI utilizing cirrus-ci.org
3 # For instructions on how to enable the CI integration in a repository and
4 # further details, see src/tools/ci/README
7 env:
8   # Source of images / containers
9   GCP_PROJECT: pg-ci-images
10   IMAGE_PROJECT: $GCP_PROJECT
11   CONTAINER_REPO: us-docker.pkg.dev/${GCP_PROJECT}/ci
13   # The lower depth accelerates git clone. Use a bit of depth so that
14   # concurrent tasks and retrying older jobs has a chance of working.
15   CIRRUS_CLONE_DEPTH: 500
16   # Useful to be able to analyse what in a script takes long
17   CIRRUS_LOG_TIMESTAMP: true
19   CCACHE_MAXSIZE: "250M"
21   # target to test, for all but windows
22   CHECK: check-world PROVE_FLAGS=$PROVE_FLAGS
23   CHECKFLAGS: -Otarget
24   PROVE_FLAGS: --timer
25   MTEST_ARGS: --print-errorlogs --no-rebuild -C build
26   PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
27   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
28   PG_TEST_EXTRA: kerberos ldap ssl
31 # What files to preserve in case tests fail
32 on_failure_ac: &on_failure_ac
33   log_artifacts:
34     paths:
35       - "**/*.log"
36       - "**/*.diffs"
37       - "**/regress_log_*"
38     type: text/plain
40 on_failure_meson: &on_failure_meson
41   testrun_artifacts:
42     paths:
43       - "build*/testrun/**/*.log"
44       - "build*/testrun/**/*.diffs"
45       - "build*/testrun/**/regress_log_*"
46     type: text/plain
48   # In theory it'd be nice to upload the junit files meson generates, so that
49   # cirrus will nicely annotate the commit. Unfortunately the files don't
50   # contain identifieable file + line numbers right now, so the annotations
51   # don't end up useful. We could probably improve on that with a some custom
52   # conversion script, but ...
53   meson_log_artifacts:
54     path: "build*/meson-logs/*.txt"
55     type: text/plain
58 # To avoid unnecessarily spinning up a lot of VMs / containers for entirely
59 # broken commits, have a minimal task that all others depend on.
60 task:
61   name: SanityCheck
63   # If a specific OS is requested, don't run the sanity check. This shortens
64   # push-wait-for-ci cycle time a bit when debugging operating system specific
65   # failures. Uses skip instead of only_if, as cirrus otherwise warns about
66   # only_if conditions not matching.
67   skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
69   env:
70     CPUS: 4
71     BUILD_JOBS: 8
72     TEST_JOBS: 8
73     CCACHE_DIR: ${CIRRUS_WORKING_DIR}/ccache_dir
74     # no options enabled, should be small
75     CCACHE_MAXSIZE: "150M"
77   # Container starts up quickly, but is slower at runtime, particularly for
78   # tests. Good for the briefly running sanity check.
79   container:
80     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
81     cpu: $CPUS
83   ccache_cache:
84     folder: $CCACHE_DIR
86   create_user_script: |
87     useradd -m postgres
88     chown -R postgres:postgres .
89     mkdir -p ${CCACHE_DIR}
90     chown -R postgres:postgres ${CCACHE_DIR}
91     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
92     su postgres -c "ulimit -l -H && ulimit -l -S"
93     # Can't change container's kernel.core_pattern. Postgres user can't write
94     # to / normally. Change that.
95     chown root:postgres /
96     chmod g+rwx /
98   configure_script: |
99     su postgres <<-EOF
100       meson setup \
101         --buildtype=debug \
102         --auto-features=disabled \
103         -Dtap_tests=enabled \
104         build
105     EOF
106   build_script: |
107     su postgres <<-EOF
108       ninja -C build -j${BUILD_JOBS}
109     EOF
110   upload_caches: ccache
112   # Run a minimal set of tests. The main regression tests take too long for
113   # this purpose. For now this is a random quick pg_regress style test, and a
114   # tap test that exercises both a frontend binary and the backend.
115   test_minimal_script: |
116     su postgres <<-EOF
117       ulimit -c unlimited
118       meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
119         tmp_install cube/regress pg_ctl/001_start_stop
120     EOF
122   on_failure:
123     <<: *on_failure_meson
124     cores_script: |
125       mkdir -m 770 /tmp/cores
126       find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
127       src/tools/ci/cores_backtrace.sh linux /tmp/cores
130 task:
131   name: FreeBSD - 13 - Meson
133   env:
134     # FreeBSD on GCP is slow when running with larger number of CPUS /
135     # jobs. Using one more job than cpus seems to work best.
136     CPUS: 2
137     BUILD_JOBS: 3
138     TEST_JOBS: 3
140     CCACHE_DIR: /tmp/ccache_dir
141     CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST
142     CFLAGS: -Og -ggdb
144   depends_on: SanityCheck
145   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
147   compute_engine_instance:
148     image_project: $IMAGE_PROJECT
149     image: family/pg-ci-freebsd-13
150     platform: freebsd
151     cpu: $CPUS
152     memory: 4G
153     disk: 50
155   sysinfo_script: |
156     id
157     uname -a
158     ulimit -a -H && ulimit -a -S
159     export
161   ccache_cache:
162     folder: $CCACHE_DIR
163   # Workaround around performance issues due to 32KB block size
164   repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
165   create_user_script: |
166     pw useradd postgres
167     chown -R postgres:postgres .
168     mkdir -p ${CCACHE_DIR}
169     chown -R postgres:postgres ${CCACHE_DIR}
170   setup_core_files_script: |
171     mkdir -m 770 /tmp/cores
172     chown root:postgres /tmp/cores
173     sysctl kern.corefile='/tmp/cores/%N.%P.core'
174   setup_additional_packages_script: |
175     #pkg install -y ...
177   # NB: Intentionally build without -Dllvm. The freebsd image size is already
178   # large enough to make VM startup slow, and even without llvm freebsd
179   # already takes longer than other platforms except for windows.
180   configure_script: |
181     su postgres <<-EOF
182       meson setup \
183         --buildtype=debug \
184         -Dcassert=true -Dssl=openssl -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
185         -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
186         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
187         build
188     EOF
189   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
190   upload_caches: ccache
192   test_world_script: |
193     su postgres <<-EOF
194       ulimit -c unlimited
195       meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
196     EOF
198   on_failure:
199     <<: *on_failure_meson
200     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
203 # configure feature flags, shared between the task running the linux tests and
204 # the CompilerWarnings task
205 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
206   --with-gssapi
207   --with-icu
208   --with-ldap
209   --with-libxml
210   --with-libxslt
211   --with-llvm
212   --with-lz4
213   --with-pam
214   --with-perl
215   --with-python
216   --with-selinux
217   --with-ssl=openssl
218   --with-systemd
219   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
220   --with-uuid=ossp
221   --with-zstd
223 LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
224   -Dllvm=enabled
225   -Dssl=openssl
226   -Duuid=e2fs
229 task:
230   env:
231     CPUS: 4
232     BUILD_JOBS: 4
233     TEST_JOBS: 8 # experimentally derived to be a decent choice
235     CCACHE_DIR: /tmp/ccache_dir
236     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
238     # Enable a reasonable set of sanitizers. Use the linux task for that, as
239     # it one of the fastest tasks (without sanitizers). Also several of the
240     # sanitizers work best on linux.
241     #
242     # The overhead of alignment sanitizer is low, undefined behaviour has
243     # moderate overhead. Test alignment sanitizer in the meson task, as it
244     # does both 32 and 64 bit builds and is thus more likely to expose
245     # alignment bugs.
246     #
247     # Address sanitizer in contrast is somewhat expensive. Enable it in the
248     # autoconf task, as the meson task tests both 32 and 64bit.
249     #
250     # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
251     # print_stacktraces=1,verbosity=2, duh
252     # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
253     UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
254     ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
256     # SANITIZER_FLAGS is set in the tasks below
257     CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
258     CXXFLAGS: $CFLAGS
259     LDFLAGS: $SANITIZER_FLAGS
260     CC: ccache gcc
261     CXX: ccache g++
263     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
264     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
266   depends_on: SanityCheck
267   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
269   compute_engine_instance:
270     image_project: $IMAGE_PROJECT
271     image: family/pg-ci-bullseye
272     platform: linux
273     cpu: $CPUS
274     memory: 4G
276   ccache_cache:
277     folder: ${CCACHE_DIR}
279   sysinfo_script: |
280     id
281     uname -a
282     cat /proc/cmdline
283     ulimit -a -H && ulimit -a -S
284     export
285   create_user_script: |
286     useradd -m postgres
287     chown -R postgres:postgres .
288     mkdir -p ${CCACHE_DIR}
289     chown -R postgres:postgres ${CCACHE_DIR}
290     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
291     su postgres -c "ulimit -l -H && ulimit -l -S"
292   setup_core_files_script: |
293     mkdir -m 770 /tmp/cores
294     chown root:postgres /tmp/cores
295     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
296   setup_additional_packages_script: |
297     #apt-get update
298     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
300   matrix:
301     - name: Linux - Debian Bullseye - Autoconf
303       env:
304         SANITIZER_FLAGS: -fsanitize=address
306       configure_script: |
307         su postgres <<-EOF
308           ./configure \
309             --enable-cassert --enable-debug --enable-tap-tests \
310             --enable-nls \
311             \
312             ${LINUX_CONFIGURE_FEATURES} \
313             \
314             CLANG="ccache clang"
315         EOF
316       build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
317       upload_caches: ccache
319       test_world_script: |
320         su postgres <<-EOF
321           ulimit -c unlimited # default is 0
322           make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
323         EOF
325       on_failure:
326         <<: *on_failure_ac
328     - name: Linux - Debian Bullseye - Meson
330       env:
331         CCACHE_MAXSIZE: "400M" # tests two different builds
332         SANITIZER_FLAGS: -fsanitize=alignment,undefined
334       configure_script: |
335         su postgres <<-EOF
336           meson setup \
337             --buildtype=debug \
338             -Dcassert=true \
339             ${LINUX_MESON_FEATURES} \
340             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
341             build
342         EOF
344       # Also build & test in a 32bit build - it's gotten rare to test that
345       # locally.
346       configure_32_script: |
347         su postgres <<-EOF
348           export CC='ccache gcc -m32'
349           meson setup \
350             --buildtype=debug \
351             -Dcassert=true \
352             ${LINUX_MESON_FEATURES} \
353             -Dllvm=disabled \
354             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
355             -DPERL=perl5.32-i386-linux-gnu \
356             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
357             build-32
358         EOF
360       build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
361       build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS}'
363       upload_caches: ccache
365       test_world_script: |
366         su postgres <<-EOF
367           ulimit -c unlimited
368           meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
369         EOF
370         # so that we don't upload 64bit logs if 32bit fails
371         rm -rf build/
373       # There's currently no coverage of icu with LANG=C in the buildfarm. We
374       # can easily provide some here by running one of the sets of tests that
375       # way. Newer versions of python insist on changing the LC_CTYPE away
376       # from C, prevent that with PYTHONCOERCECLOCALE.
377       test_world_32_script: |
378         su postgres <<-EOF
379           ulimit -c unlimited
380           PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
381         EOF
383       on_failure:
384         <<: *on_failure_meson
386   on_failure:
387     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
390 task:
391   name: macOS - Monterey - Meson
393   env:
394     CPUS: 12 # always get that much for cirrusci macOS instances
395     BUILD_JOBS: $CPUS
396     # Test performance regresses noticably when using all cores. 8 seems to
397     # work OK. See
398     # https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
399     TEST_JOBS: 8
401     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
402     CCACHE_DIR: ${HOME}/ccache
403     HOMEBREW_CACHE: ${HOME}/homebrew-cache
404     PERL5LIB: ${HOME}/perl5/lib/perl5
406     CC: ccache cc
407     CXX: ccache c++
408     CPPFLAGS: -DRANDOMIZE_ALLOCATED_MEMORY
409     CFLAGS: -Og -ggdb
410     CXXFLAGS: -Og -ggdb
412   depends_on: SanityCheck
413   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
415   osx_instance:
416     image: monterey-base
418   sysinfo_script: |
419     id
420     uname -a
421     ulimit -a -H && ulimit -a -S
422     export
424   setup_core_files_script:
425     - mkdir ${HOME}/cores
426     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
428   perl_cache:
429     folder: ~/perl5
430   cpan_install_script:
431     - perl -mIPC::Run -e 1 || cpan -T IPC::Run
432     - perl -mIO::Pty -e 1 || cpan -T IO::Pty
433   upload_caches: perl
436   # XXX: Could we instead install homebrew into a cached directory? The
437   # homebrew installation takes a good bit of time every time, even if the
438   # packages do not need to be downloaded.
439   homebrew_cache:
440     folder: $HOMEBREW_CACHE
441   setup_additional_packages_script: |
442     brew install \
443       ccache \
444       icu4c \
445       krb5 \
446       llvm \
447       lz4 \
448       make \
449       meson \
450       openldap \
451       openssl \
452       python \
453       tcl-tk \
454       zstd
456     brew cleanup -s # to reduce cache size
457   upload_caches: homebrew
459   ccache_cache:
460     folder: $CCACHE_DIR
461   configure_script: |
462     brewpath="/usr/local"
463     PKG_CONFIG_PATH="${brewpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
465     for pkg in icu4c krb5 openldap openssl zstd ; do
466       pkgpath="${brewpath}/opt/${pkg}"
467       PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
468       PATH="${pkgpath}/bin:${pkgpath}/sbin:$PATH"
469     done
471     export PKG_CONFIG_PATH PATH
473     meson setup \
474       --buildtype=debug \
475       -Dextra_include_dirs=${brewpath}/include \
476       -Dextra_lib_dirs=${brewpath}/lib \
477       -Dcassert=true \
478       -Dssl=openssl -Duuid=e2fs -Ddtrace=auto \
479       -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
480       build
482   build_script: ninja -C build -j${BUILD_JOBS}
483   upload_caches: ccache
485   test_world_script: |
486     ulimit -c unlimited # default is 0
487     ulimit -n 1024 # default is 256, pretty low
488     meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
490   on_failure:
491     <<: *on_failure_meson
492     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
495 WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
496   env:
497     # Half the allowed per-user CPU cores
498     CPUS: 4
500     # The default cirrus working dir is in a directory msbuild complains about
501     CIRRUS_WORKING_DIR: "c:/cirrus"
502     # git's tar doesn't deal with drive letters, see
503     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
504     TAR: "c:/windows/system32/tar.exe"
505     # Avoids port conflicts between concurrent tap test runs
506     PG_TEST_USE_UNIX_SOCKETS: 1
507     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
509   sysinfo_script: |
510     chcp
511     systeminfo
512     powershell -Command get-psdrive -psprovider filesystem
513     set
516 task:
517   name: Windows - Server 2019, VS 2019 - Meson & ninja
518   << : *WINDOWS_ENVIRONMENT_BASE
520   env:
521     TEST_JOBS: 8 # wild guess, data based value welcome
523     # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
524     # prevents crash reporting from working unless binaries do SetErrorMode()
525     # themselves. Furthermore, it appears that either python or, more likely,
526     # the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
527     # occasionally *trigger* a crash on process exit - which is hard to debug,
528     # given that it explicitly prevents crash dumps from working...
529     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
530     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
532   depends_on: SanityCheck
533   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
535   windows_container:
536     image: $CONTAINER_REPO/windows_ci_vs_2019:latest
537     cpu: $CPUS
538     memory: 4G
540   setup_additional_packages_script: |
541     REM choco install -y --no-progress ...
543   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
544   configure_script: |
545     vcvarsall x64
546     meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Db_pch=true -Dssl=openssl -Dextra_lib_dirs=c:\openssl\1.1\lib -Dextra_include_dirs=c:\openssl\1.1\include -DTAR=%TAR% -DPG_TEST_EXTRA="%PG_TEST_EXTRA%" build
548   build_script: |
549     vcvarsall x64
550     ninja -C build
552   check_world_script: |
553     vcvarsall x64
554     meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
556   on_failure:
557     <<: *on_failure_meson
558     crashlog_artifacts:
559       path: "crashlog-*.txt"
560       type: text/plain
563 task:
564   << : *WINDOWS_ENVIRONMENT_BASE
565   name: Windows - Server 2019, MinGW64 - Meson
567   # due to resource constraints we don't run this task by default for now
568   trigger_type: manual
569   # worth using only_if despite being manual, otherwise this task will show up
570   # when e.g. ci-os-only: linux is used.
571   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
572   # otherwise it'll be sorted before other tasks
573   depends_on: SanityCheck
575   windows_container:
576     image: $CONTAINER_REPO/windows_ci_mingw64:latest
577     cpu: $CPUS
578     memory: 4G
580   env:
581     TEST_JOBS: 4 # higher concurrency causes occasional failures
582     CCACHE_DIR: C:/msys64/ccache
583     CCACHE_MAXSIZE: "500M"
584     CCACHE_SLOPPINESS: pch_defines,time_macros
585     CCACHE_DEPEND: 1
586     # for some reason mingw plpython cannot find it's installation without this
587     PYTHONHOME: C:/msys64/ucrt64
588     # prevents MSYS bash from resetting error mode
589     MSYS: winjitdebug
590     # Start bash in current working directory
591     CHERE_INVOKING: 1
592     BASH: C:\msys64\usr\bin\bash.exe -l
594   ccache_cache:
595     folder: ${CCACHE_DIR}
597   setup_additional_packages_script: |
598     REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
600   mingw_info_script: |
601     %BASH% -c "where gcc"
602     %BASH% -c "gcc --version"
603     %BASH% -c "where perl"
604     %BASH% -c "perl --version"
606   # disable -Dnls as the number of files it creates cause a noticable slowdown
607   configure_script: |
608     %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
610   build_script: |
611     %BASH% -c "ninja -C build"
613   upload_caches: ccache
615   test_world_script: |
616     %BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
618   on_failure:
619     <<: *on_failure_meson
620     crashlog_artifacts:
621       path: "crashlog-*.txt"
622       type: text/plain
625 task:
626   name: CompilerWarnings
628   # To limit unnecessary work only run this once the SanityCheck
629   # succeeds. This is particularly important for this task as we intentionally
630   # use always: to continue after failures. Task that did not run count as a
631   # success, so we need to recheck SanityChecks's condition here ...
632   depends_on: SanityCheck
633   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
635   env:
636     CPUS: 4
637     BUILD_JOBS: 4
639     # Use larger ccache cache, as this task compiles with multiple compilers /
640     # flag combinations
641     CCACHE_MAXSIZE: "1GB"
642     CCACHE_DIR: "/tmp/ccache_dir"
644     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
645     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
647   container:
648     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
649     cpu: $CPUS
651   sysinfo_script: |
652     id
653     uname -a
654     cat /proc/cmdline
655     ulimit -a -H && ulimit -a -S
656     gcc -v
657     clang -v
658     export
660   ccache_cache:
661     folder: $CCACHE_DIR
663   setup_additional_packages_script: |
664     #apt-get update
665     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
667   ###
668   # Test that code can be built with gcc/clang without warnings
669   ###
671   setup_script: echo "COPT=-Werror" > src/Makefile.custom
673   # Trace probes have a history of getting accidentally broken. Use the
674   # different compilers to build with different combinations of dtrace on/off
675   # and cassert on/off.
677   # gcc, cassert off, dtrace on
678   always:
679     gcc_warning_script: |
680       time ./configure \
681         --cache gcc.cache \
682         --enable-dtrace \
683         ${LINUX_CONFIGURE_FEATURES} \
684         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
685       make -s -j${BUILD_JOBS} clean
686       time make -s -j${BUILD_JOBS} world-bin
688   # gcc, cassert on, dtrace off
689   always:
690     gcc_a_warning_script: |
691       time ./configure \
692         --cache gcc.cache \
693         --enable-cassert \
694         ${LINUX_CONFIGURE_FEATURES} \
695         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
696       make -s -j${BUILD_JOBS} clean
697       time make -s -j${BUILD_JOBS} world-bin
699   # clang, cassert off, dtrace off
700   always:
701     clang_warning_script: |
702       time ./configure \
703         --cache clang.cache \
704         ${LINUX_CONFIGURE_FEATURES} \
705         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
706       make -s -j${BUILD_JOBS} clean
707       time make -s -j${BUILD_JOBS} world-bin
709   # clang, cassert on, dtrace on
710   always:
711     clang_a_warning_script: |
712       time ./configure \
713         --cache clang.cache \
714         --enable-cassert \
715         --enable-dtrace \
716         ${LINUX_CONFIGURE_FEATURES} \
717         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
718       make -s -j${BUILD_JOBS} clean
719       time make -s -j${BUILD_JOBS} world-bin
721   # cross-compile to windows
722   always:
723     mingw_cross_warning_script: |
724       time ./configure \
725         --host=x86_64-w64-mingw32 \
726         --enable-cassert \
727         CC="ccache x86_64-w64-mingw32-gcc" \
728         CXX="ccache x86_64-w64-mingw32-g++"
729       make -s -j${BUILD_JOBS} clean
730       time make -s -j${BUILD_JOBS} world-bin
732   ###
733   # Verify docs can be built
734   ###
735   # XXX: Only do this if there have been changes in doc/ since last build
736   always:
737     docs_build_script: |
738       time ./configure \
739         --cache gcc.cache \
740         CC="ccache gcc" \
741         CXX="ccache g++" \
742         CLANG="ccache clang"
743       make -s -j${BUILD_JOBS} clean
744       time make -s -j${BUILD_JOBS} -C doc
746   ###
747   # Verify headerscheck / cpluspluscheck succeed
748   #
749   # - Don't use ccache, the files are uncacheable, polluting ccache's
750   #   cache
751   # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
752   # - XXX have to disable ICU to avoid errors:
753   #   https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
754   ###
755   always:
756     headers_headerscheck_script: |
757       time ./configure \
758         ${LINUX_CONFIGURE_FEATURES} \
759         --without-icu \
760         --quiet \
761         CC="gcc" CXX"=g++" CLANG="clang"
762       make -s -j${BUILD_JOBS} clean
763       time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
764     headers_cpluspluscheck_script: |
765       time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
767   always:
768     upload_caches: ccache