Re-update Unicode data to CLDR 39
[pgsql.git] / .cirrus.yml
blob40854046d66dd5c1234eda4605b591feb7b37c33
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   PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
26   TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
27   PG_TEST_EXTRA: kerberos ldap ssl
30 # What files to preserve in case tests fail
31 on_failure: &on_failure
32   log_artifacts:
33     paths:
34       - "**/*.log"
35       - "**/*.diffs"
36       - "**/regress_log_*"
37     type: text/plain
39 task:
40   name: FreeBSD - 13
42   env:
43     # FreeBSD on GCP is slow when running with larger number of CPUS /
44     # jobs. Using one more job than cpus seems to work best.
45     CPUS: 2
46     BUILD_JOBS: 3
47     TEST_JOBS: 3
49     CCACHE_DIR: /tmp/ccache_dir
51   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
53   compute_engine_instance:
54     image_project: $IMAGE_PROJECT
55     image: family/pg-ci-freebsd-13-0
56     platform: freebsd
57     cpu: $CPUS
58     memory: 2G
59     disk: 50
61   sysinfo_script: |
62     id
63     uname -a
64     ulimit -a -H && ulimit -a -S
65     export
67   ccache_cache:
68     folder: $CCACHE_DIR
69   # Workaround around performance issues due to 32KB block size
70   repartition_script: src/tools/ci/gcp_freebsd_repartition.sh
71   create_user_script: |
72     pw useradd postgres
73     chown -R postgres:postgres .
74     mkdir -p ${CCACHE_DIR}
75     chown -R postgres:postgres ${CCACHE_DIR}
76   setup_cores_script: |
77     mkdir -m 770 /tmp/cores
78     chown root:postgres /tmp/cores
79     sysctl kern.corefile='/tmp/cores/%N.%P.core'
81   # NB: Intentionally build without --with-llvm. The freebsd image size is
82   # already large enough to make VM startup slow, and even without llvm
83   # freebsd already takes longer than other platforms except for windows.
84   configure_script: |
85     su postgres <<-EOF
86       ./configure \
87         --enable-cassert --enable-debug --enable-tap-tests \
88         --enable-nls \
89         \
90         --with-gssapi \
91         --with-icu \
92         --with-ldap \
93         --with-libxml \
94         --with-libxslt \
95         --with-lz4 \
96         --with-pam \
97         --with-perl \
98         --with-python \
99         --with-ssl=openssl \
100         --with-tcl --with-tclconfig=/usr/local/lib/tcl8.6/ \
101         --with-uuid=bsd \
102         \
103         --with-includes=/usr/local/include \
104         --with-libs=/usr/local/lib \
105         \
106         CC="ccache cc" \
107         CXX="ccache c++" \
108         CFLAGS="-O0 -ggdb"
109     EOF
110   build_script: su postgres -c "gmake -s -j${BUILD_JOBS} world-bin"
111   upload_caches: ccache
113   # The use of script avoids make -Otarget complaints about fcntl() on
114   # platforms without support for locking pipes. See also
115   # https://savannah.gnu.org/bugs/?60774
116   # script uses pseudo-ttys, which do support locking.
117   test_world_script:
118     - su postgres -c "time script test.log gmake -s -j${TEST_JOBS} ${CHECK} ${CHECKFLAGS}"
120   on_failure:
121     <<: *on_failure
122     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
125 # configure feature flags, shared between the task running the linux tests and
126 # the CompilerWarnings task
127 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
128   --with-gssapi
129   --with-icu
130   --with-ldap
131   --with-libxml
132   --with-libxslt
133   --with-llvm
134   --with-lz4
135   --with-pam
136   --with-perl
137   --with-python
138   --with-selinux
139   --with-ssl=openssl
140   --with-systemd
141   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
142   --with-uuid=ossp
145 task:
146   name: Linux - Debian Bullseye
148   env:
149     CPUS: 4
150     BUILD_JOBS: 4
151     TEST_JOBS: 8 # experimentally derived to be a decent choice
153     CCACHE_DIR: /tmp/ccache_dir
154     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
156     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
158   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
160   compute_engine_instance:
161     image_project: $IMAGE_PROJECT
162     image: family/pg-ci-bullseye
163     platform: linux
164     cpu: $CPUS
165     memory: 2G
167   ccache_cache:
168     folder: ${CCACHE_DIR}
170   sysinfo_script: |
171     id
172     uname -a
173     cat /proc/cmdline
174     ulimit -a -H && ulimit -a -S
175     export
176   create_user_script: |
177     useradd -m postgres
178     chown -R postgres:postgres .
179     mkdir -p ${CCACHE_DIR}
180     chown -R postgres:postgres ${CCACHE_DIR}
181     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
182     su postgres -c "ulimit -l -H && ulimit -l -S"
183   setup_cores_script: |
184     mkdir -m 770 /tmp/cores
185     chown root:postgres /tmp/cores
186     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
188   configure_script: |
189     su postgres <<-EOF
190       ./configure \
191         --enable-cassert --enable-debug --enable-tap-tests \
192         --enable-nls \
193         \
194         ${LINUX_CONFIGURE_FEATURES} \
195         \
196         CC="ccache gcc" \
197         CXX="ccache g++" \
198         CLANG="ccache clang" \
199         CFLAGS="-O0 -ggdb" \
200         CXXFLAGS="-O0 -ggdb"
201     EOF
202   build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
203   upload_caches: ccache
205   test_world_script: |
206     su postgres <<-EOF
207       ulimit -c unlimited # default is 0
208       make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
209     EOF
211   on_failure:
212     <<: *on_failure
213     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
216 task:
217   name: macOS - Monterey
219   env:
220     CPUS: 12 # always get that much for cirrusci macOS instances
221     BUILD_JOBS: $CPUS
222     TEST_JOBS: $CPUS # already fast enough to not be worth tuning
224     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
225     CCACHE_DIR: ${HOME}/ccache
226     HOMEBREW_CACHE: ${HOME}/homebrew-cache
227     PERL5LIB: ${HOME}/perl5/lib/perl5
229   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
231   osx_instance:
232     image: monterey-base
234   sysinfo_script: |
235     id
236     uname -a
237     ulimit -a -H && ulimit -a -S
238     export
240   setup_cores_script:
241     - mkdir ${HOME}/cores
242     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
244   perl_cache:
245     folder: ~/perl5
246   cpan_install_script:
247     - perl -mIPC::Run -e 1 || cpan -T IPC::Run
248     - perl -mIO::Pty -e 1 || cpan -T IO::Pty
249   upload_caches: perl
252   # XXX: Could we instead install homebrew into a cached directory? The
253   # homebrew installation takes a good bit of time every time, even if the
254   # packages do not need to be downloaded.
255   homebrew_cache:
256     folder: $HOMEBREW_CACHE
257   homebrew_install_script: |
258     brew install \
259       ccache \
260       icu4c \
261       krb5 \
262       llvm \
263       lz4 \
264       make \
265       openldap \
266       openssl \
267       python \
268       tcl-tk
270     brew cleanup -s # to reduce cache size
271   upload_caches: homebrew
273   ccache_cache:
274     folder: $CCACHE_DIR
275   configure_script: |
276     brewpath="/usr/local"
277     INCLUDES="${brewpath}/include:${INCLUDES}"
278     LIBS="${brewpath}/lib:${LIBS}"
280     for pkg in icu4c krb5 openldap openssl ; do
281       pkgpath="${brewpath}/opt/${pkg}"
282       INCLUDES="${pkgpath}/include:${INCLUDES}"
283       LIBS="${pkgpath}/lib:${LIBS}"
284       PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
285     done
287     export PKG_CONFIG_PATH
289     ./configure \
290       --enable-cassert --enable-debug --enable-tap-tests \
291       --enable-nls \
292       \
293       --with-bonjour \
294       --with-gssapi \
295       --with-icu \
296       --with-ldap \
297       --with-libxml \
298       --with-libxslt \
299       --with-lz4 \
300       --with-perl \
301       --with-python \
302       --with-ssl=openssl \
303       --with-tcl --with-tclconfig=${brewpath}/opt/tcl-tk/lib/ \
304       --with-uuid=e2fs \
305       \
306       --prefix=${HOME}/install \
307       --with-includes="${INCLUDES}" \
308       --with-libs="${LIBS}" \
309       \
310       CC="ccache cc" \
311       CXX="ccache c++" \
312       CLANG="ccache ${brewpath}/llvm/bin/ccache" \
313       CFLAGS="-O0 -ggdb" \
314       CXXFLAGS="-O0 -ggdb" \
315       \
316       LLVM_CONFIG=${brewpath}/llvm/bin/llvm-config \
317       PYTHON=python3
318   build_script: gmake -s -j${BUILD_JOBS} world-bin
319   upload_caches: ccache
321   test_world_script: |
322     ulimit -c unlimited # default is 0
323     ulimit -n 1024 # default is 256, pretty low
324     # See freebsd use of script for explanation
325     script test.log gmake -s -j${TEST_JOBS} ${CHECK} ${CHECKFLAGS}
327   on_failure:
328     <<: *on_failure
329     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
332 task:
333   name: Windows - Server 2019, VS 2019
335   env:
336     # Half the allowed per-user CPU cores
337     CPUS: 4
339     # Our windows infrastructure doesn't have test concurrency above the level
340     # of a single vcregress test target. Due to that, it's useful to run prove
341     # with multiple jobs. For the other tasks it isn't, because two sources
342     # (make and prove) of concurrency can overload machines.
343     #
344     # The concrete choice of 10 is based on a small bit of experimentation and
345     # likely can be improved upon further.
346     PROVE_FLAGS: -j10 --timer
348     # The default cirrus working dir is in a directory msbuild complains about
349     CIRRUS_WORKING_DIR: "c:/cirrus"
350     # Avoid re-installing over and over
351     NO_TEMP_INSTALL: 1
352     # git's tar doesn't deal with drive letters, see
353     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
354     TAR: "c:/windows/system32/tar.exe"
355     # Avoids port conflicts between concurrent tap test runs
356     PG_TEST_USE_UNIX_SOCKETS: 1
357     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
358     # -m enables parallelism
359     # verbosity:minimal + Summary reduce verbosity, while keeping a summary of
360     #   errors/warnings
361     # ForceNoAlign prevents msbuild from introducing line-breaks for long lines
362     # disable file tracker, we're never going to rebuild, and it slows down the
363     #   build
364     MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo
366     # If tests hang forever, cirrus eventually times out. In that case log
367     # output etc is not uploaded, making the problem hard to debug. Of course
368     # tests internally should have shorter timeouts, but that's proven to not
369     # be sufficient. 15min currently is fast enough to finish individual test
370     # "suites".
371     T_C: "\"C:/Program Files/Git/usr/bin/timeout.exe\" -v -k60s 15m"
373     # Temporarily work around cirrus-ci bug causing processes started from a
374     # script to be killed, even if intentionally running in background. See
375     # https://github.com/cirruslabs/cirrus-ci-agent/issues/218
376     # https://postgr.es/m/CA%2BhUKGKx7k14n2nAALSvv6M_AB6oHasNBA65X6Dvo8hwfi9y0A%40mail.gmail.com
377     CIRRUS_AGENT_VERSION: 1.73.2
379   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
381   windows_container:
382     image: $CONTAINER_REPO/windows_ci_vs_2019:latest
383     cpu: $CPUS
384     memory: 4G
386   sysinfo_script: |
387     chcp
388     systeminfo
389     powershell -Command get-psdrive -psprovider filesystem
390     set
392   configure_script:
393     # copy errors out when using forward slashes
394     - copy src\tools\ci\windows_build_config.pl src\tools\msvc\config.pl
395     - vcvarsall x64
396     - perl src/tools/msvc/mkvcbuild.pl
397   build_script:
398     - vcvarsall x64
399     - msbuild %MSBFLAGS% pgsql.sln
400   tempinstall_script:
401     # Installation on windows currently only completely works from src/tools/msvc
402     - cd src/tools/msvc && perl install.pl %CIRRUS_WORKING_DIR%/tmp_install
404   test_regress_parallel_script: |
405     %T_C% perl src/tools/msvc/vcregress.pl check parallel
406   startcreate_script: |
407     rem paths to binaries need backslashes
408     tmp_install\bin\pg_ctl.exe initdb -D tmp_check/db -l tmp_check/initdb.log --options=--no-sync
409     echo include '%TEMP_CONFIG%' >> tmp_check/db/postgresql.conf
410     tmp_install\bin\pg_ctl.exe start -D tmp_check/db -l tmp_check/postmaster.log
412   test_pl_script: |
413     %T_C% perl src/tools/msvc/vcregress.pl plcheck
414   test_isolation_script: |
415     %T_C% perl src/tools/msvc/vcregress.pl isolationcheck
416   test_modules_script: |
417     %T_C% perl src/tools/msvc/vcregress.pl modulescheck
418   test_contrib_script: |
419     %T_C% perl src/tools/msvc/vcregress.pl contribcheck
420   stop_script: |
421     tmp_install\bin\pg_ctl.exe stop -D tmp_check/db -l tmp_check/postmaster.log
422   test_ssl_script: |
423     set with_ssl=openssl
424     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/ssl/
425   test_subscription_script: |
426     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/subscription/
427   test_authentication_script: |
428     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/authentication/
429   test_recovery_script: |
430     %T_C% perl src/tools/msvc/vcregress.pl recoverycheck
431   test_bin_script: |
432     %T_C% perl src/tools/msvc/vcregress.pl bincheck
433   test_pg_upgrade_script: |
434     %T_C% perl src/tools/msvc/vcregress.pl upgradecheck
435   test_ecpg_script: |
436     rem tries to build additional stuff
437     vcvarsall x64
438     rem References ecpg_regression.proj in the current dir
439     cd src/tools/msvc
440     %T_C% perl vcregress.pl ecpgcheck
442   on_failure:
443     <<: *on_failure
444     crashlog_artifacts:
445       path: "crashlog-*.txt"
446       type: text/plain
449 task:
450   name: CompilerWarnings
452   # To limit unnecessary work only run this once the normal linux test succeeds
453   depends_on:
454     - Linux - Debian Bullseye
456   env:
457     CPUS: 4
458     BUILD_JOBS: 4
460     # Use larger ccache cache, as this task compiles with multiple compilers /
461     # flag combinations
462     CCACHE_MAXSIZE: "1GB"
463     CCACHE_DIR: "/tmp/ccache_dir"
465     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
467   # task that did not run, count as a success, so we need to recheck Linux'
468   # condition here ...
469   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
471   container:
472     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
473     cpu: $CPUS
475   sysinfo_script: |
476     id
477     uname -a
478     cat /proc/cmdline
479     ulimit -a -H && ulimit -a -S
480     gcc -v
481     clang -v
482     export
484   ccache_cache:
485     folder: $CCACHE_DIR
487   ###
488   # Test that code can be built with gcc/clang without warnings
489   ###
491   setup_script: echo "COPT=-Werror" > src/Makefile.custom
493   # Trace probes have a history of getting accidentally broken. Use the
494   # different compilers to build with different combinations of dtrace on/off
495   # and cassert on/off.
497   # gcc, cassert off, dtrace on
498   always:
499     gcc_warning_script: |
500       time ./configure \
501         --cache gcc.cache \
502         --enable-dtrace \
503         ${LINUX_CONFIGURE_FEATURES} \
504         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
505       make -s -j${BUILD_JOBS} clean
506       time make -s -j${BUILD_JOBS} world-bin
508   # gcc, cassert on, dtrace off
509   always:
510     gcc_a_warning_script: |
511       time ./configure \
512         --cache gcc.cache \
513         --enable-cassert \
514         ${LINUX_CONFIGURE_FEATURES} \
515         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
516       make -s -j${BUILD_JOBS} clean
517       time make -s -j${BUILD_JOBS} world-bin
519   # clang, cassert off, dtrace off
520   always:
521     clang_warning_script: |
522       time ./configure \
523         --cache clang.cache \
524         ${LINUX_CONFIGURE_FEATURES} \
525         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
526       make -s -j${BUILD_JOBS} clean
527       time make -s -j${BUILD_JOBS} world-bin
529   # clang, cassert on, dtrace on
530   always:
531     clang_a_warning_script: |
532       time ./configure \
533         --cache clang.cache \
534         --enable-cassert \
535         --enable-dtrace \
536         ${LINUX_CONFIGURE_FEATURES} \
537         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
538       make -s -j${BUILD_JOBS} clean
539       time make -s -j${BUILD_JOBS} world-bin
541   # cross-compile to windows
542   always:
543     mingw_cross_warning_script: |
544       time ./configure \
545         --host=x86_64-w64-mingw32 \
546         --enable-cassert \
547         CC="ccache x86_64-w64-mingw32-gcc" \
548         CXX="ccache x86_64-w64-mingw32-g++"
549       make -s -j${BUILD_JOBS} clean
550       time make -s -j${BUILD_JOBS} world-bin
552   ###
553   # Verify docs can be built
554   ###
555   # XXX: Only do this if there have been changes in doc/ since last build
556   always:
557     docs_build_script: |
558       time ./configure \
559         --cache gcc.cache \
560         CC="ccache gcc" \
561         CXX="ccache g++" \
562         CLANG="ccache clang"
563       make -s -j${BUILD_JOBS} clean
564       time make -s -j${BUILD_JOBS} -C doc
566   always:
567     upload_caches: ccache