Simplify transformJsonAggConstructor() API
[pgsql.git] / .cirrus.yml
blob04786174ed4ca6e17142d65a21c3160351ad945e
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 have 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 load_balance
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 identifiable 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   # Work 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 -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   # test runningcheck, freebsd chosen because it's currently fast enough
199   test_running_script: |
200     su postgres <<-EOF
201       set -e
202       ulimit -c unlimited
203       meson test $MTEST_ARGS --quiet --suite setup
204       export LD_LIBRARY_PATH="$(pwd)/build/tmp_install/usr/local/pgsql/lib/:$LD_LIBRARY_PATH"
205       mkdir -p build/testrun
206       build/tmp_install/usr/local/pgsql/bin/initdb -N build/runningcheck --no-instructions -A trust
207       echo "include '$(pwd)/src/tools/ci/pg_ci_base.conf'" >> build/runningcheck/postgresql.conf
208       build/tmp_install/usr/local/pgsql/bin/pg_ctl -c -o '-c fsync=off' -D build/runningcheck -l build/testrun/runningcheck.log start
209       meson test $MTEST_ARGS --num-processes ${TEST_JOBS} --setup running
210       build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
211     EOF
213   on_failure:
214     # if the server continues running, it often causes cirrus-ci to fail
215     # during upload, as it doesn't expect artifacts to change size
216     stop_running_script: |
217       su postgres <<-EOF
218         build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
219       EOF
220     <<: *on_failure_meson
221     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
224 # configure feature flags, shared between the task running the linux tests and
225 # the CompilerWarnings task
226 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
227   --with-gssapi
228   --with-icu
229   --with-ldap
230   --with-libxml
231   --with-libxslt
232   --with-llvm
233   --with-lz4
234   --with-pam
235   --with-perl
236   --with-python
237   --with-selinux
238   --with-ssl=openssl
239   --with-systemd
240   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
241   --with-uuid=ossp
242   --with-zstd
244 LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
245   -Dllvm=enabled
246   -Duuid=e2fs
249 task:
250   env:
251     CPUS: 4
252     BUILD_JOBS: 4
253     TEST_JOBS: 8 # experimentally derived to be a decent choice
255     CCACHE_DIR: /tmp/ccache_dir
256     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
258     # Enable a reasonable set of sanitizers. Use the linux task for that, as
259     # it's one of the fastest tasks (without sanitizers). Also several of the
260     # sanitizers work best on linux.
261     #
262     # The overhead of alignment sanitizer is low, undefined behaviour has
263     # moderate overhead. Test alignment sanitizer in the meson task, as it
264     # does both 32 and 64 bit builds and is thus more likely to expose
265     # alignment bugs.
266     #
267     # Address sanitizer in contrast is somewhat expensive. Enable it in the
268     # autoconf task, as the meson task tests both 32 and 64bit.
269     #
270     # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
271     # print_stacktraces=1,verbosity=2, duh
272     # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
273     UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
274     ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
276     # SANITIZER_FLAGS is set in the tasks below
277     CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
278     CXXFLAGS: $CFLAGS
279     LDFLAGS: $SANITIZER_FLAGS
280     CC: ccache gcc
281     CXX: ccache g++
283     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
284     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
286   depends_on: SanityCheck
287   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
289   compute_engine_instance:
290     image_project: $IMAGE_PROJECT
291     image: family/pg-ci-bullseye
292     platform: linux
293     cpu: $CPUS
294     memory: 4G
296   ccache_cache:
297     folder: ${CCACHE_DIR}
299   sysinfo_script: |
300     id
301     uname -a
302     cat /proc/cmdline
303     ulimit -a -H && ulimit -a -S
304     export
305   create_user_script: |
306     useradd -m postgres
307     chown -R postgres:postgres .
308     mkdir -p ${CCACHE_DIR}
309     chown -R postgres:postgres ${CCACHE_DIR}
310     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
311     su postgres -c "ulimit -l -H && ulimit -l -S"
312   setup_core_files_script: |
313     mkdir -m 770 /tmp/cores
314     chown root:postgres /tmp/cores
315     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
317   setup_hosts_file_script: |
318     cat >> /etc/hosts <<-EOF
319       127.0.0.1 pg-loadbalancetest
320       127.0.0.2 pg-loadbalancetest
321       127.0.0.3 pg-loadbalancetest
322     EOF
324   setup_additional_packages_script: |
325     #apt-get update
326     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
328   matrix:
329     - name: Linux - Debian Bullseye - Autoconf
331       env:
332         SANITIZER_FLAGS: -fsanitize=address
334       configure_script: |
335         su postgres <<-EOF
336           ./configure \
337             --enable-cassert --enable-debug --enable-tap-tests \
338             --enable-nls \
339             --with-segsize-blocks=8 \
340             \
341             ${LINUX_CONFIGURE_FEATURES} \
342             \
343             CLANG="ccache clang"
344         EOF
345       build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
346       upload_caches: ccache
348       test_world_script: |
349         su postgres <<-EOF
350           ulimit -c unlimited # default is 0
351           make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
352         EOF
354       on_failure:
355         <<: *on_failure_ac
357     - name: Linux - Debian Bullseye - Meson
359       env:
360         CCACHE_MAXSIZE: "400M" # tests two different builds
361         SANITIZER_FLAGS: -fsanitize=alignment,undefined
363       configure_script: |
364         su postgres <<-EOF
365           meson setup \
366             --buildtype=debug \
367             -Dcassert=true \
368             ${LINUX_MESON_FEATURES} \
369             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
370             build
371         EOF
373       # Also build & test in a 32bit build - it's gotten rare to test that
374       # locally.
375       configure_32_script: |
376         su postgres <<-EOF
377           export CC='ccache gcc -m32'
378           meson setup \
379             --buildtype=debug \
380             -Dcassert=true \
381             ${LINUX_MESON_FEATURES} \
382             -Dllvm=disabled \
383             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
384             -DPERL=perl5.32-i386-linux-gnu \
385             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
386             build-32
387         EOF
389       build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
390       build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS}'
392       upload_caches: ccache
394       test_world_script: |
395         su postgres <<-EOF
396           ulimit -c unlimited
397           meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
398         EOF
399         # so that we don't upload 64bit logs if 32bit fails
400         rm -rf build/
402       # There's currently no coverage of icu with LANG=C in the buildfarm. We
403       # can easily provide some here by running one of the sets of tests that
404       # way. Newer versions of python insist on changing the LC_CTYPE away
405       # from C, prevent that with PYTHONCOERCECLOCALE.
406       test_world_32_script: |
407         su postgres <<-EOF
408           ulimit -c unlimited
409           PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
410         EOF
412       on_failure:
413         <<: *on_failure_meson
415   on_failure:
416     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
419 task:
420   name: macOS - Ventura - Meson
422   env:
423     CPUS: 4 # always get that much for cirrusci macOS instances
424     BUILD_JOBS: $CPUS
425     # Test performance regresses noticably when using all cores. 8 seems to
426     # work OK. See
427     # https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
428     TEST_JOBS: 8
430     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
431     CCACHE_DIR: ${HOME}/ccache
432     HOMEBREW_CACHE: ${HOME}/homebrew-cache
433     PERL5LIB: ${HOME}/perl5/lib/perl5
435     CC: ccache cc
436     CXX: ccache c++
437     CPPFLAGS: -DRANDOMIZE_ALLOCATED_MEMORY
438     CFLAGS: -Og -ggdb
439     CXXFLAGS: -Og -ggdb
441   depends_on: SanityCheck
442   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
444   macos_instance:
445     image: ghcr.io/cirruslabs/macos-ventura-base:latest
447   sysinfo_script: |
448     id
449     uname -a
450     ulimit -a -H && ulimit -a -S
451     export
453   setup_core_files_script:
454     - mkdir ${HOME}/cores
455     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
457   perl_cache:
458     folder: ~/perl5
459   cpan_install_script:
460     - perl -mIPC::Run -e 1 || cpan -T IPC::Run
461     - perl -mIO::Pty -e 1 || cpan -T IO::Pty
462   upload_caches: perl
465   # XXX: Could we instead install homebrew into a cached directory? The
466   # homebrew installation takes a good bit of time every time, even if the
467   # packages do not need to be downloaded.
468   homebrew_cache:
469     folder: $HOMEBREW_CACHE
470   setup_additional_packages_script: |
471     brew install \
472       ccache \
473       icu4c \
474       krb5 \
475       llvm \
476       lz4 \
477       make \
478       meson \
479       openldap \
480       openssl \
481       python \
482       tcl-tk \
483       zstd
485     brew cleanup -s # to reduce cache size
486   upload_caches: homebrew
488   ccache_cache:
489     folder: $CCACHE_DIR
490   configure_script: |
491     brewpath="/opt/homebrew"
492     PKG_CONFIG_PATH="${brewpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
494     for pkg in icu4c krb5 openldap openssl zstd ; do
495       pkgpath="${brewpath}/opt/${pkg}"
496       PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
497       PATH="${pkgpath}/bin:${pkgpath}/sbin:$PATH"
498     done
500     export PKG_CONFIG_PATH PATH
502     meson setup \
503       --buildtype=debug \
504       -Dextra_include_dirs=${brewpath}/include \
505       -Dextra_lib_dirs=${brewpath}/lib \
506       -Dcassert=true \
507       -Duuid=e2fs -Ddtrace=auto \
508       -Dsegsize_blocks=6 \
509       -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
510       build
512   build_script: ninja -C build -j${BUILD_JOBS}
513   upload_caches: ccache
515   test_world_script: |
516     ulimit -c unlimited # default is 0
517     ulimit -n 1024 # default is 256, pretty low
518     meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
520   on_failure:
521     <<: *on_failure_meson
522     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
525 WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
526   env:
527     # Half the allowed per-user CPU cores
528     CPUS: 4
530     # The default cirrus working dir is in a directory msbuild complains about
531     CIRRUS_WORKING_DIR: "c:/cirrus"
532     # git's tar doesn't deal with drive letters, see
533     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
534     TAR: "c:/windows/system32/tar.exe"
535     # Avoids port conflicts between concurrent tap test runs
536     PG_TEST_USE_UNIX_SOCKETS: 1
537     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
539   sysinfo_script: |
540     chcp
541     systeminfo
542     powershell -Command get-psdrive -psprovider filesystem
543     set
546 task:
547   name: Windows - Server 2019, VS 2019 - Meson & ninja
548   << : *WINDOWS_ENVIRONMENT_BASE
550   env:
551     TEST_JOBS: 8 # wild guess, data based value welcome
553     # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
554     # prevents crash reporting from working unless binaries do SetErrorMode()
555     # themselves. Furthermore, it appears that either python or, more likely,
556     # the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
557     # occasionally *trigger* a crash on process exit - which is hard to debug,
558     # given that it explicitly prevents crash dumps from working...
559     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
560     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
562   depends_on: SanityCheck
563   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
565   compute_engine_instance:
566     image_project: $IMAGE_PROJECT
567     image: family/pg-ci-windows-ci-vs-2019
568     platform: windows
569     cpu: $CPUS
570     memory: 4G
572   setup_additional_packages_script: |
573     REM choco install -y --no-progress ...
575   setup_hosts_file_script: |
576     echo 127.0.0.1 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
577     echo 127.0.0.2 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
578     echo 127.0.0.3 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
579     type c:\Windows\System32\Drivers\etc\hosts
581   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
582   configure_script: |
583     vcvarsall x64
584     meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Db_pch=true -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
586   build_script: |
587     vcvarsall x64
588     ninja -C build
590   check_world_script: |
591     vcvarsall x64
592     meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
594   on_failure:
595     <<: *on_failure_meson
596     crashlog_artifacts:
597       path: "crashlog-*.txt"
598       type: text/plain
601 task:
602   << : *WINDOWS_ENVIRONMENT_BASE
603   name: Windows - Server 2019, MinGW64 - Meson
605   # due to resource constraints we don't run this task by default for now
606   trigger_type: manual
607   # worth using only_if despite being manual, otherwise this task will show up
608   # when e.g. ci-os-only: linux is used.
609   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
610   # otherwise it'll be sorted before other tasks
611   depends_on: SanityCheck
613   compute_engine_instance:
614     image_project: $IMAGE_PROJECT
615     image: family/pg-ci-windows-ci-mingw64
616     platform: windows
617     cpu: $CPUS
618     memory: 4G
620   env:
621     TEST_JOBS: 4 # higher concurrency causes occasional failures
622     CCACHE_DIR: C:/msys64/ccache
623     CCACHE_MAXSIZE: "500M"
624     CCACHE_SLOPPINESS: pch_defines,time_macros
625     CCACHE_DEPEND: 1
626     # for some reason mingw plpython cannot find its installation without this
627     PYTHONHOME: C:/msys64/ucrt64
628     # prevents MSYS bash from resetting error mode
629     MSYS: winjitdebug
630     # Start bash in current working directory
631     CHERE_INVOKING: 1
632     BASH: C:\msys64\usr\bin\bash.exe -l
634   ccache_cache:
635     folder: ${CCACHE_DIR}
637   setup_additional_packages_script: |
638     REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
640   mingw_info_script: |
641     %BASH% -c "where gcc"
642     %BASH% -c "gcc --version"
643     %BASH% -c "where perl"
644     %BASH% -c "perl --version"
646   # disable -Dnls as the number of files it creates cause a noticable slowdown
647   configure_script: |
648     %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
650   build_script: |
651     %BASH% -c "ninja -C build"
653   upload_caches: ccache
655   test_world_script: |
656     %BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
658   on_failure:
659     <<: *on_failure_meson
660     crashlog_artifacts:
661       path: "crashlog-*.txt"
662       type: text/plain
665 task:
666   name: CompilerWarnings
668   # To limit unnecessary work only run this once the SanityCheck
669   # succeeds. This is particularly important for this task as we intentionally
670   # use always: to continue after failures. Task that did not run count as a
671   # success, so we need to recheck SanityChecks's condition here ...
672   depends_on: SanityCheck
673   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
675   env:
676     CPUS: 4
677     BUILD_JOBS: 4
679     # Use larger ccache cache, as this task compiles with multiple compilers /
680     # flag combinations
681     CCACHE_MAXSIZE: "1G"
682     CCACHE_DIR: "/tmp/ccache_dir"
684     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
685     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
687   container:
688     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
689     cpu: $CPUS
691   sysinfo_script: |
692     id
693     uname -a
694     cat /proc/cmdline
695     ulimit -a -H && ulimit -a -S
696     gcc -v
697     clang -v
698     export
700   ccache_cache:
701     folder: $CCACHE_DIR
703   setup_additional_packages_script: |
704     #apt-get update
705     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
707   ###
708   # Test that code can be built with gcc/clang without warnings
709   ###
711   setup_script: echo "COPT=-Werror" > src/Makefile.custom
713   # Trace probes have a history of getting accidentally broken. Use the
714   # different compilers to build with different combinations of dtrace on/off
715   # and cassert on/off.
717   # gcc, cassert off, dtrace on
718   always:
719     gcc_warning_script: |
720       time ./configure \
721         --cache gcc.cache \
722         --enable-dtrace \
723         ${LINUX_CONFIGURE_FEATURES} \
724         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
725       make -s -j${BUILD_JOBS} clean
726       time make -s -j${BUILD_JOBS} world-bin
728   # gcc, cassert on, dtrace off
729   always:
730     gcc_a_warning_script: |
731       time ./configure \
732         --cache gcc.cache \
733         --enable-cassert \
734         ${LINUX_CONFIGURE_FEATURES} \
735         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
736       make -s -j${BUILD_JOBS} clean
737       time make -s -j${BUILD_JOBS} world-bin
739   # clang, cassert off, dtrace off
740   always:
741     clang_warning_script: |
742       time ./configure \
743         --cache clang.cache \
744         ${LINUX_CONFIGURE_FEATURES} \
745         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
746       make -s -j${BUILD_JOBS} clean
747       time make -s -j${BUILD_JOBS} world-bin
749   # clang, cassert on, dtrace on
750   always:
751     clang_a_warning_script: |
752       time ./configure \
753         --cache clang.cache \
754         --enable-cassert \
755         --enable-dtrace \
756         ${LINUX_CONFIGURE_FEATURES} \
757         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
758       make -s -j${BUILD_JOBS} clean
759       time make -s -j${BUILD_JOBS} world-bin
761   # cross-compile to windows
762   always:
763     mingw_cross_warning_script: |
764       time ./configure \
765         --host=x86_64-w64-mingw32 \
766         --enable-cassert \
767         CC="ccache x86_64-w64-mingw32-gcc" \
768         CXX="ccache x86_64-w64-mingw32-g++"
769       make -s -j${BUILD_JOBS} clean
770       time make -s -j${BUILD_JOBS} world-bin
772   ###
773   # Verify docs can be built
774   ###
775   # XXX: Only do this if there have been changes in doc/ since last build
776   always:
777     docs_build_script: |
778       time ./configure \
779         --cache gcc.cache \
780         CC="ccache gcc" \
781         CXX="ccache g++" \
782         CLANG="ccache clang"
783       make -s -j${BUILD_JOBS} clean
784       time make -s -j${BUILD_JOBS} -C doc
786   ###
787   # Verify headerscheck / cpluspluscheck succeed
788   #
789   # - Don't use ccache, the files are uncacheable, polluting ccache's
790   #   cache
791   # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
792   # - XXX have to disable ICU to avoid errors:
793   #   https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
794   ###
795   always:
796     headers_headerscheck_script: |
797       time ./configure \
798         ${LINUX_CONFIGURE_FEATURES} \
799         --without-icu \
800         --quiet \
801         CC="gcc" CXX"=g++" CLANG="clang"
802       make -s -j${BUILD_JOBS} clean
803       time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
804     headers_cpluspluscheck_script: |
805       time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
807   always:
808     upload_caches: ccache