pg_upgrade: Tweak translatable strings
[pgsql.git] / .cirrus.yml
blobf23d6cae5527a67b2f08ad174d7cd2621fddc86f
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_core_files_script: |
77     mkdir -m 770 /tmp/cores
78     chown root:postgres /tmp/cores
79     sysctl kern.corefile='/tmp/cores/%N.%P.core'
80   setup_additional_packages_script: |
81     #pkg install -y ...
83   # NB: Intentionally build without --with-llvm. The freebsd image size is
84   # already large enough to make VM startup slow, and even without llvm
85   # freebsd already takes longer than other platforms except for windows.
86   configure_script: |
87     su postgres <<-EOF
88       ./configure \
89         --enable-cassert --enable-debug --enable-tap-tests \
90         --enable-nls \
91         \
92         --with-gssapi \
93         --with-icu \
94         --with-ldap \
95         --with-libxml \
96         --with-libxslt \
97         --with-lz4 \
98         --with-pam \
99         --with-perl \
100         --with-python \
101         --with-ssl=openssl \
102         --with-tcl --with-tclconfig=/usr/local/lib/tcl8.6/ \
103         --with-uuid=bsd \
104         --with-zstd \
105         \
106         --with-includes=/usr/local/include \
107         --with-libs=/usr/local/lib \
108         \
109         CC="ccache cc" \
110         CXX="ccache c++" \
111         CFLAGS="-Og -ggdb"
112     EOF
113   build_script: su postgres -c "gmake -s -j${BUILD_JOBS} world-bin"
114   upload_caches: ccache
116   # The use of script avoids make -Otarget complaints about fcntl() on
117   # platforms without support for locking pipes. See also
118   # https://savannah.gnu.org/bugs/?60774
119   # script uses pseudo-ttys, which do support locking.
120   test_world_script:
121     - su postgres -c "time script test.log gmake -s -j${TEST_JOBS} ${CHECK} ${CHECKFLAGS}"
123   on_failure:
124     <<: *on_failure
125     cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
128 # configure feature flags, shared between the task running the linux tests and
129 # the CompilerWarnings task
130 LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
131   --with-gssapi
132   --with-icu
133   --with-ldap
134   --with-libxml
135   --with-libxslt
136   --with-llvm
137   --with-lz4
138   --with-pam
139   --with-perl
140   --with-python
141   --with-selinux
142   --with-ssl=openssl
143   --with-systemd
144   --with-tcl --with-tclconfig=/usr/lib/tcl8.6/
145   --with-uuid=ossp
146   --with-zstd
149 task:
150   name: Linux - Debian Bullseye
152   env:
153     CPUS: 4
154     BUILD_JOBS: 4
155     TEST_JOBS: 8 # experimentally derived to be a decent choice
157     CCACHE_DIR: /tmp/ccache_dir
158     DEBUGINFOD_URLS: "https://debuginfod.debian.net"
160     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
162   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
164   compute_engine_instance:
165     image_project: $IMAGE_PROJECT
166     image: family/pg-ci-bullseye
167     platform: linux
168     cpu: $CPUS
169     memory: 2G
171   ccache_cache:
172     folder: ${CCACHE_DIR}
174   sysinfo_script: |
175     id
176     uname -a
177     cat /proc/cmdline
178     ulimit -a -H && ulimit -a -S
179     export
180   create_user_script: |
181     useradd -m postgres
182     chown -R postgres:postgres .
183     mkdir -p ${CCACHE_DIR}
184     chown -R postgres:postgres ${CCACHE_DIR}
185     echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
186     su postgres -c "ulimit -l -H && ulimit -l -S"
187   setup_core_files_script: |
188     mkdir -m 770 /tmp/cores
189     chown root:postgres /tmp/cores
190     sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
191   setup_additional_packages_script: |
192     #apt-get update
193     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
195   configure_script: |
196     su postgres <<-EOF
197       ./configure \
198         --enable-cassert --enable-debug --enable-tap-tests \
199         --enable-nls \
200         \
201         ${LINUX_CONFIGURE_FEATURES} \
202         \
203         CC="ccache gcc" \
204         CXX="ccache g++" \
205         CLANG="ccache clang" \
206         CFLAGS="-Og -ggdb" \
207         CXXFLAGS="-Og -ggdb"
208     EOF
209   build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
210   upload_caches: ccache
212   test_world_script: |
213     su postgres <<-EOF
214       ulimit -c unlimited # default is 0
215       make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
216     EOF
218   on_failure:
219     <<: *on_failure
220     cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
223 task:
224   name: macOS - Monterey
226   env:
227     CPUS: 12 # always get that much for cirrusci macOS instances
228     BUILD_JOBS: $CPUS
229     TEST_JOBS: $CPUS # already fast enough to not be worth tuning
231     CIRRUS_WORKING_DIR: ${HOME}/pgsql/
232     CCACHE_DIR: ${HOME}/ccache
233     HOMEBREW_CACHE: ${HOME}/homebrew-cache
234     PERL5LIB: ${HOME}/perl5/lib/perl5
236   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
238   osx_instance:
239     image: monterey-base
241   sysinfo_script: |
242     id
243     uname -a
244     ulimit -a -H && ulimit -a -S
245     export
247   setup_core_files_script:
248     - mkdir ${HOME}/cores
249     - sudo sysctl kern.corefile="${HOME}/cores/core.%P"
251   perl_cache:
252     folder: ~/perl5
253   cpan_install_script:
254     - perl -mIPC::Run -e 1 || cpan -T IPC::Run
255     - perl -mIO::Pty -e 1 || cpan -T IO::Pty
256   upload_caches: perl
259   # XXX: Could we instead install homebrew into a cached directory? The
260   # homebrew installation takes a good bit of time every time, even if the
261   # packages do not need to be downloaded.
262   homebrew_cache:
263     folder: $HOMEBREW_CACHE
264   setup_additional_packages_script: |
265     brew install \
266       ccache \
267       icu4c \
268       krb5 \
269       llvm \
270       lz4 \
271       make \
272       openldap \
273       openssl \
274       python \
275       tcl-tk \
276       zstd
278     brew cleanup -s # to reduce cache size
279   upload_caches: homebrew
281   ccache_cache:
282     folder: $CCACHE_DIR
283   configure_script: |
284     brewpath="/usr/local"
285     INCLUDES="${brewpath}/include:${INCLUDES}"
286     LIBS="${brewpath}/lib:${LIBS}"
288     for pkg in icu4c krb5 openldap openssl zstd ; do
289       pkgpath="${brewpath}/opt/${pkg}"
290       INCLUDES="${pkgpath}/include:${INCLUDES}"
291       LIBS="${pkgpath}/lib:${LIBS}"
292       PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
293     done
295     export PKG_CONFIG_PATH
297     ./configure \
298       --enable-cassert --enable-debug --enable-tap-tests \
299       --enable-nls \
300       \
301       --with-bonjour \
302       --with-gssapi \
303       --with-icu \
304       --with-ldap \
305       --with-libxml \
306       --with-libxslt \
307       --with-lz4 \
308       --with-perl \
309       --with-python \
310       --with-ssl=openssl \
311       --with-tcl --with-tclconfig=${brewpath}/opt/tcl-tk/lib/ \
312       --with-uuid=e2fs \
313       --with-zstd \
314       \
315       --prefix=${HOME}/install \
316       --with-includes="${INCLUDES}" \
317       --with-libs="${LIBS}" \
318       \
319       CC="ccache cc" \
320       CXX="ccache c++" \
321       CLANG="ccache ${brewpath}/llvm/bin/ccache" \
322       CFLAGS="-Og -ggdb" \
323       CXXFLAGS="-Og -ggdb" \
324       \
325       LLVM_CONFIG=${brewpath}/llvm/bin/llvm-config \
326       PYTHON=python3
327   build_script: gmake -s -j${BUILD_JOBS} world-bin
328   upload_caches: ccache
330   test_world_script: |
331     ulimit -c unlimited # default is 0
332     ulimit -n 1024 # default is 256, pretty low
333     # See freebsd use of script for explanation
334     script test.log gmake -s -j${TEST_JOBS} ${CHECK} ${CHECKFLAGS}
336   on_failure:
337     <<: *on_failure
338     cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
341 task:
342   name: Windows - Server 2019, VS 2019
344   env:
345     # Half the allowed per-user CPU cores
346     CPUS: 4
348     # Our windows infrastructure doesn't have test concurrency above the level
349     # of a single vcregress test target. Due to that, it's useful to run prove
350     # with multiple jobs. For the other tasks it isn't, because two sources
351     # (make and prove) of concurrency can overload machines.
352     #
353     # The concrete choice of 10 is based on a small bit of experimentation and
354     # likely can be improved upon further.
355     PROVE_FLAGS: -j10 --timer
357     # The default cirrus working dir is in a directory msbuild complains about
358     CIRRUS_WORKING_DIR: "c:/cirrus"
359     # Avoid re-installing over and over
360     NO_TEMP_INSTALL: 1
361     # git's tar doesn't deal with drive letters, see
362     # https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
363     TAR: "c:/windows/system32/tar.exe"
364     # Avoids port conflicts between concurrent tap test runs
365     PG_TEST_USE_UNIX_SOCKETS: 1
366     PG_REGRESS_SOCK_DIR: "c:/cirrus/"
367     # -m enables parallelism
368     # verbosity:minimal + Summary reduce verbosity, while keeping a summary of
369     #   errors/warnings
370     # ForceNoAlign prevents msbuild from introducing line-breaks for long lines
371     # disable file tracker, we're never going to rebuild, and it slows down the
372     #   build
373     MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo
375     # If tests hang forever, cirrus eventually times out. In that case log
376     # output etc is not uploaded, making the problem hard to debug. Of course
377     # tests internally should have shorter timeouts, but that's proven to not
378     # be sufficient. 15min currently is fast enough to finish individual test
379     # "suites".
380     T_C: "\"C:/Program Files/Git/usr/bin/timeout.exe\" -v -k60s 15m"
382     # startcreate_script starts a postgres instance that we don't want to get
383     # killed at the end of that script (it's stopped in stop_script). Can't
384     # trivially use background_scripts because a) need pg_ctl's dropping of
385     # permissions b) need to wait for startup to have finished, and we don't
386     # currently have a tool for that...
387     CIRRUS_ESCAPING_PROCESSES: 1
389   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
391   windows_container:
392     image: $CONTAINER_REPO/windows_ci_vs_2019:latest
393     cpu: $CPUS
394     memory: 4G
396   sysinfo_script: |
397     chcp
398     systeminfo
399     powershell -Command get-psdrive -psprovider filesystem
400     set
402   setup_additional_packages_script: |
403     REM choco install -y --no-progress ...
405   configure_script:
406     # copy errors out when using forward slashes
407     - copy src\tools\ci\windows_build_config.pl src\tools\msvc\config.pl
408     - vcvarsall x64
409     - perl src/tools/msvc/mkvcbuild.pl
410   build_script:
411     - vcvarsall x64
412     - msbuild %MSBFLAGS% pgsql.sln
413   tempinstall_script:
414     # Installation on windows currently only completely works from src/tools/msvc
415     - cd src/tools/msvc && perl install.pl %CIRRUS_WORKING_DIR%/tmp_install
417   test_regress_parallel_script: |
418     %T_C% perl src/tools/msvc/vcregress.pl check parallel
419   startcreate_script: |
420     rem paths to binaries need backslashes
421     tmp_install\bin\pg_ctl.exe initdb -D tmp_check/db -l tmp_check/initdb.log --options=--no-sync
422     echo include '%TEMP_CONFIG%' >> tmp_check/db/postgresql.conf
423     tmp_install\bin\pg_ctl.exe start -D tmp_check/db -l tmp_check/postmaster.log
425   test_pl_script: |
426     %T_C% perl src/tools/msvc/vcregress.pl plcheck
427   test_isolation_script: |
428     %T_C% perl src/tools/msvc/vcregress.pl isolationcheck
429   test_modules_script: |
430     %T_C% perl src/tools/msvc/vcregress.pl modulescheck
431   test_contrib_script: |
432     %T_C% perl src/tools/msvc/vcregress.pl contribcheck
433   stop_script: |
434     tmp_install\bin\pg_ctl.exe stop -D tmp_check/db -l tmp_check/postmaster.log
435   test_ssl_script: |
436     set with_ssl=openssl
437     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/ssl/
438   test_subscription_script: |
439     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/subscription/
440   test_authentication_script: |
441     %T_C% perl src/tools/msvc/vcregress.pl taptest ./src/test/authentication/
442   test_recovery_script: |
443     %T_C% perl src/tools/msvc/vcregress.pl recoverycheck
444   test_bin_script: |
445     %T_C% perl src/tools/msvc/vcregress.pl bincheck
446   test_ecpg_script: |
447     rem tries to build additional stuff
448     vcvarsall x64
449     rem References ecpg_regression.proj in the current dir
450     cd src/tools/msvc
451     %T_C% perl vcregress.pl ecpgcheck
453   on_failure:
454     <<: *on_failure
455     crashlog_artifacts:
456       path: "crashlog-*.txt"
457       type: text/plain
460 task:
461   name: CompilerWarnings
463   # To limit unnecessary work only run this once the normal linux test succeeds
464   depends_on:
465     - Linux - Debian Bullseye
467   env:
468     CPUS: 4
469     BUILD_JOBS: 4
471     # Use larger ccache cache, as this task compiles with multiple compilers /
472     # flag combinations
473     CCACHE_MAXSIZE: "1GB"
474     CCACHE_DIR: "/tmp/ccache_dir"
476     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
478   # task that did not run, count as a success, so we need to recheck Linux'
479   # condition here ...
480   only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
482   container:
483     image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest
484     cpu: $CPUS
486   sysinfo_script: |
487     id
488     uname -a
489     cat /proc/cmdline
490     ulimit -a -H && ulimit -a -S
491     gcc -v
492     clang -v
493     export
495   ccache_cache:
496     folder: $CCACHE_DIR
498   setup_additional_packages_script: |
499     #apt-get update
500     #DEBIAN_FRONTEND=noninteractive apt-get -y install ...
502   ###
503   # Test that code can be built with gcc/clang without warnings
504   ###
506   setup_script: echo "COPT=-Werror" > src/Makefile.custom
508   # Trace probes have a history of getting accidentally broken. Use the
509   # different compilers to build with different combinations of dtrace on/off
510   # and cassert on/off.
512   # gcc, cassert off, dtrace on
513   always:
514     gcc_warning_script: |
515       time ./configure \
516         --cache gcc.cache \
517         --enable-dtrace \
518         ${LINUX_CONFIGURE_FEATURES} \
519         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
520       make -s -j${BUILD_JOBS} clean
521       time make -s -j${BUILD_JOBS} world-bin
523   # gcc, cassert on, dtrace off
524   always:
525     gcc_a_warning_script: |
526       time ./configure \
527         --cache gcc.cache \
528         --enable-cassert \
529         ${LINUX_CONFIGURE_FEATURES} \
530         CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
531       make -s -j${BUILD_JOBS} clean
532       time make -s -j${BUILD_JOBS} world-bin
534   # clang, cassert off, dtrace off
535   always:
536     clang_warning_script: |
537       time ./configure \
538         --cache clang.cache \
539         ${LINUX_CONFIGURE_FEATURES} \
540         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
541       make -s -j${BUILD_JOBS} clean
542       time make -s -j${BUILD_JOBS} world-bin
544   # clang, cassert on, dtrace on
545   always:
546     clang_a_warning_script: |
547       time ./configure \
548         --cache clang.cache \
549         --enable-cassert \
550         --enable-dtrace \
551         ${LINUX_CONFIGURE_FEATURES} \
552         CC="ccache clang" CXX="ccache clang++" CLANG="ccache clang"
553       make -s -j${BUILD_JOBS} clean
554       time make -s -j${BUILD_JOBS} world-bin
556   # cross-compile to windows
557   always:
558     mingw_cross_warning_script: |
559       time ./configure \
560         --host=x86_64-w64-mingw32 \
561         --enable-cassert \
562         CC="ccache x86_64-w64-mingw32-gcc" \
563         CXX="ccache x86_64-w64-mingw32-g++"
564       make -s -j${BUILD_JOBS} clean
565       time make -s -j${BUILD_JOBS} world-bin
567   ###
568   # Verify docs can be built
569   ###
570   # XXX: Only do this if there have been changes in doc/ since last build
571   always:
572     docs_build_script: |
573       time ./configure \
574         --cache gcc.cache \
575         CC="ccache gcc" \
576         CXX="ccache g++" \
577         CLANG="ccache clang"
578       make -s -j${BUILD_JOBS} clean
579       time make -s -j${BUILD_JOBS} -C doc
581   ###
582   # Verify headerscheck / cpluspluscheck succeed
583   #
584   # - Don't use ccache, the files are uncacheable, polluting ccache's
585   #   cache
586   # - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
587   # - XXX have to disable ICU to avoid errors:
588   #   https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
589   # - XXX: the -Wno-register avoids verbose warnings:
590   #   https://postgr.es/m/20220308181837.aun3tdtdvao4vb7o%40alap3.anarazel.de
591   ###
592   always:
593     headers_headerscheck_script: |
594       time ./configure \
595         ${LINUX_CONFIGURE_FEATURES} \
596         --without-icu \
597         --quiet \
598         CC="gcc" CXX"=g++" CLANG="clang"
599       make -s -j${BUILD_JOBS} clean
600       time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
601     headers_cpluspluscheck_script: |
602       time make -s cpluspluscheck EXTRAFLAGS='-Wno-register -fmax-errors=10'
604   always:
605     upload_caches: ccache