diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml index cfe2117e02e..0d99b787f5f 100644 --- a/.cirrus.tasks.yml +++ b/.cirrus.tasks.yml @@ -216,6 +216,98 @@ task: cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores +task: + depends_on: SanityCheck + trigger_type: manual + + env: + # Below are experimentally derived to be a decent choice. + CPUS: 4 + BUILD_JOBS: 8 + TEST_JOBS: 8 + + # Default working directory is /tmp, but its total size (1.2 GB) is not + # enough, so different working and cache directory are set. + CIRRUS_WORKING_DIR: /home/postgres/postgres + CCACHE_DIR: /home/postgres/cache + + PATH: /usr/sbin:$PATH + + matrix: + - name: NetBSD - Meson + only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*netbsd.*' + env: + IMAGE_FAMILY: pg-ci-netbsd-postgres + PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/pkg/lib/pkgconfig' + # initdb fails with: 'invalid locale settings' error on NetBSD. + # Force 'LANG' and 'LC_*' variables to be 'C'. + # See https://postgr.es/m/2490325.1734471752%40sss.pgh.pa.us + LANG: "C" + LC_ALL: "C" + # -Duuid is not set for the NetBSD, see the comment below, above + # configure_script, for more information. + setup_additional_packages_script: | + #pkgin -y install ... + <<: *netbsd_task_template + + - name: OpenBSD - Meson + only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*openbsd.*' + env: + IMAGE_FAMILY: pg-ci-openbsd-postgres + PKGCONFIG_PATH: '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig' + UUID: -Duuid=e2fs + TCL: -Dtcl_version=tcl86 + setup_additional_packages_script: | + #pkg_add -I ... + <<: *openbsd_task_template + + sysinfo_script: | + locale + id + uname -a + ulimit -a -H && ulimit -a -S + env + + ccache_cache: + folder: $CCACHE_DIR + + create_user_script: | + useradd postgres + chown -R postgres:users /home/postgres + mkdir -p ${CCACHE_DIR} + chown -R postgres:users ${CCACHE_DIR} + + # -Duuid=bsd is not set since 'bsd' uuid option + # is not working on NetBSD & OpenBSD. See + # https://www.postgresql.org/message-id/17358-89806e7420797025@postgresql.org + # And other uuid options are not available on NetBSD. + configure_script: | + su postgres <<-EOF + meson setup \ + --buildtype=debugoptimized \ + --pkg-config-path ${PKGCONFIG_PATH} \ + -Dcassert=true -Dinjection_points=true \ + -Dssl=openssl ${UUID} ${TCL} \ + -DPG_TEST_EXTRA="$PG_TEST_EXTRA" \ + build + EOF + + build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}' + upload_caches: ccache + + test_world_script: | + su postgres <<-EOF + ulimit -c unlimited + # Otherwise tests will fail on OpenBSD, due to inability to start enough + # processes. + ulimit -p 256 + meson test $MTEST_ARGS --num-processes ${TEST_JOBS} + EOF + + on_failure: + <<: *on_failure_meson + + # configure feature flags, shared between the task running the linux tests and # the CompilerWarnings task LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >- diff --git a/.cirrus.yml b/.cirrus.yml index a83129ae46d..33c6e481d74 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -52,6 +52,16 @@ default_freebsd_task_template: &freebsd_task_template PLATFORM: freebsd <<: *cirrus_community_vm_template +default_netbsd_task_template: &netbsd_task_template + env: + PLATFORM: netbsd + <<: *cirrus_community_vm_template + +default_openbsd_task_template: &openbsd_task_template + env: + PLATFORM: openbsd + <<: *cirrus_community_vm_template + default_windows_task_template: &windows_task_template env: diff --git a/src/tools/ci/README b/src/tools/ci/README index 30ddd200c96..12c1e7c308f 100644 --- a/src/tools/ci/README +++ b/src/tools/ci/README @@ -61,7 +61,7 @@ Controlling CI via commit messages The behavior of CI can be controlled by special content in commit messages. Currently the following controls are available: -- ci-os-only: {(freebsd|linux|macos|windows|mingw)} +- ci-os-only: {(freebsd|linux|macos|mingw|netbsd|openbsd|windows)} Only runs CI on operating systems specified. This can be useful when addressing portability issues affecting only a subset of platforms.