Fix problems when a plain-inheritance parent table is excluded.
[pgsql.git] / .cirrus.tasks.yml
blobe74cfa9bb525d6f6525967c505e48f3b749b47c3
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 --num-processes ${TEST_JOBS} \
113         tmp_install cube/regress pg_ctl/001_start_stop
114     EOF
116   on_failure:
117     <<: *on_failure_meson
118     cores_script: |
119       mkdir -m 770 /tmp/cores
120       find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
121       src/tools/ci/cores_backtrace.sh linux /tmp/cores
124 task:
125   name: FreeBSD - 13 - Meson
127   env:
128     # FreeBSD on GCP is slow when running with larger number of CPUS /
129     # jobs. Using one more job than cpus seems to work best.
130     CPUS: 2
131     BUILD_JOBS: 3
132     TEST_JOBS: 3
133     IMAGE_FAMILY: pg-ci-freebsd-13
134     DISK_SIZE: 50
136     CCACHE_DIR: /tmp/ccache_dir
137     CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST
138     CFLAGS: -Og -ggdb
140   <<: *freebsd_task_template
142   depends_on: SanityCheck
143   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
145   sysinfo_script: |
146     id
147     uname -a
148     ulimit -a -H && ulimit -a -S
149     export
151   ccache_cache:
152     folder: $CCACHE_DIR
153   # Work around performance issues due to 32KB block size
154   repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
155   create_user_script: |
156     pw useradd postgres
157     chown -R postgres:postgres .
158     mkdir -p ${CCACHE_DIR}
159     chown -R postgres:postgres ${CCACHE_DIR}
160   setup_core_files_script: |
161     mkdir -m 770 /tmp/cores
162     chown root:postgres /tmp/cores
163     sysctl kern.corefile='/tmp/cores/%N.%P.core'
164   setup_additional_packages_script: |
165     #pkg install -y ...
167   # NB: Intentionally build without -Dllvm. The freebsd image size is already
168   # large enough to make VM startup slow, and even without llvm freebsd
169   # already takes longer than other platforms except for windows.
170   configure_script: |
171     su postgres <<-EOF
172       meson setup \
173         --buildtype=debug \
174         -Dcassert=true -Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
175         -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
176         -Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
177         build
178     EOF
179   build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
180   upload_caches: ccache
182   test_world_script: |
183     su postgres <<-EOF
184       ulimit -c unlimited
185       meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
186     EOF
188   # test runningcheck, freebsd chosen because it's currently fast enough
189   test_running_script: |
190     su postgres <<-EOF
191       set -e
192       ulimit -c unlimited
193       meson test $MTEST_ARGS --quiet --suite setup
194       export LD_LIBRARY_PATH="$(pwd)/build/tmp_install/usr/local/pgsql/lib/:$LD_LIBRARY_PATH"
195       mkdir -p build/testrun
196       build/tmp_install/usr/local/pgsql/bin/initdb -N build/runningcheck --no-instructions -A trust
197       echo "include '$(pwd)/src/tools/ci/pg_ci_base.conf'" >> build/runningcheck/postgresql.conf
198       build/tmp_install/usr/local/pgsql/bin/pg_ctl -c -o '-c fsync=off' -D build/runningcheck -l build/testrun/runningcheck.log start
199       meson test $MTEST_ARGS --num-processes ${TEST_JOBS} --setup running
200       build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
201     EOF
203   on_failure:
204     # if the server continues running, it often causes cirrus-ci to fail
205     # during upload, as it doesn't expect artifacts to change size
206     stop_running_script: |
207       su postgres <<-EOF
208         build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
209       EOF
210     <<: *on_failure_meson
211     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
214 # configure feature flags, shared between the task running the linux tests and
215 # the CompilerWarnings task
216 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
217   --with-gssapi
218   --with-icu
219   --with-ldap
220   --with-libxml
221   --with-libxslt
222   --with-llvm
223   --with-lz4
224   --with-pam
225   --with-perl
226   --with-python
227   --with-selinux
228   --with-ssl=openssl
229   --with-systemd
230   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
231   --with-uuid=ossp
232   --with-zstd
234 LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
235   -Dllvm=enabled
236   -Duuid=e2fs
239 task:
240   env:
241     CPUS: 4
242     BUILD_JOBS: 4
243     TEST_JOBS: 8 # experimentally derived to be a decent choice
244     IMAGE_FAMILY: pg-ci-bullseye
246     CCACHE_DIR: /tmp/ccache_dir
247     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
249     # Enable a reasonable set of sanitizers. Use the linux task for that, as
250     # it's one of the fastest tasks (without sanitizers). Also several of the
251     # sanitizers work best on linux.
252     #
253     # The overhead of alignment sanitizer is low, undefined behaviour has
254     # moderate overhead. Test alignment sanitizer in the meson task, as it
255     # does both 32 and 64 bit builds and is thus more likely to expose
256     # alignment bugs.
257     #
258     # Address sanitizer in contrast is somewhat expensive. Enable it in the
259     # autoconf task, as the meson task tests both 32 and 64bit.
260     #
261     # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
262     # print_stacktraces=1,verbosity=2, duh
263     # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
264     UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
265     ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
267     # SANITIZER_FLAGS is set in the tasks below
268     CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
269     CXXFLAGS: $CFLAGS
270     LDFLAGS: $SANITIZER_FLAGS
271     CC: ccache gcc
272     CXX: ccache g++
274     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
275     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
277   <<: *linux_task_template
279   depends_on: SanityCheck
280   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
282   ccache_cache:
283     folder: ${CCACHE_DIR}
285   sysinfo_script: |
286     id
287     uname -a
288     cat /proc/cmdline
289     ulimit -a -H && ulimit -a -S
290     export
291   create_user_script: |
292     useradd -m postgres
293     chown -R postgres:postgres .
294     mkdir -p ${CCACHE_DIR}
295     chown -R postgres:postgres ${CCACHE_DIR}
296     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
297     su postgres -c "ulimit -l -H && ulimit -l -S"
298   setup_core_files_script: |
299     mkdir -m 770 /tmp/cores
300     chown root:postgres /tmp/cores
301     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
303   setup_hosts_file_script: |
304     cat >> /etc/hosts <<-EOF
305       127.0.0.1 pg-loadbalancetest
306       127.0.0.2 pg-loadbalancetest
307       127.0.0.3 pg-loadbalancetest
308     EOF
310   setup_additional_packages_script: |
311     #apt-get update
312     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
314   matrix:
315     - name: Linux - Debian Bullseye - Autoconf
317       env:
318         SANITIZER_FLAGS: -fsanitize=address
320       # Normally, the "relation segment" code basically has no coverage in our
321       # tests, because we (quite reasonably) don't generate tables large
322       # enough in tests. We've had plenty bugs that we didn't notice due the
323       # code not being exercised much. Thus specify a very small segment size
324       # here. Use a non-power-of-two segment size, given we currently allow
325       # that.
326       configure_script: |
327         su postgres <<-EOF
328           ./configure \
329             --enable-cassert --enable-debug --enable-tap-tests \
330             --enable-nls \
331             --with-segsize-blocks=6 \
332             \
333             ${LINUX_CONFIGURE_FEATURES} \
334             \
335             CLANG="ccache clang"
336         EOF
337       build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
338       upload_caches: ccache
340       test_world_script: |
341         su postgres <<-EOF
342           ulimit -c unlimited # default is 0
343           make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
344         EOF
346       on_failure:
347         <<: *on_failure_ac
349     - name: Linux - Debian Bullseye - Meson
351       env:
352         CCACHE_MAXSIZE: "400M" # tests two different builds
353         SANITIZER_FLAGS: -fsanitize=alignment,undefined
355       configure_script: |
356         su postgres <<-EOF
357           meson setup \
358             --buildtype=debug \
359             -Dcassert=true \
360             ${LINUX_MESON_FEATURES} \
361             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
362             build
363         EOF
365       # Also build & test in a 32bit build - it's gotten rare to test that
366       # locally.
367       configure_32_script: |
368         su postgres <<-EOF
369           export CC='ccache gcc -m32'
370           meson setup \
371             --buildtype=debug \
372             -Dcassert=true \
373             ${LINUX_MESON_FEATURES} \
374             -Dllvm=disabled \
375             --pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
376             -DPERL=perl5.32-i386-linux-gnu \
377             -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
378             build-32
379         EOF
381       build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
382       build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS}'
384       upload_caches: ccache
386       test_world_script: |
387         su postgres <<-EOF
388           ulimit -c unlimited
389           meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
390         EOF
391         # so that we don't upload 64bit logs if 32bit fails
392         rm -rf build/
394       # There's currently no coverage of icu with LANG=C in the buildfarm. We
395       # can easily provide some here by running one of the sets of tests that
396       # way. Newer versions of python insist on changing the LC_CTYPE away
397       # from C, prevent that with PYTHONCOERCECLOCALE.
398       test_world_32_script: |
399         su postgres <<-EOF
400           ulimit -c unlimited
401           PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
402         EOF
404       on_failure:
405         <<: *on_failure_meson
407   on_failure:
408     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
411 task:
412   name: macOS - Ventura - Meson
414   env:
415     CPUS: 4 # always get that much for cirrusci macOS instances
416     BUILD_JOBS: $CPUS
417     # Test performance regresses noticably when using all cores. 8 seems to
418     # work OK. See
419     # https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
420     TEST_JOBS: 8
421     IMAGE: ghcr.io/cirruslabs/macos-ventura-base:latest
423     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
424     CCACHE_DIR: ${HOME}/ccache
425     MACPORTS_CACHE: ${HOME}/macports-cache
427     CC: ccache cc
428     CXX: ccache c++
429     CFLAGS: -Og -ggdb
430     CXXFLAGS: -Og -ggdb
432   <<: *macos_task_template
434   depends_on: SanityCheck
435   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
437   sysinfo_script: |
438     id
439     uname -a
440     ulimit -a -H && ulimit -a -S
441     export
443   setup_core_files_script:
444     - mkdir ${HOME}/cores
445     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
447   # Use macports, even though homebrew is installed. The installation
448   # of the additional packages we need would take quite a while with
449   # homebrew, even if we cache the downloads. We can't cache all of
450   # homebrew, because it's already large. So we use macports. To cache
451   # the installation we create a .dmg file that we mount if it already
452   # exists.
453   # XXX: The reason for the direct p5.34* references is that we'd need
454   # the large macport tree around to figure out that p5-io-tty is
455   # actually p5.34-io-tty. Using the unversioned name works, but
456   # updates macports every time.
457   macports_cache:
458     folder: ${MACPORTS_CACHE}
459   setup_additional_packages_script: |
460     sh src/tools/ci/ci_macports_packages.sh \
461       ccache \
462       icu \
463       kerberos5 \
464       lz4 \
465       meson \
466       openldap \
467       openssl \
468       p5.34-io-tty \
469       p5.34-ipc-run \
470       tcl \
471       zstd
472     # Make macports install visible for subsequent steps
473     echo PATH=/opt/local/sbin/:/opt/local/bin/:$PATH >> $CIRRUS_ENV
474   upload_caches: macports
476   ccache_cache:
477     folder: $CCACHE_DIR
478   configure_script: |
479     export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
480     meson setup \
481       --buildtype=debug \
482       -Dextra_include_dirs=/opt/local/include \
483       -Dextra_lib_dirs=/opt/local/lib \
484       -Dcassert=true \
485       -Duuid=e2fs -Ddtrace=auto \
486       -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
487       build
489   build_script: ninja -C build -j${BUILD_JOBS}
490   upload_caches: ccache
492   test_world_script: |
493     ulimit -c unlimited # default is 0
494     ulimit -n 1024 # default is 256, pretty low
495     meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
497   on_failure:
498     <<: *on_failure_meson
499     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
502 WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
503   env:
504     # Half the allowed per-user CPU cores
505     CPUS: 4
507     # The default cirrus working dir is in a directory msbuild complains about
508     CIRRUS_WORKING_DIR: "c:/cirrus"
509     # git's tar doesn't deal with drive letters, see
510     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
511     TAR: "c:/windows/system32/tar.exe"
512     # Avoids port conflicts between concurrent tap test runs
513     PG_TEST_USE_UNIX_SOCKETS: 1
514     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
515     DISK_SIZE: 50
517   sysinfo_script: |
518     chcp
519     systeminfo
520     powershell -Command get-psdrive -psprovider filesystem
521     set
524 task:
525   name: Windows - Server 2019, VS 2019 - Meson & ninja
526   << : *WINDOWS_ENVIRONMENT_BASE
528   env:
529     TEST_JOBS: 8 # wild guess, data based value welcome
531     # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
532     # prevents crash reporting from working unless binaries do SetErrorMode()
533     # themselves. Furthermore, it appears that either python or, more likely,
534     # the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
535     # occasionally *trigger* a crash on process exit - which is hard to debug,
536     # given that it explicitly prevents crash dumps from working...
537     # 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
538     CIRRUS_WINDOWS_ERROR_MODE: 0x8001
539     IMAGE_FAMILY: pg-ci-windows-ci-vs-2019
541   <<: *windows_task_template
543   depends_on: SanityCheck
544   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
546   setup_additional_packages_script: |
547     REM choco install -y --no-progress ...
549   setup_hosts_file_script: |
550     echo 127.0.0.1 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
551     echo 127.0.0.2 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
552     echo 127.0.0.3 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
553     type c:\Windows\System32\Drivers\etc\hosts
555   # Use /DEBUG:FASTLINK to avoid high memory usage during linking
556   configure_script: |
557     vcvarsall x64
558     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
560   build_script: |
561     vcvarsall x64
562     ninja -C build
564   check_world_script: |
565     vcvarsall x64
566     meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
568   on_failure:
569     <<: *on_failure_meson
570     crashlog_artifacts:
571       path: "crashlog-*.txt"
572       type: text/plain
575 task:
576   << : *WINDOWS_ENVIRONMENT_BASE
577   name: Windows - Server 2019, MinGW64 - Meson
579   # due to resource constraints we don't run this task by default for now
580   trigger_type: manual
581   # worth using only_if despite being manual, otherwise this task will show up
582   # when e.g. ci-os-only: linux is used.
583   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
584   # otherwise it'll be sorted before other tasks
585   depends_on: SanityCheck
587   env:
588     TEST_JOBS: 4 # higher concurrency causes occasional failures
589     CCACHE_DIR: C:/msys64/ccache
590     CCACHE_MAXSIZE: "500M"
591     CCACHE_SLOPPINESS: pch_defines,time_macros
592     CCACHE_DEPEND: 1
593     # for some reason mingw plpython cannot find its installation without this
594     PYTHONHOME: C:/msys64/ucrt64
595     # prevents MSYS bash from resetting error mode
596     MSYS: winjitdebug
597     # Start bash in current working directory
598     CHERE_INVOKING: 1
599     BASH: C:\msys64\usr\bin\bash.exe -l
600     IMAGE_FAMILY: pg-ci-windows-ci-mingw64
602   <<: *windows_task_template
604   ccache_cache:
605     folder: ${CCACHE_DIR}
607   setup_additional_packages_script: |
608     REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
610   mingw_info_script: |
611     %BASH% -c "where gcc"
612     %BASH% -c "gcc --version"
613     %BASH% -c "where perl"
614     %BASH% -c "perl --version"
616   # disable -Dnls as the number of files it creates cause a noticable slowdown
617   configure_script: |
618     %BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
620   build_script: |
621     %BASH% -c "ninja -C build"
623   upload_caches: ccache
625   test_world_script: |
626     %BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
628   on_failure:
629     <<: *on_failure_meson
630     crashlog_artifacts:
631       path: "crashlog-*.txt"
632       type: text/plain
635 task:
636   name: CompilerWarnings
638   # To limit unnecessary work only run this once the SanityCheck
639   # succeeds. This is particularly important for this task as we intentionally
640   # use always: to continue after failures. Task that did not run count as a
641   # success, so we need to recheck SanityChecks's condition here ...
642   depends_on: SanityCheck
643   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
645   env:
646     CPUS: 4
647     BUILD_JOBS: 4
648     IMAGE_FAMILY: pg-ci-bullseye
650     # Use larger ccache cache, as this task compiles with multiple compilers /
651     # flag combinations
652     CCACHE_MAXSIZE: "1G"
653     CCACHE_DIR: "/tmp/ccache_dir"
655     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
656     LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
658   <<: *linux_task_template
660   sysinfo_script: |
661     id
662     uname -a
663     cat /proc/cmdline
664     ulimit -a -H && ulimit -a -S
665     gcc -v
666     clang -v
667     export
669   ccache_cache:
670     folder: $CCACHE_DIR
672   setup_additional_packages_script: |
673     #apt-get update
674     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
676   ###
677   # Test that code can be built with gcc/clang without warnings
678   ###
680   setup_script: echo "COPT=-Werror" > src/Makefile.custom
682   # Trace probes have a history of getting accidentally broken. Use the
683   # different compilers to build with different combinations of dtrace on/off
684   # and cassert on/off.
686   # gcc, cassert off, dtrace on
687   always:
688     gcc_warning_script: |
689       time ./configure \
690         --cache gcc.cache \
691         --enable-dtrace \
692         ${LINUX_CONFIGURE_FEATURES} \
693         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
694       make -s -j${BUILD_JOBS} clean
695       time make -s -j${BUILD_JOBS} world-bin
697   # gcc, cassert on, dtrace off
698   always:
699     gcc_a_warning_script: |
700       time ./configure \
701         --cache gcc.cache \
702         --enable-cassert \
703         ${LINUX_CONFIGURE_FEATURES} \
704         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
705       make -s -j${BUILD_JOBS} clean
706       time make -s -j${BUILD_JOBS} world-bin
708   # clang, cassert off, dtrace off
709   always:
710     clang_warning_script: |
711       time ./configure \
712         --cache clang.cache \
713         ${LINUX_CONFIGURE_FEATURES} \
714         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
715       make -s -j${BUILD_JOBS} clean
716       time make -s -j${BUILD_JOBS} world-bin
718   # clang, cassert on, dtrace on
719   always:
720     clang_a_warning_script: |
721       time ./configure \
722         --cache clang.cache \
723         --enable-cassert \
724         --enable-dtrace \
725         ${LINUX_CONFIGURE_FEATURES} \
726         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
727       make -s -j${BUILD_JOBS} clean
728       time make -s -j${BUILD_JOBS} world-bin
730   # cross-compile to windows
731   always:
732     mingw_cross_warning_script: |
733       time ./configure \
734         --host=x86_64-w64-mingw32 \
735         --enable-cassert \
736         --without-icu \
737         CC="ccache x86_64-w64-mingw32-gcc" \
738         CXX="ccache x86_64-w64-mingw32-g++"
739       make -s -j${BUILD_JOBS} clean
740       time make -s -j${BUILD_JOBS} world-bin
742   ###
743   # Verify docs can be built
744   ###
745   # XXX: Only do this if there have been changes in doc/ since last build
746   always:
747     docs_build_script: |
748       time ./configure \
749         --cache gcc.cache \
750         CC="ccache gcc" \
751         CXX="ccache g++" \
752         CLANG="ccache clang"
753       make -s -j${BUILD_JOBS} clean
754       time make -s -j${BUILD_JOBS} -C doc
756   ###
757   # Verify headerscheck / cpluspluscheck succeed
758   #
759   # - Don't use ccache, the files are uncacheable, polluting ccache's
760   #   cache
761   # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
762   # - XXX have to disable ICU to avoid errors:
763   #   https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
764   ###
765   always:
766     headers_headerscheck_script: |
767       time ./configure \
768         ${LINUX_CONFIGURE_FEATURES} \
769         --without-icu \
770         --quiet \
771         CC="gcc" CXX"=g++" CLANG="clang"
772       make -s -j${BUILD_JOBS} clean
773       time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
774     headers_cpluspluscheck_script: |
775       time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
777   always:
778     upload_caches: ccache