Improve EXPLAIN's display of SubPlan nodes and output parameters.
[pgsql.git] / .cirrus.tasks.yml
blob1adfdfdd4569080ce3d00444e653b4d82e82fac4
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   # The lower depth accelerates git clone. Use a bit of depth so that
9   # concurrent tasks and retrying older jobs have a chance of working.
10   CIRRUS_CLONE_DEPTH: 500
11   # Useful to be able to analyse what in a script takes long
12   CIRRUS_LOG_TIMESTAMP: true
14   CCACHE_MAXSIZE: "250M"
16   # target to test, for all but windows
17   CHECK: check-world PROVE_FLAGS=$PROVE_FLAGS
18   CHECKFLAGS: -Otarget
19   PROVE_FLAGS: --timer
20   MTEST_ARGS: --print-errorlogs --no-rebuild -C build
21   PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
22   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
23   PG_TEST_EXTRA: kerberos ldap ssl load_balance
26 # What files to preserve in case tests fail
27 on_failure_ac: &on_failure_ac
28   log_artifacts:
29     paths:
30       - "**/*.log"
31       - "**/*.diffs"
32       - "**/regress_log_*"
33     type: text/plain
35 on_failure_meson: &on_failure_meson
36   testrun_artifacts:
37     paths:
38       - "build*/testrun/**/*.log"
39       - "build*/testrun/**/*.diffs"
40       - "build*/testrun/**/regress_log_*"
41     type: text/plain
43   # In theory it'd be nice to upload the junit files meson generates, so that
44   # cirrus will nicely annotate the commit. Unfortunately the files don't
45   # contain identifiable file + line numbers right now, so the annotations
46   # don't end up useful. We could probably improve on that with a some custom
47   # conversion script, but ...
48   meson_log_artifacts:
49     path: "build*/meson-logs/*.txt"
50     type: text/plain
53 # To avoid unnecessarily spinning up a lot of VMs / containers for entirely
54 # broken commits, have a minimal task that all others depend on.
55 task:
56   name: SanityCheck
58   # If a specific OS is requested, don't run the sanity check. This shortens
59   # push-wait-for-ci cycle time a bit when debugging operating system specific
60   # failures. Uses skip instead of only_if, as cirrus otherwise warns about
61   # only_if conditions not matching.
62   skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
64   env:
65     CPUS: 4
66     BUILD_JOBS: 8
67     TEST_JOBS: 8
68     IMAGE_FAMILY: pg-ci-bullseye
69     CCACHE_DIR: ${CIRRUS_WORKING_DIR}/ccache_dir
70     # no options enabled, should be small
71     CCACHE_MAXSIZE: "150M"
73   # While containers would start up a bit quicker, building is a bit
74   # slower. This way we don't have to maintain a container image.
75   <<: *linux_task_template
77   ccache_cache:
78     folder: $CCACHE_DIR
80   create_user_script: |
81     useradd -m postgres
82     chown -R postgres:postgres .
83     mkdir -p ${CCACHE_DIR}
84     chown -R postgres:postgres ${CCACHE_DIR}
85     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
86     su postgres -c "ulimit -l -H && ulimit -l -S"
87     # Can't change container's kernel.core_pattern. Postgres user can't write
88     # to / normally. Change that.
89     chown root:postgres /
90     chmod g+rwx /
92   configure_script: |
93     su postgres <<-EOF
94       meson setup \
95         --buildtype=debug \
96         --auto-features=disabled \
97         -Dtap_tests=enabled \
98         build
99     EOF
100   build_script: |
101     su postgres <<-EOF
102       ninja -C build -j${BUILD_JOBS}
103     EOF
104   upload_caches: ccache
106   # Run a minimal set of tests. The main regression tests take too long for
107   # this purpose. For now this is a random quick pg_regress style test, and a
108   # tap test that exercises both a frontend binary and the backend.
109   test_minimal_script: |
110     su postgres <<-EOF
111       ulimit -c unlimited
112       meson test $MTEST_ARGS --suite setup
113       meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
114         cube/regress pg_ctl/001_start_stop
115     EOF
117   on_failure:
118     <<: *on_failure_meson
119     cores_script: |
120       mkdir -m 770 /tmp/cores
121       find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
122       src/tools/ci/cores_backtrace.sh linux /tmp/cores
125 task:
126   name: FreeBSD - 13 - Meson
128   env:
129     CPUS: 4
130     BUILD_JOBS: 4
131     TEST_JOBS: 8
132     IMAGE_FAMILY: pg-ci-freebsd-13
133     DISK_SIZE: 50
135     CCACHE_DIR: /tmp/ccache_dir
136     CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
137     CFLAGS: -Og -ggdb
139     PG_TEST_PG_UPGRADE_MODE: --link
141   <<: *freebsd_task_template
143   depends_on: SanityCheck
144   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
146   sysinfo_script: |
147     id
148     uname -a
149     ulimit -a -H && ulimit -a -S
150     export
152   ccache_cache:
153     folder: $CCACHE_DIR
154   # Work around performance issues due to 32KB block size
155   repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
156   create_user_script: |
157     pw useradd postgres
158     chown -R postgres:postgres .
159     mkdir -p ${CCACHE_DIR}
160     chown -R postgres:postgres ${CCACHE_DIR}
161   setup_core_files_script: |
162     mkdir -m 770 /tmp/cores
163     chown root:postgres /tmp/cores
164     sysctl kern.corefile='/tmp/cores/%N.%P.core'
165   setup_additional_packages_script: |
166     #pkg install -y ...
168   # NB: Intentionally build without -Dllvm. The freebsd image size is already
169   # large enough to make VM startup slow, and even without llvm freebsd
170   # already takes longer than other platforms except for windows.
171   configure_script: |
172     su postgres <<-EOF
173       meson setup \
174         --buildtype=debug \
175         -Dcassert=true -Dinjection_points=true \
176         -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
177         -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
178         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
179         build
180     EOF
181   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
182   upload_caches: ccache
184   test_world_script: |
185     su postgres <<-EOF
186       ulimit -c unlimited
187       meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
188     EOF
190   # test runningcheck, freebsd chosen because it's currently fast enough
191   test_running_script: |
192     su postgres <<-EOF
193       set -e
194       ulimit -c unlimited
195       meson test $MTEST_ARGS --quiet --suite setup
196       export LD_LIBRARY_PATH="$(pwd)/build/tmp_install/usr/local/pgsql/lib/:$LD_LIBRARY_PATH"
197       mkdir -p build/testrun
198       build/tmp_install/usr/local/pgsql/bin/initdb -N build/runningcheck --no-instructions -A trust
199       echo "include '$(pwd)/src/tools/ci/pg_ci_base.conf'" >> build/runningcheck/postgresql.conf
200       build/tmp_install/usr/local/pgsql/bin/pg_ctl -c -o '-c fsync=off' -D build/runningcheck -l build/testrun/runningcheck.log start
201       meson test $MTEST_ARGS --num-processes ${TEST_JOBS} --setup running
202       build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
203     EOF
205   on_failure:
206     # if the server continues running, it often causes cirrus-ci to fail
207     # during upload, as it doesn't expect artifacts to change size
208     stop_running_script: |
209       su postgres <<-EOF
210         build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
211       EOF
212     <<: *on_failure_meson
213     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
216 # configure feature flags, shared between the task running the linux tests and
217 # the CompilerWarnings task
218 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
219   --with-gssapi
220   --with-icu
221   --with-ldap
222   --with-libxml
223   --with-libxslt
224   --with-llvm
225   --with-lz4
226   --with-pam
227   --with-perl
228   --with-python
229   --with-selinux
230   --with-ssl=openssl
231   --with-systemd
232   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
233   --with-uuid=ossp
234   --with-zstd
236 LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
237   -Dllvm=enabled
238   -Duuid=e2fs
241 task:
242   env:
243     CPUS: 4
244     BUILD_JOBS: 4
245     TEST_JOBS: 8 # experimentally derived to be a decent choice
246     IMAGE_FAMILY: pg-ci-bullseye
248     CCACHE_DIR: /tmp/ccache_dir
249     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
251     # Enable a reasonable set of sanitizers. Use the linux task for that, as
252     # it's one of the fastest tasks (without sanitizers). Also several of the
253     # sanitizers work best on linux.
254     #
255     # The overhead of alignment sanitizer is low, undefined behaviour has
256     # moderate overhead. Test alignment sanitizer in the meson task, as it
257     # does both 32 and 64 bit builds and is thus more likely to expose
258     # alignment bugs.
259     #
260     # Address sanitizer in contrast is somewhat expensive. Enable it in the
261     # autoconf task, as the meson task tests both 32 and 64bit.
262     #
263     # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
264     # print_stacktraces=1,verbosity=2, duh
265     # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
266     UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
267     ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
269     # SANITIZER_FLAGS is set in the tasks below
270     CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
271     CXXFLAGS: $CFLAGS
272     LDFLAGS: $SANITIZER_FLAGS
273     CC: ccache gcc
274     CXX: ccache g++
276     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
277     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
279   <<: *linux_task_template
281   depends_on: SanityCheck
282   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
284   ccache_cache:
285     folder: ${CCACHE_DIR}
287   sysinfo_script: |
288     id
289     uname -a
290     cat /proc/cmdline
291     ulimit -a -H && ulimit -a -S
292     export
293   create_user_script: |
294     useradd -m postgres
295     chown -R postgres:postgres .
296     mkdir -p ${CCACHE_DIR}
297     chown -R postgres:postgres ${CCACHE_DIR}
298     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
299     su postgres -c "ulimit -l -H && ulimit -l -S"
300   setup_core_files_script: |
301     mkdir -m 770 /tmp/cores
302     chown root:postgres /tmp/cores
303     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
305   setup_hosts_file_script: |
306     cat >> /etc/hosts <<-EOF
307       127.0.0.1 pg-loadbalancetest
308       127.0.0.2 pg-loadbalancetest
309       127.0.0.3 pg-loadbalancetest
310     EOF
312   setup_additional_packages_script: |
313     #apt-get update
314     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
316   matrix:
317     - name: Linux - Debian Bullseye - Autoconf
319       env:
320         SANITIZER_FLAGS: -fsanitize=address
322       # Normally, the "relation segment" code basically has no coverage in our
323       # tests, because we (quite reasonably) don't generate tables large
324       # enough in tests. We've had plenty bugs that we didn't notice due the
325       # code not being exercised much. Thus specify a very small segment size
326       # here. Use a non-power-of-two segment size, given we currently allow
327       # that.
328       configure_script: |
329         su postgres <<-EOF
330           ./configure \
331             --enable-cassert --enable-injection-points --enable-debug \
332             --enable-tap-tests --enable-nls \
333             --with-segsize-blocks=6 \
334             \
335             ${LINUX_CONFIGURE_FEATURES} \
336             \
337             CLANG="ccache clang"
338         EOF
339       build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
340       upload_caches: ccache
342       test_world_script: |
343         su postgres <<-EOF
344           ulimit -c unlimited # default is 0
345           make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
346         EOF
348       on_failure:
349         <<: *on_failure_ac
351     - name: Linux - Debian Bullseye - Meson
353       env:
354         CCACHE_MAXSIZE: "400M" # tests two different builds
355         SANITIZER_FLAGS: -fsanitize=alignment,undefined
357       configure_script: |
358         su postgres <<-EOF
359           meson setup \
360             --buildtype=debug \
361             -Dcassert=true -Dinjection_points=true \
362             ${LINUX_MESON_FEATURES} \
363             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
364             build
365         EOF
367       # Also build & test in a 32bit build - it's gotten rare to test that
368       # locally.
369       configure_32_script: |
370         su postgres <<-EOF
371           export CC='ccache gcc -m32'
372           meson setup \
373             --buildtype=debug \
374             -Dcassert=true -Dinjection_points=true \
375             ${LINUX_MESON_FEATURES} \
376             -Dllvm=disabled \
377             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
378             -DPERL=perl5.32-i386-linux-gnu \
379             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
380             build-32
381         EOF
383       build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
384       build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS}'
386       upload_caches: ccache
388       test_world_script: |
389         su postgres <<-EOF
390           ulimit -c unlimited
391           meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
392         EOF
393         # so that we don't upload 64bit logs if 32bit fails
394         rm -rf build/
396       # There's currently no coverage of icu with LANG=C in the buildfarm. We
397       # can easily provide some here by running one of the sets of tests that
398       # way. Newer versions of python insist on changing the LC_CTYPE away
399       # from C, prevent that with PYTHONCOERCECLOCALE.
400       test_world_32_script: |
401         su postgres <<-EOF
402           ulimit -c unlimited
403           PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
404         EOF
406       on_failure:
407         <<: *on_failure_meson
409   on_failure:
410     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
413 task:
414   name: macOS - Ventura - Meson
416   env:
417     CPUS: 4 # always get that much for cirrusci macOS instances
418     BUILD_JOBS: $CPUS
419     # Test performance regresses noticably when using all cores. 8 seems to
420     # work OK. See
421     # https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
422     TEST_JOBS: 8
423     IMAGE: ghcr.io/cirruslabs/macos-ventura-base:latest
425     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
426     CCACHE_DIR: ${HOME}/ccache
427     MACPORTS_CACHE: ${HOME}/macports-cache
429     CC: ccache cc
430     CXX: ccache c++
431     CFLAGS: -Og -ggdb
432     CXXFLAGS: -Og -ggdb
434     PG_TEST_PG_UPGRADE_MODE: --clone
436   <<: *macos_task_template
438   depends_on: SanityCheck
439   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
441   sysinfo_script: |
442     id
443     uname -a
444     ulimit -a -H && ulimit -a -S
445     export
447   setup_core_files_script:
448     - mkdir ${HOME}/cores
449     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
451   # Use macports, even though homebrew is installed. The installation
452   # of the additional packages we need would take quite a while with
453   # homebrew, even if we cache the downloads. We can't cache all of
454   # homebrew, because it's already large. So we use macports. To cache
455   # the installation we create a .dmg file that we mount if it already
456   # exists.
457   # XXX: The reason for the direct p5.34* references is that we'd need
458   # the large macport tree around to figure out that p5-io-tty is
459   # actually p5.34-io-tty. Using the unversioned name works, but
460   # updates macports every time.
461   macports_cache:
462     folder: ${MACPORTS_CACHE}
463   setup_additional_packages_script: |
464     sh src/tools/ci/ci_macports_packages.sh \
465       ccache \
466       icu \
467       kerberos5 \
468       lz4 \
469       meson \
470       openldap \
471       openssl \
472       p5.34-io-tty \
473       p5.34-ipc-run \
474       tcl \
475       zstd
476     # Make macports install visible for subsequent steps
477     echo PATH=/opt/local/sbin/:/opt/local/bin/:$PATH >> $CIRRUS_ENV
478   upload_caches: macports
480   ccache_cache:
481     folder: $CCACHE_DIR
482   configure_script: |
483     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
484     meson setup \
485       --buildtype=debug \
486       -Dextra_include_dirs=/opt/local/include \
487       -Dextra_lib_dirs=/opt/local/lib \
488       -Dcassert=true -Dinjection_points=true \
489       -Duuid=e2fs -Ddtrace=auto \
490       -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
491       build
493   build_script: ninja -C build -j${BUILD_JOBS}
494   upload_caches: ccache
496   test_world_script: |
497     ulimit -c unlimited # default is 0
498     ulimit -n 1024 # default is 256, pretty low
499     meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
501   on_failure:
502     <<: *on_failure_meson
503     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
506 WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
507   env:
508     # Half the allowed per-user CPU cores
509     CPUS: 4
511     # The default cirrus working dir is in a directory msbuild complains about
512     CIRRUS_WORKING_DIR: "c:/cirrus"
513     # git's tar doesn't deal with drive letters, see
514     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
515     TAR: "c:/windows/system32/tar.exe"
516     # Avoids port conflicts between concurrent tap test runs
517     PG_TEST_USE_UNIX_SOCKETS: 1
518     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
519     DISK_SIZE: 50
521   sysinfo_script: |
522     chcp
523     systeminfo
524     powershell -Command get-psdrive -psprovider filesystem
525     set
528 task:
529   name: Windows - Server 2019, VS 2019 - Meson & ninja
530   << : *WINDOWS_ENVIRONMENT_BASE
532   env:
533     TEST_JOBS: 8 # wild guess, data based value welcome
535     # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
536     # prevents crash reporting from working unless binaries do SetErrorMode()
537     # themselves. Furthermore, it appears that either python or, more likely,
538     # the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
539     # occasionally *trigger* a crash on process exit - which is hard to debug,
540     # given that it explicitly prevents crash dumps from working...
541     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
542     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
543     IMAGE_FAMILY: pg-ci-windows-ci-vs-2019
545   <<: *windows_task_template
547   depends_on: SanityCheck
548   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
550   setup_additional_packages_script: |
551     REM choco install -y --no-progress ...
553   setup_hosts_file_script: |
554     echo 127.0.0.1 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
555     echo 127.0.0.2 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
556     echo 127.0.0.3 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
557     type c:\Windows\System32\Drivers\etc\hosts
559   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
560   configure_script: |
561     vcvarsall x64
562     meson setup --backend ninja --buildtype debug -Dc_link_args=/DEBUG:FASTLINK -Dcassert=true -Dinjection_points=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
564   build_script: |
565     vcvarsall x64
566     ninja -C build
568   check_world_script: |
569     vcvarsall x64
570     meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
572   on_failure:
573     <<: *on_failure_meson
574     crashlog_artifacts:
575       path: "crashlog-*.txt"
576       type: text/plain
579 task:
580   << : *WINDOWS_ENVIRONMENT_BASE
581   name: Windows - Server 2019, MinGW64 - Meson
583   # due to resource constraints we don't run this task by default for now
584   trigger_type: manual
585   # worth using only_if despite being manual, otherwise this task will show up
586   # when e.g. ci-os-only: linux is used.
587   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
588   # otherwise it'll be sorted before other tasks
589   depends_on: SanityCheck
591   env:
592     TEST_JOBS: 4 # higher concurrency causes occasional failures
593     CCACHE_DIR: C:/msys64/ccache
594     CCACHE_MAXSIZE: "500M"
595     CCACHE_SLOPPINESS: pch_defines,time_macros
596     CCACHE_DEPEND: 1
597     # for some reason mingw plpython cannot find its installation without this
598     PYTHONHOME: C:/msys64/ucrt64
599     # prevents MSYS bash from resetting error mode
600     MSYS: winjitdebug
601     # Start bash in current working directory
602     CHERE_INVOKING: 1
603     BASH: C:\msys64\usr\bin\bash.exe -l
604     IMAGE_FAMILY: pg-ci-windows-ci-mingw64
606   <<: *windows_task_template
608   ccache_cache:
609     folder: ${CCACHE_DIR}
611   setup_additional_packages_script: |
612     REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
614   mingw_info_script: |
615     %BASH% -c "where gcc"
616     %BASH% -c "gcc --version"
617     %BASH% -c "where perl"
618     %BASH% -c "perl --version"
620   # disable -Dnls as the number of files it creates cause a noticable slowdown
621   configure_script: |
622     %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
624   build_script: |
625     %BASH% -c "ninja -C build"
627   upload_caches: ccache
629   test_world_script: |
630     %BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
632   on_failure:
633     <<: *on_failure_meson
634     crashlog_artifacts:
635       path: "crashlog-*.txt"
636       type: text/plain
639 task:
640   name: CompilerWarnings
642   # To limit unnecessary work only run this once the SanityCheck
643   # succeeds. This is particularly important for this task as we intentionally
644   # use always: to continue after failures. Task that did not run count as a
645   # success, so we need to recheck SanityChecks's condition here ...
646   depends_on: SanityCheck
647   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
649   env:
650     CPUS: 4
651     BUILD_JOBS: 4
652     IMAGE_FAMILY: pg-ci-bullseye
654     # Use larger ccache cache, as this task compiles with multiple compilers /
655     # flag combinations
656     CCACHE_MAXSIZE: "1G"
657     CCACHE_DIR: "/tmp/ccache_dir"
659     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
660     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
662   <<: *linux_task_template
664   sysinfo_script: |
665     id
666     uname -a
667     cat /proc/cmdline
668     ulimit -a -H && ulimit -a -S
669     gcc -v
670     clang -v
671     export
673   ccache_cache:
674     folder: $CCACHE_DIR
676   setup_additional_packages_script: |
677     #apt-get update
678     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
680   ###
681   # Test that code can be built with gcc/clang without warnings
682   ###
684   setup_script: echo "COPT=-Werror" > src/Makefile.custom
686   # Trace probes have a history of getting accidentally broken. Use the
687   # different compilers to build with different combinations of dtrace on/off
688   # and cassert on/off.
690   # gcc, cassert off, dtrace on
691   always:
692     gcc_warning_script: |
693       time ./configure \
694         --cache gcc.cache \
695         --enable-dtrace \
696         ${LINUX_CONFIGURE_FEATURES} \
697         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
698       make -s -j${BUILD_JOBS} clean
699       time make -s -j${BUILD_JOBS} world-bin
701   # gcc, cassert on, dtrace off
702   always:
703     gcc_a_warning_script: |
704       time ./configure \
705         --cache gcc.cache \
706         --enable-cassert \
707         ${LINUX_CONFIGURE_FEATURES} \
708         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
709       make -s -j${BUILD_JOBS} clean
710       time make -s -j${BUILD_JOBS} world-bin
712   # clang, cassert off, dtrace off
713   always:
714     clang_warning_script: |
715       time ./configure \
716         --cache clang.cache \
717         ${LINUX_CONFIGURE_FEATURES} \
718         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
719       make -s -j${BUILD_JOBS} clean
720       time make -s -j${BUILD_JOBS} world-bin
722   # clang, cassert on, dtrace on
723   always:
724     clang_a_warning_script: |
725       time ./configure \
726         --cache clang.cache \
727         --enable-cassert \
728         --enable-dtrace \
729         ${LINUX_CONFIGURE_FEATURES} \
730         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
731       make -s -j${BUILD_JOBS} clean
732       time make -s -j${BUILD_JOBS} world-bin
734   # cross-compile to windows
735   always:
736     mingw_cross_warning_script: |
737       time ./configure \
738         --host=x86_64-w64-mingw32 \
739         --enable-cassert \
740         --without-icu \
741         CC="ccache x86_64-w64-mingw32-gcc" \
742         CXX="ccache x86_64-w64-mingw32-g++"
743       make -s -j${BUILD_JOBS} clean
744       time make -s -j${BUILD_JOBS} world-bin
746   ###
747   # Verify docs can be built
748   ###
749   # XXX: Only do this if there have been changes in doc/ since last build
750   always:
751     docs_build_script: |
752       time ./configure \
753         --cache gcc.cache \
754         CC="ccache gcc" \
755         CXX="ccache g++" \
756         CLANG="ccache clang"
757       make -s -j${BUILD_JOBS} clean
758       time make -s -j${BUILD_JOBS} -C doc
760   ###
761   # Verify headerscheck / cpluspluscheck succeed
762   #
763   # - Don't use ccache, the files are uncacheable, polluting ccache's
764   #   cache
765   # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
766   # - XXX have to disable ICU to avoid errors:
767   #   https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
768   ###
769   always:
770     headers_headerscheck_script: |
771       time ./configure \
772         ${LINUX_CONFIGURE_FEATURES} \
773         --without-icu \
774         --quiet \
775         CC="gcc" CXX"=g++" CLANG="clang"
776       make -s -j${BUILD_JOBS} clean
777       time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
778     headers_cpluspluscheck_script: |
779       time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
781   always:
782     upload_caches: ccache