2021-12-30 18:59:20 -08:00
|
|
|
# CI configuration file for CI utilizing cirrus-ci.org
|
|
|
|
#
|
|
|
|
# For instructions on how to enable the CI integration in a repository and
|
|
|
|
# further details, see src/tools/ci/README
|
2025-03-05 13:19:28 -05:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# NB: Different tasks intentionally test with different, non-default,
|
|
|
|
# configurations, to increase the chance of catching problems. Each task with
|
|
|
|
# non-obvious non-default documents their oddity at the top of the task,
|
|
|
|
# prefixed by "SPECIAL:".
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
# The lower depth accelerates git clone. Use a bit of depth so that
|
2023-01-03 16:26:14 +09:00
|
|
|
# concurrent tasks and retrying older jobs have a chance of working.
|
2021-12-30 18:59:20 -08:00
|
|
|
CIRRUS_CLONE_DEPTH: 500
|
|
|
|
# Useful to be able to analyse what in a script takes long
|
|
|
|
CIRRUS_LOG_TIMESTAMP: true
|
|
|
|
|
|
|
|
CCACHE_MAXSIZE: "250M"
|
|
|
|
|
|
|
|
# target to test, for all but windows
|
|
|
|
CHECK: check-world PROVE_FLAGS=$PROVE_FLAGS
|
|
|
|
CHECKFLAGS: -Otarget
|
|
|
|
PROVE_FLAGS: --timer
|
2025-02-04 17:45:56 -05:00
|
|
|
# Build test dependencies as part of the build step, to see compiler
|
|
|
|
# errors/warnings in one place.
|
|
|
|
MBUILD_TARGET: all testprep
|
2022-09-21 21:53:18 -07:00
|
|
|
MTEST_ARGS: --print-errorlogs --no-rebuild -C build
|
2021-12-30 18:59:20 -08:00
|
|
|
PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
|
|
|
|
TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
|
Add support for OAUTHBEARER SASL mechanism
This commit implements OAUTHBEARER, RFC 7628, and OAuth 2.0 Device
Authorization Grants, RFC 8628. In order to use this there is a
new pg_hba auth method called oauth. When speaking to a OAuth-
enabled server, it looks a bit like this:
$ psql 'host=example.org oauth_issuer=... oauth_client_id=...'
Visit https://oauth.example.org/login and enter the code: FPQ2-M4BG
Device authorization is currently the only supported flow so the
OAuth issuer must support that in order for users to authenticate.
Third-party clients may however extend this and provide their own
flows. The built-in device authorization flow is currently not
supported on Windows.
In order for validation to happen server side a new framework for
plugging in OAuth validation modules is added. As validation is
implementation specific, with no default specified in the standard,
PostgreSQL does not ship with one built-in. Each pg_hba entry can
specify a specific validator or be left blank for the validator
installed as default.
This adds a requirement on libcurl for the client side support,
which is optional to build, but the server side has no additional
build requirements. In order to run the tests, Python is required
as this adds a https server written in Python. Tests are gated
behind PG_TEST_EXTRA as they open ports.
This patch has been a multi-year project with many contributors
involved with reviews and in-depth discussions: Michael Paquier,
Heikki Linnakangas, Zhihong Yu, Mahendrakar Srinivasarao, Andrey
Chudnovsky and Stephen Frost to name a few. While Jacob Champion
is the main author there have been some levels of hacking by others.
Daniel Gustafsson contributed the validation module and various bits
and pieces; Thomas Munro wrote the client side support for kqueue.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: Kashif Zeeshan <kashi.zeeshan@gmail.com>
Discussion: https://postgr.es/m/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com
2025-02-20 16:25:17 +01:00
|
|
|
PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
|
|
|
|
# What files to preserve in case tests fail
|
2022-09-21 21:53:18 -07:00
|
|
|
on_failure_ac: &on_failure_ac
|
2021-12-30 18:59:20 -08:00
|
|
|
log_artifacts:
|
2022-02-12 15:29:08 -08:00
|
|
|
paths:
|
|
|
|
- "**/*.log"
|
2022-02-12 19:38:06 -08:00
|
|
|
- "**/*.diffs"
|
2022-02-12 15:29:08 -08:00
|
|
|
- "**/regress_log_*"
|
2021-12-30 18:59:20 -08:00
|
|
|
type: text/plain
|
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
on_failure_meson: &on_failure_meson
|
|
|
|
testrun_artifacts:
|
|
|
|
paths:
|
2022-09-29 16:09:09 -07:00
|
|
|
- "build*/testrun/**/*.log"
|
|
|
|
- "build*/testrun/**/*.diffs"
|
|
|
|
- "build*/testrun/**/regress_log_*"
|
2022-09-21 21:53:18 -07:00
|
|
|
type: text/plain
|
|
|
|
|
|
|
|
# In theory it'd be nice to upload the junit files meson generates, so that
|
|
|
|
# cirrus will nicely annotate the commit. Unfortunately the files don't
|
2023-01-03 16:26:14 +09:00
|
|
|
# contain identifiable file + line numbers right now, so the annotations
|
2022-09-21 21:53:18 -07:00
|
|
|
# don't end up useful. We could probably improve on that with a some custom
|
|
|
|
# conversion script, but ...
|
|
|
|
meson_log_artifacts:
|
2022-09-29 16:09:09 -07:00
|
|
|
path: "build*/meson-logs/*.txt"
|
2022-09-21 21:53:18 -07:00
|
|
|
type: text/plain
|
|
|
|
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
# To avoid unnecessarily spinning up a lot of VMs / containers for entirely
|
|
|
|
# broken commits, have a minimal task that all others depend on.
|
2025-03-05 13:19:28 -05:00
|
|
|
#
|
|
|
|
# SPECIAL:
|
|
|
|
# - Builds with --auto-features=disabled and thus almost no enabled
|
|
|
|
# dependencies
|
2022-11-21 15:13:09 -08:00
|
|
|
task:
|
|
|
|
name: SanityCheck
|
|
|
|
|
|
|
|
# If a specific OS is requested, don't run the sanity check. This shortens
|
|
|
|
# push-wait-for-ci cycle time a bit when debugging operating system specific
|
|
|
|
# failures. Uses skip instead of only_if, as cirrus otherwise warns about
|
|
|
|
# only_if conditions not matching.
|
|
|
|
skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
|
|
|
|
|
|
|
|
env:
|
|
|
|
CPUS: 4
|
|
|
|
BUILD_JOBS: 8
|
|
|
|
TEST_JOBS: 8
|
2024-07-15 09:26:01 -07:00
|
|
|
IMAGE_FAMILY: pg-ci-bookworm
|
2022-11-21 15:13:09 -08:00
|
|
|
CCACHE_DIR: ${CIRRUS_WORKING_DIR}/ccache_dir
|
|
|
|
# no options enabled, should be small
|
|
|
|
CCACHE_MAXSIZE: "150M"
|
|
|
|
|
2023-08-23 12:25:56 -07:00
|
|
|
# While containers would start up a bit quicker, building is a bit
|
|
|
|
# slower. This way we don't have to maintain a container image.
|
|
|
|
<<: *linux_task_template
|
2022-11-21 15:13:09 -08:00
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: $CCACHE_DIR
|
|
|
|
|
|
|
|
create_user_script: |
|
|
|
|
useradd -m postgres
|
|
|
|
chown -R postgres:postgres .
|
|
|
|
mkdir -p ${CCACHE_DIR}
|
|
|
|
chown -R postgres:postgres ${CCACHE_DIR}
|
|
|
|
echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
|
|
|
|
su postgres -c "ulimit -l -H && ulimit -l -S"
|
|
|
|
# Can't change container's kernel.core_pattern. Postgres user can't write
|
|
|
|
# to / normally. Change that.
|
|
|
|
chown root:postgres /
|
|
|
|
chmod g+rwx /
|
|
|
|
|
|
|
|
configure_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
meson setup \
|
|
|
|
--buildtype=debug \
|
|
|
|
--auto-features=disabled \
|
|
|
|
-Dtap_tests=enabled \
|
|
|
|
build
|
|
|
|
EOF
|
|
|
|
build_script: |
|
|
|
|
su postgres <<-EOF
|
2025-02-04 17:45:56 -05:00
|
|
|
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
2022-11-21 15:13:09 -08:00
|
|
|
EOF
|
|
|
|
upload_caches: ccache
|
|
|
|
|
|
|
|
# Run a minimal set of tests. The main regression tests take too long for
|
|
|
|
# this purpose. For now this is a random quick pg_regress style test, and a
|
|
|
|
# tap test that exercises both a frontend binary and the backend.
|
|
|
|
test_minimal_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ulimit -c unlimited
|
2023-08-24 14:17:03 -07:00
|
|
|
meson test $MTEST_ARGS --suite setup
|
2022-11-21 15:13:09 -08:00
|
|
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
|
2023-08-24 14:17:03 -07:00
|
|
|
cube/regress pg_ctl/001_start_stop
|
2022-11-21 15:13:09 -08:00
|
|
|
EOF
|
|
|
|
|
|
|
|
on_failure:
|
|
|
|
<<: *on_failure_meson
|
|
|
|
cores_script: |
|
|
|
|
mkdir -m 770 /tmp/cores
|
|
|
|
find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
|
|
|
|
src/tools/ci/cores_backtrace.sh linux /tmp/cores
|
|
|
|
|
|
|
|
|
2025-03-05 13:19:28 -05:00
|
|
|
# SPECIAL:
|
|
|
|
# - Uses postgres specific CPPFLAGS that increase test coverage
|
|
|
|
# - Specifies configuration options that test reading/writing/copying of node trees
|
|
|
|
# - Specifies debug_parallel_query=regress, to catch related issues during CI
|
|
|
|
# - Also runs tests against a running postgres instance, see test_running_script
|
2021-12-30 18:59:20 -08:00
|
|
|
task:
|
2025-03-05 10:33:47 -05:00
|
|
|
name: FreeBSD - Meson
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
env:
|
2024-03-13 14:51:24 +13:00
|
|
|
CPUS: 4
|
|
|
|
BUILD_JOBS: 4
|
|
|
|
TEST_JOBS: 8
|
2025-03-05 10:33:47 -05:00
|
|
|
IMAGE_FAMILY: pg-ci-freebsd
|
2023-08-23 12:25:56 -07:00
|
|
|
DISK_SIZE: 50
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
CCACHE_DIR: /tmp/ccache_dir
|
2024-08-01 09:37:44 +02:00
|
|
|
CPPFLAGS: -DRELCACHE_FORCE_RELEASE -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
|
2022-09-21 21:53:18 -07:00
|
|
|
CFLAGS: -Og -ggdb
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2025-03-05 13:19:28 -05:00
|
|
|
# Several buildfarm animals enable these options. Without testing them
|
|
|
|
# during CI, it would be easy to cause breakage on the buildfarm with CI
|
|
|
|
# passing.
|
|
|
|
PG_TEST_INITDB_EXTRA_OPTS: >-
|
|
|
|
-c debug_copy_parse_plan_trees=on
|
|
|
|
-c debug_write_read_parse_plan_trees=on
|
|
|
|
-c debug_raw_expression_coverage_test=on
|
|
|
|
-c debug_parallel_query=regress
|
2024-02-19 09:21:49 +01:00
|
|
|
PG_TEST_PG_UPGRADE_MODE: --link
|
|
|
|
|
2023-08-23 12:25:56 -07:00
|
|
|
<<: *freebsd_task_template
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
depends_on: SanityCheck
|
2021-12-30 18:59:20 -08:00
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
|
|
|
|
|
|
|
|
sysinfo_script: |
|
|
|
|
id
|
|
|
|
uname -a
|
|
|
|
ulimit -a -H && ulimit -a -S
|
|
|
|
export
|
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: $CCACHE_DIR
|
2025-03-04 11:18:29 +13:00
|
|
|
setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
|
2021-12-30 18:59:20 -08:00
|
|
|
create_user_script: |
|
|
|
|
pw useradd postgres
|
|
|
|
chown -R postgres:postgres .
|
|
|
|
mkdir -p ${CCACHE_DIR}
|
|
|
|
chown -R postgres:postgres ${CCACHE_DIR}
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_core_files_script: |
|
2021-12-30 18:59:20 -08:00
|
|
|
mkdir -m 770 /tmp/cores
|
|
|
|
chown root:postgres /tmp/cores
|
|
|
|
sysctl kern.corefile='/tmp/cores/%N.%P.core'
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_additional_packages_script: |
|
2025-03-05 22:12:20 +01:00
|
|
|
#pkg install -y ...
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
# NB: Intentionally build without -Dllvm. The freebsd image size is already
|
|
|
|
# large enough to make VM startup slow, and even without llvm freebsd
|
|
|
|
# already takes longer than other platforms except for windows.
|
2021-12-30 18:59:20 -08:00
|
|
|
configure_script: |
|
|
|
|
su postgres <<-EOF
|
2022-09-21 21:53:18 -07:00
|
|
|
meson setup \
|
|
|
|
--buildtype=debug \
|
2024-01-23 12:01:18 +09:00
|
|
|
-Dcassert=true -Dinjection_points=true \
|
|
|
|
-Duuid=bsd -Dtcl_version=tcl86 -Ddtrace=auto \
|
2022-09-22 20:36:28 -07:00
|
|
|
-Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
|
2022-09-21 21:53:18 -07:00
|
|
|
build
|
2021-12-30 18:59:20 -08:00
|
|
|
EOF
|
2025-02-04 17:45:56 -05:00
|
|
|
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
|
2021-12-30 18:59:20 -08:00
|
|
|
upload_caches: ccache
|
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
test_world_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ulimit -c unlimited
|
|
|
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
|
|
|
EOF
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-12-07 12:13:35 -08:00
|
|
|
# test runningcheck, freebsd chosen because it's currently fast enough
|
|
|
|
test_running_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
set -e
|
|
|
|
ulimit -c unlimited
|
|
|
|
meson test $MTEST_ARGS --quiet --suite setup
|
|
|
|
export LD_LIBRARY_PATH="$(pwd)/build/tmp_install/usr/local/pgsql/lib/:$LD_LIBRARY_PATH"
|
|
|
|
mkdir -p build/testrun
|
|
|
|
build/tmp_install/usr/local/pgsql/bin/initdb -N build/runningcheck --no-instructions -A trust
|
|
|
|
echo "include '$(pwd)/src/tools/ci/pg_ci_base.conf'" >> build/runningcheck/postgresql.conf
|
|
|
|
build/tmp_install/usr/local/pgsql/bin/pg_ctl -c -o '-c fsync=off' -D build/runningcheck -l build/testrun/runningcheck.log start
|
|
|
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS} --setup running
|
|
|
|
build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop
|
|
|
|
EOF
|
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
on_failure:
|
2023-02-06 15:41:38 -08:00
|
|
|
# if the server continues running, it often causes cirrus-ci to fail
|
|
|
|
# during upload, as it doesn't expect artifacts to change size
|
|
|
|
stop_running_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
|
|
|
|
EOF
|
2022-09-21 21:53:18 -07:00
|
|
|
<<: *on_failure_meson
|
2021-12-30 18:59:20 -08:00
|
|
|
cores_script: src/tools/ci/cores_backtrace.sh freebsd /tmp/cores
|
|
|
|
|
|
|
|
|
2025-02-12 09:40:07 -05:00
|
|
|
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
|
2025-02-12 09:40:20 -05:00
|
|
|
CORE_DUMP_DIR: /var/crash
|
2025-02-12 09:40:07 -05:00
|
|
|
|
|
|
|
matrix:
|
|
|
|
- name: NetBSD - Meson
|
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*netbsd.*'
|
|
|
|
env:
|
2025-02-12 09:40:20 -05:00
|
|
|
OS_NAME: netbsd
|
2025-02-12 09:40:07 -05:00
|
|
|
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:
|
2025-02-12 09:40:20 -05:00
|
|
|
OS_NAME: openbsd
|
2025-02-12 09:40:07 -05:00
|
|
|
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 ...
|
2025-02-12 09:40:20 -05:00
|
|
|
# Always core dump to ${CORE_DUMP_DIR}
|
|
|
|
set_core_dump_script: sysctl -w kern.nosuidcoredump=2
|
2025-02-12 09:40:07 -05:00
|
|
|
<<: *openbsd_task_template
|
|
|
|
|
|
|
|
sysinfo_script: |
|
|
|
|
locale
|
|
|
|
id
|
|
|
|
uname -a
|
|
|
|
ulimit -a -H && ulimit -a -S
|
|
|
|
env
|
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: $CCACHE_DIR
|
2025-03-04 11:18:29 +13:00
|
|
|
setup_ram_disk_script: src/tools/ci/gcp_ram_disk.sh
|
2025-02-12 09:40:07 -05:00
|
|
|
create_user_script: |
|
|
|
|
useradd postgres
|
|
|
|
chown -R postgres:users /home/postgres
|
|
|
|
mkdir -p ${CCACHE_DIR}
|
|
|
|
chown -R postgres:users ${CCACHE_DIR}
|
2025-02-12 09:40:20 -05:00
|
|
|
setup_core_files_script: |
|
|
|
|
mkdir -p ${CORE_DUMP_DIR}
|
|
|
|
chmod -R 770 ${CORE_DUMP_DIR}
|
|
|
|
chown -R postgres:users ${CORE_DUMP_DIR}
|
2025-02-12 09:40:07 -05:00
|
|
|
|
|
|
|
# -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
|
|
|
|
|
2025-04-08 15:28:29 +02:00
|
|
|
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
|
2025-02-12 09:40:07 -05:00
|
|
|
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
|
2025-02-12 09:40:20 -05:00
|
|
|
cores_script: |
|
|
|
|
# Although we try to configure the OS to core dump inside
|
|
|
|
# ${CORE_DUMP_DIR}, they may not obey this. So, move core files to the
|
|
|
|
# ${CORE_DUMP_DIR} directory.
|
|
|
|
find build/ -type f -name '*.core' -exec mv '{}' ${CORE_DUMP_DIR} \;
|
|
|
|
src/tools/ci/cores_backtrace.sh ${OS_NAME} ${CORE_DUMP_DIR}
|
2025-02-12 09:40:07 -05:00
|
|
|
|
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
# configure feature flags, shared between the task running the linux tests and
|
|
|
|
# the CompilerWarnings task
|
|
|
|
LINUX_CONFIGURE_FEATURES: &LINUX_CONFIGURE_FEATURES >-
|
|
|
|
--with-gssapi
|
|
|
|
--with-icu
|
|
|
|
--with-ldap
|
Add support for OAUTHBEARER SASL mechanism
This commit implements OAUTHBEARER, RFC 7628, and OAuth 2.0 Device
Authorization Grants, RFC 8628. In order to use this there is a
new pg_hba auth method called oauth. When speaking to a OAuth-
enabled server, it looks a bit like this:
$ psql 'host=example.org oauth_issuer=... oauth_client_id=...'
Visit https://oauth.example.org/login and enter the code: FPQ2-M4BG
Device authorization is currently the only supported flow so the
OAuth issuer must support that in order for users to authenticate.
Third-party clients may however extend this and provide their own
flows. The built-in device authorization flow is currently not
supported on Windows.
In order for validation to happen server side a new framework for
plugging in OAuth validation modules is added. As validation is
implementation specific, with no default specified in the standard,
PostgreSQL does not ship with one built-in. Each pg_hba entry can
specify a specific validator or be left blank for the validator
installed as default.
This adds a requirement on libcurl for the client side support,
which is optional to build, but the server side has no additional
build requirements. In order to run the tests, Python is required
as this adds a https server written in Python. Tests are gated
behind PG_TEST_EXTRA as they open ports.
This patch has been a multi-year project with many contributors
involved with reviews and in-depth discussions: Michael Paquier,
Heikki Linnakangas, Zhihong Yu, Mahendrakar Srinivasarao, Andrey
Chudnovsky and Stephen Frost to name a few. While Jacob Champion
is the main author there have been some levels of hacking by others.
Daniel Gustafsson contributed the validation module and various bits
and pieces; Thomas Munro wrote the client side support for kqueue.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: Kashif Zeeshan <kashi.zeeshan@gmail.com>
Discussion: https://postgr.es/m/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com
2025-02-20 16:25:17 +01:00
|
|
|
--with-libcurl
|
2021-12-30 18:59:20 -08:00
|
|
|
--with-libxml
|
|
|
|
--with-libxslt
|
|
|
|
--with-llvm
|
|
|
|
--with-lz4
|
|
|
|
--with-pam
|
|
|
|
--with-perl
|
|
|
|
--with-python
|
|
|
|
--with-selinux
|
|
|
|
--with-ssl=openssl
|
|
|
|
--with-systemd
|
|
|
|
--with-tcl --with-tclconfig=/usr/lib/tcl8.6/
|
|
|
|
--with-uuid=ossp
|
2022-03-30 09:33:28 -07:00
|
|
|
--with-zstd
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
LINUX_MESON_FEATURES: &LINUX_MESON_FEATURES >-
|
|
|
|
-Dllvm=enabled
|
|
|
|
-Duuid=e2fs
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
|
2025-03-05 13:19:28 -05:00
|
|
|
# Check SPECIAL in the matrix: below
|
2022-09-21 21:53:18 -07:00
|
|
|
task:
|
2021-12-30 18:59:20 -08:00
|
|
|
env:
|
|
|
|
CPUS: 4
|
|
|
|
BUILD_JOBS: 4
|
|
|
|
TEST_JOBS: 8 # experimentally derived to be a decent choice
|
2024-07-15 09:26:01 -07:00
|
|
|
IMAGE_FAMILY: pg-ci-bookworm
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
CCACHE_DIR: /tmp/ccache_dir
|
|
|
|
DEBUGINFOD_URLS: "https://debuginfod.debian.net"
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
# Enable a reasonable set of sanitizers. Use the linux task for that, as
|
2023-01-03 16:26:14 +09:00
|
|
|
# it's one of the fastest tasks (without sanitizers). Also several of the
|
2022-11-21 15:13:09 -08:00
|
|
|
# sanitizers work best on linux.
|
|
|
|
#
|
|
|
|
# The overhead of alignment sanitizer is low, undefined behaviour has
|
|
|
|
# moderate overhead. Test alignment sanitizer in the meson task, as it
|
|
|
|
# does both 32 and 64 bit builds and is thus more likely to expose
|
|
|
|
# alignment bugs.
|
|
|
|
#
|
|
|
|
# Address sanitizer in contrast is somewhat expensive. Enable it in the
|
|
|
|
# autoconf task, as the meson task tests both 32 and 64bit.
|
|
|
|
#
|
|
|
|
# disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
|
|
|
|
# print_stacktraces=1,verbosity=2, duh
|
|
|
|
# detect_leaks=0: too many uninteresting leak errors in short-lived binaries
|
|
|
|
UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
|
|
|
|
ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
|
|
|
|
|
|
|
|
# SANITIZER_FLAGS is set in the tasks below
|
|
|
|
CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
|
|
|
|
CXXFLAGS: $CFLAGS
|
|
|
|
LDFLAGS: $SANITIZER_FLAGS
|
2022-09-21 21:53:18 -07:00
|
|
|
CC: ccache gcc
|
|
|
|
CXX: ccache g++
|
2024-07-15 15:04:15 -07:00
|
|
|
# GCC emits a warning for llvm-14, so switch to a newer one.
|
|
|
|
LLVM_CONFIG: llvm-config-16
|
2022-09-21 21:53:18 -07:00
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
|
2022-09-21 21:53:18 -07:00
|
|
|
LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2023-08-23 12:25:56 -07:00
|
|
|
<<: *linux_task_template
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
depends_on: SanityCheck
|
2021-12-30 18:59:20 -08:00
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
|
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: ${CCACHE_DIR}
|
|
|
|
|
|
|
|
sysinfo_script: |
|
|
|
|
id
|
|
|
|
uname -a
|
|
|
|
cat /proc/cmdline
|
|
|
|
ulimit -a -H && ulimit -a -S
|
|
|
|
export
|
|
|
|
create_user_script: |
|
|
|
|
useradd -m postgres
|
|
|
|
chown -R postgres:postgres .
|
|
|
|
mkdir -p ${CCACHE_DIR}
|
|
|
|
chown -R postgres:postgres ${CCACHE_DIR}
|
|
|
|
echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
|
|
|
|
su postgres -c "ulimit -l -H && ulimit -l -S"
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_core_files_script: |
|
2021-12-30 18:59:20 -08:00
|
|
|
mkdir -m 770 /tmp/cores
|
|
|
|
chown root:postgres /tmp/cores
|
|
|
|
sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core'
|
2023-03-29 21:53:38 +02:00
|
|
|
|
|
|
|
setup_hosts_file_script: |
|
|
|
|
cat >> /etc/hosts <<-EOF
|
|
|
|
127.0.0.1 pg-loadbalancetest
|
|
|
|
127.0.0.2 pg-loadbalancetest
|
|
|
|
127.0.0.3 pg-loadbalancetest
|
|
|
|
EOF
|
|
|
|
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_additional_packages_script: |
|
2025-03-05 22:12:20 +01:00
|
|
|
#apt-get update
|
|
|
|
#DEBIAN_FRONTEND=noninteractive apt-get -y install ...
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
matrix:
|
2025-03-05 13:19:28 -05:00
|
|
|
# SPECIAL:
|
|
|
|
# - Uses address sanitizer, sanitizer failures are typically printed in
|
|
|
|
# the server log
|
|
|
|
# - Configures postgres with a small segment size
|
2024-07-15 09:26:01 -07:00
|
|
|
- name: Linux - Debian Bookworm - Autoconf
|
2022-09-21 21:53:18 -07:00
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
env:
|
|
|
|
SANITIZER_FLAGS: -fsanitize=address
|
2024-09-10 16:27:55 +02:00
|
|
|
PG_TEST_PG_COMBINEBACKUP_MODE: --copy-file-range
|
2022-11-21 15:13:09 -08:00
|
|
|
|
ci: macos: Remove use of -Dsegsize_blocks=6
The option causes a measurable slowdown. Macos is, by far, the most expensive
platform for CI, therefore it doesn't make sense to run such a test there.
d3b111e3205 used a small segment size for two tasks, one with autoconf, one
with meson. In hindsight that is a bit overkill, it's unlikely that the option
would silently break. Thus don't move the -Dsegsize_blocks=6, just remove
it. I did however change the autoconf test to use 6 instead of 8 blocks, as
long as we allow it, a non-power-of-two test seems like a good idea.
While at it, add a comment explaining why we use a small segment size for CI.
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/20230808021541.7lbzdefvma7qmn3w@awork3.anarazel.de
Backpatch: 16-, where d3b111e3205 introduced the use of -Dsegsize_blocks=6
2023-08-12 13:09:45 -07:00
|
|
|
# Normally, the "relation segment" code basically has no coverage in our
|
|
|
|
# tests, because we (quite reasonably) don't generate tables large
|
|
|
|
# enough in tests. We've had plenty bugs that we didn't notice due the
|
|
|
|
# code not being exercised much. Thus specify a very small segment size
|
|
|
|
# here. Use a non-power-of-two segment size, given we currently allow
|
|
|
|
# that.
|
2022-09-21 21:53:18 -07:00
|
|
|
configure_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
./configure \
|
2024-01-23 12:01:18 +09:00
|
|
|
--enable-cassert --enable-injection-points --enable-debug \
|
|
|
|
--enable-tap-tests --enable-nls \
|
ci: macos: Remove use of -Dsegsize_blocks=6
The option causes a measurable slowdown. Macos is, by far, the most expensive
platform for CI, therefore it doesn't make sense to run such a test there.
d3b111e3205 used a small segment size for two tasks, one with autoconf, one
with meson. In hindsight that is a bit overkill, it's unlikely that the option
would silently break. Thus don't move the -Dsegsize_blocks=6, just remove
it. I did however change the autoconf test to use 6 instead of 8 blocks, as
long as we allow it, a non-power-of-two test seems like a good idea.
While at it, add a comment explaining why we use a small segment size for CI.
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/20230808021541.7lbzdefvma7qmn3w@awork3.anarazel.de
Backpatch: 16-, where d3b111e3205 introduced the use of -Dsegsize_blocks=6
2023-08-12 13:09:45 -07:00
|
|
|
--with-segsize-blocks=6 \
|
2025-04-07 22:51:49 +02:00
|
|
|
--with-libnuma \
|
2025-03-18 14:40:05 -04:00
|
|
|
--with-liburing \
|
2022-09-21 21:53:18 -07:00
|
|
|
\
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
|
|
|
\
|
2024-07-15 15:04:15 -07:00
|
|
|
CLANG="ccache clang-16"
|
2022-09-21 21:53:18 -07:00
|
|
|
EOF
|
|
|
|
build_script: su postgres -c "make -s -j${BUILD_JOBS} world-bin"
|
|
|
|
upload_caches: ccache
|
|
|
|
|
|
|
|
test_world_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ulimit -c unlimited # default is 0
|
|
|
|
make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
on_failure:
|
|
|
|
<<: *on_failure_ac
|
|
|
|
|
2025-03-05 13:19:28 -05:00
|
|
|
# SPECIAL:
|
|
|
|
# - Uses undefined behaviour and alignment sanitizers, sanitizer failures
|
|
|
|
# are typically printed in the server log
|
|
|
|
# - Test both 64bit and 32 bit builds
|
2025-03-18 14:40:05 -04:00
|
|
|
# - uses io_method=io_uring
|
2024-07-15 09:26:01 -07:00
|
|
|
- name: Linux - Debian Bookworm - Meson
|
2022-09-21 21:53:18 -07:00
|
|
|
|
2022-09-29 16:09:09 -07:00
|
|
|
env:
|
|
|
|
CCACHE_MAXSIZE: "400M" # tests two different builds
|
2022-11-21 15:13:09 -08:00
|
|
|
SANITIZER_FLAGS: -fsanitize=alignment,undefined
|
2025-03-18 14:40:05 -04:00
|
|
|
PG_TEST_INITDB_EXTRA_OPTS: >-
|
|
|
|
-c io_method=io_uring
|
2022-09-29 16:09:09 -07:00
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
configure_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
meson setup \
|
|
|
|
--buildtype=debug \
|
2024-01-23 12:01:18 +09:00
|
|
|
-Dcassert=true -Dinjection_points=true \
|
2022-09-21 21:53:18 -07:00
|
|
|
${LINUX_MESON_FEATURES} \
|
|
|
|
build
|
|
|
|
EOF
|
|
|
|
|
2022-09-29 16:09:09 -07:00
|
|
|
# Also build & test in a 32bit build - it's gotten rare to test that
|
|
|
|
# locally.
|
|
|
|
configure_32_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
export CC='ccache gcc -m32'
|
|
|
|
meson setup \
|
|
|
|
--buildtype=debug \
|
2024-01-23 12:01:18 +09:00
|
|
|
-Dcassert=true -Dinjection_points=true \
|
2022-09-29 16:09:09 -07:00
|
|
|
${LINUX_MESON_FEATURES} \
|
|
|
|
-Dllvm=disabled \
|
|
|
|
--pkg-config-path /usr/lib/i386-linux-gnu/pkgconfig/ \
|
2024-07-15 09:26:01 -07:00
|
|
|
-DPERL=perl5.36-i386-linux-gnu \
|
2025-04-07 22:51:49 +02:00
|
|
|
-Dlibnuma=disabled \
|
2022-09-29 16:09:09 -07:00
|
|
|
build-32
|
|
|
|
EOF
|
|
|
|
|
2025-04-09 19:34:27 +02:00
|
|
|
build_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
|
|
|
ninja -C build -t missingdeps
|
|
|
|
EOF
|
|
|
|
|
|
|
|
build_32_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ninja -C build-32 -j${BUILD_JOBS} ${MBUILD_TARGET}
|
|
|
|
ninja -C build -t missingdeps
|
|
|
|
EOF
|
2022-09-29 16:09:09 -07:00
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
upload_caches: ccache
|
|
|
|
|
|
|
|
test_world_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ulimit -c unlimited
|
|
|
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
|
|
|
EOF
|
2022-09-29 16:09:09 -07:00
|
|
|
# so that we don't upload 64bit logs if 32bit fails
|
|
|
|
rm -rf build/
|
|
|
|
|
|
|
|
# There's currently no coverage of icu with LANG=C in the buildfarm. We
|
|
|
|
# can easily provide some here by running one of the sets of tests that
|
|
|
|
# way. Newer versions of python insist on changing the LC_CTYPE away
|
|
|
|
# from C, prevent that with PYTHONCOERCECLOCALE.
|
|
|
|
test_world_32_script: |
|
|
|
|
su postgres <<-EOF
|
|
|
|
ulimit -c unlimited
|
|
|
|
PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
|
|
|
|
EOF
|
2022-09-21 21:53:18 -07:00
|
|
|
|
|
|
|
on_failure:
|
|
|
|
<<: *on_failure_meson
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
on_failure:
|
|
|
|
cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores
|
|
|
|
|
|
|
|
|
2025-03-05 13:19:28 -05:00
|
|
|
# NB: macOS is by far the most expensive OS to run CI for, therefore no
|
|
|
|
# expensive additional checks should be added.
|
|
|
|
#
|
|
|
|
# SPECIAL:
|
|
|
|
# - Enables --clone for pg_upgrade and pg_combinebackup
|
2021-12-30 18:59:20 -08:00
|
|
|
task:
|
2024-07-25 11:26:48 +12:00
|
|
|
name: macOS - Sonoma - Meson
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
env:
|
2023-01-01 10:45:18 +13:00
|
|
|
CPUS: 4 # always get that much for cirrusci macOS instances
|
2021-12-30 18:59:20 -08:00
|
|
|
BUILD_JOBS: $CPUS
|
2022-10-01 16:55:16 -07:00
|
|
|
# Test performance regresses noticably when using all cores. 8 seems to
|
|
|
|
# work OK. See
|
|
|
|
# https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
|
|
|
|
TEST_JOBS: 8
|
2024-07-25 11:26:48 +12:00
|
|
|
IMAGE: ghcr.io/cirruslabs/macos-runner:sonoma
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
CIRRUS_WORKING_DIR: ${HOME}/pgsql/
|
|
|
|
CCACHE_DIR: ${HOME}/ccache
|
2023-08-19 12:40:45 -07:00
|
|
|
MACPORTS_CACHE: ${HOME}/macports-cache
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2024-11-27 11:28:59 -05:00
|
|
|
MACOS_PACKAGE_LIST: >-
|
|
|
|
ccache
|
|
|
|
icu
|
|
|
|
kerberos5
|
|
|
|
lz4
|
|
|
|
meson
|
|
|
|
openldap
|
|
|
|
openssl
|
|
|
|
p5.34-io-tty
|
|
|
|
p5.34-ipc-run
|
|
|
|
python312
|
|
|
|
tcl
|
|
|
|
zstd
|
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
CC: ccache cc
|
|
|
|
CXX: ccache c++
|
|
|
|
CFLAGS: -Og -ggdb
|
|
|
|
CXXFLAGS: -Og -ggdb
|
|
|
|
|
2024-02-19 09:21:49 +01:00
|
|
|
PG_TEST_PG_UPGRADE_MODE: --clone
|
2024-09-10 16:27:55 +02:00
|
|
|
PG_TEST_PG_COMBINEBACKUP_MODE: --clone
|
2024-02-19 09:21:49 +01:00
|
|
|
|
2023-08-23 12:25:56 -07:00
|
|
|
<<: *macos_task_template
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
depends_on: SanityCheck
|
2021-12-30 18:59:20 -08:00
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
|
|
|
|
|
|
|
|
sysinfo_script: |
|
|
|
|
id
|
2022-02-12 15:50:53 -08:00
|
|
|
uname -a
|
2021-12-30 18:59:20 -08:00
|
|
|
ulimit -a -H && ulimit -a -S
|
2022-02-12 15:50:53 -08:00
|
|
|
export
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_core_files_script:
|
2021-12-30 18:59:20 -08:00
|
|
|
- mkdir ${HOME}/cores
|
|
|
|
- sudo sysctl kern.corefile="${HOME}/cores/core.%P"
|
|
|
|
|
2023-08-19 12:40:45 -07:00
|
|
|
# Use macports, even though homebrew is installed. The installation
|
|
|
|
# of the additional packages we need would take quite a while with
|
|
|
|
# homebrew, even if we cache the downloads. We can't cache all of
|
|
|
|
# homebrew, because it's already large. So we use macports. To cache
|
|
|
|
# the installation we create a .dmg file that we mount if it already
|
|
|
|
# exists.
|
|
|
|
# XXX: The reason for the direct p5.34* references is that we'd need
|
|
|
|
# the large macport tree around to figure out that p5-io-tty is
|
|
|
|
# actually p5.34-io-tty. Using the unversioned name works, but
|
|
|
|
# updates macports every time.
|
|
|
|
macports_cache:
|
|
|
|
folder: ${MACPORTS_CACHE}
|
2024-07-25 11:26:48 +12:00
|
|
|
fingerprint_script: |
|
2024-11-27 11:28:59 -05:00
|
|
|
# Reinstall packages if the OS major version, the list of the packages
|
|
|
|
# to install or the MacPorts install script changes.
|
2024-07-25 11:26:48 +12:00
|
|
|
sw_vers -productVersion | sed 's/\..*//'
|
2024-11-27 11:28:59 -05:00
|
|
|
echo $MACOS_PACKAGE_LIST
|
2024-07-25 14:46:01 +12:00
|
|
|
md5 src/tools/ci/ci_macports_packages.sh
|
2024-07-25 11:26:48 +12:00
|
|
|
reupload_on_changes: true
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_additional_packages_script: |
|
2024-11-27 11:28:59 -05:00
|
|
|
sh src/tools/ci/ci_macports_packages.sh $MACOS_PACKAGE_LIST
|
2024-03-25 13:06:58 -07:00
|
|
|
# system python doesn't provide headers
|
|
|
|
sudo /opt/local/bin/port select python3 python312
|
2023-08-19 12:40:45 -07:00
|
|
|
# Make macports install visible for subsequent steps
|
|
|
|
echo PATH=/opt/local/sbin/:/opt/local/bin/:$PATH >> $CIRRUS_ENV
|
|
|
|
upload_caches: macports
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: $CCACHE_DIR
|
|
|
|
configure_script: |
|
2023-08-19 12:40:45 -07:00
|
|
|
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
|
2022-09-21 21:53:18 -07:00
|
|
|
meson setup \
|
|
|
|
--buildtype=debug \
|
2023-08-19 12:40:45 -07:00
|
|
|
-Dextra_include_dirs=/opt/local/include \
|
|
|
|
-Dextra_lib_dirs=/opt/local/lib \
|
2024-01-23 12:01:18 +09:00
|
|
|
-Dcassert=true -Dinjection_points=true \
|
2023-03-13 06:46:09 +01:00
|
|
|
-Duuid=e2fs -Ddtrace=auto \
|
2022-09-21 21:53:18 -07:00
|
|
|
build
|
|
|
|
|
2025-02-04 17:45:56 -05:00
|
|
|
build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
2021-12-30 18:59:20 -08:00
|
|
|
upload_caches: ccache
|
|
|
|
|
|
|
|
test_world_script: |
|
|
|
|
ulimit -c unlimited # default is 0
|
|
|
|
ulimit -n 1024 # default is 256, pretty low
|
2022-09-21 21:53:18 -07:00
|
|
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
on_failure:
|
2022-09-21 21:53:18 -07:00
|
|
|
<<: *on_failure_meson
|
2021-12-30 18:59:20 -08:00
|
|
|
cores_script: src/tools/ci/cores_backtrace.sh macos "${HOME}/cores"
|
|
|
|
|
|
|
|
|
2022-11-17 16:22:25 -08:00
|
|
|
WINDOWS_ENVIRONMENT_BASE: &WINDOWS_ENVIRONMENT_BASE
|
2021-12-30 18:59:20 -08:00
|
|
|
env:
|
|
|
|
# Half the allowed per-user CPU cores
|
|
|
|
CPUS: 4
|
|
|
|
|
|
|
|
# The default cirrus working dir is in a directory msbuild complains about
|
|
|
|
CIRRUS_WORKING_DIR: "c:/cirrus"
|
|
|
|
# git's tar doesn't deal with drive letters, see
|
|
|
|
# https://postgr.es/m/b6782dc3-a7b0-ed56-175f-f8f54cb08d67%40dunslane.net
|
|
|
|
TAR: "c:/windows/system32/tar.exe"
|
|
|
|
# Avoids port conflicts between concurrent tap test runs
|
|
|
|
PG_TEST_USE_UNIX_SOCKETS: 1
|
|
|
|
PG_REGRESS_SOCK_DIR: "c:/cirrus/"
|
2023-08-23 12:25:56 -07:00
|
|
|
DISK_SIZE: 50
|
2024-06-03 19:06:50 -07:00
|
|
|
IMAGE_FAMILY: pg-ci-windows-ci
|
2022-02-02 17:31:54 -08:00
|
|
|
|
2022-11-17 16:22:25 -08:00
|
|
|
sysinfo_script: |
|
|
|
|
chcp
|
|
|
|
systeminfo
|
|
|
|
powershell -Command get-psdrive -psprovider filesystem
|
|
|
|
set
|
|
|
|
|
|
|
|
|
|
|
|
task:
|
|
|
|
name: Windows - Server 2019, VS 2019 - Meson & ninja
|
|
|
|
<< : *WINDOWS_ENVIRONMENT_BASE
|
|
|
|
|
|
|
|
env:
|
|
|
|
TEST_JOBS: 8 # wild guess, data based value welcome
|
2022-02-02 17:31:54 -08:00
|
|
|
|
2022-09-21 17:15:54 -07:00
|
|
|
# Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That
|
|
|
|
# prevents crash reporting from working unless binaries do SetErrorMode()
|
|
|
|
# themselves. Furthermore, it appears that either python or, more likely,
|
|
|
|
# the C runtime has a bug where SEM_NOGPFAULTERRORBOX can very
|
|
|
|
# occasionally *trigger* a crash on process exit - which is hard to debug,
|
|
|
|
# given that it explicitly prevents crash dumps from working...
|
|
|
|
# 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
|
|
|
|
CIRRUS_WINDOWS_ERROR_MODE: 0x8001
|
2023-08-23 12:25:56 -07:00
|
|
|
|
|
|
|
<<: *windows_task_template
|
2022-09-21 17:15:54 -07:00
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
depends_on: SanityCheck
|
2021-12-30 18:59:20 -08:00
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
|
|
|
|
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_additional_packages_script: |
|
|
|
|
REM choco install -y --no-progress ...
|
|
|
|
|
2023-03-29 21:53:38 +02:00
|
|
|
setup_hosts_file_script: |
|
|
|
|
echo 127.0.0.1 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
|
|
|
|
echo 127.0.0.2 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
|
|
|
|
echo 127.0.0.3 pg-loadbalancetest >> c:\Windows\System32\Drivers\etc\hosts
|
|
|
|
type c:\Windows\System32\Drivers\etc\hosts
|
|
|
|
|
2022-09-21 21:53:18 -07:00
|
|
|
# Use /DEBUG:FASTLINK to avoid high memory usage during linking
|
|
|
|
configure_script: |
|
|
|
|
vcvarsall x64
|
2024-11-04 14:09:25 +02:00
|
|
|
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% build
|
2022-09-21 21:53:18 -07:00
|
|
|
|
|
|
|
build_script: |
|
|
|
|
vcvarsall x64
|
2025-02-04 17:45:56 -05:00
|
|
|
ninja -C build %MBUILD_TARGET%
|
2025-04-09 19:34:27 +02:00
|
|
|
ninja -C build -t missingdeps
|
2022-09-21 21:53:18 -07:00
|
|
|
|
|
|
|
check_world_script: |
|
2022-02-02 17:31:54 -08:00
|
|
|
vcvarsall x64
|
2022-09-21 21:53:18 -07:00
|
|
|
meson test %MTEST_ARGS% --num-processes %TEST_JOBS%
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2022-02-02 18:33:25 -08:00
|
|
|
on_failure:
|
2022-09-21 21:53:18 -07:00
|
|
|
<<: *on_failure_meson
|
2022-02-02 18:33:25 -08:00
|
|
|
crashlog_artifacts:
|
2022-02-12 15:29:08 -08:00
|
|
|
path: "crashlog-*.txt"
|
2022-02-02 18:33:25 -08:00
|
|
|
type: text/plain
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
|
2022-11-17 16:22:25 -08:00
|
|
|
task:
|
|
|
|
<< : *WINDOWS_ENVIRONMENT_BASE
|
|
|
|
name: Windows - Server 2019, MinGW64 - Meson
|
|
|
|
|
|
|
|
# due to resource constraints we don't run this task by default for now
|
|
|
|
trigger_type: manual
|
|
|
|
# worth using only_if despite being manual, otherwise this task will show up
|
|
|
|
# when e.g. ci-os-only: linux is used.
|
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
|
2022-11-21 15:13:09 -08:00
|
|
|
# otherwise it'll be sorted before other tasks
|
|
|
|
depends_on: SanityCheck
|
2022-11-17 16:22:25 -08:00
|
|
|
|
|
|
|
env:
|
|
|
|
TEST_JOBS: 4 # higher concurrency causes occasional failures
|
|
|
|
CCACHE_DIR: C:/msys64/ccache
|
|
|
|
CCACHE_MAXSIZE: "500M"
|
|
|
|
CCACHE_SLOPPINESS: pch_defines,time_macros
|
|
|
|
CCACHE_DEPEND: 1
|
2023-01-03 16:26:14 +09:00
|
|
|
# for some reason mingw plpython cannot find its installation without this
|
2022-11-17 16:22:25 -08:00
|
|
|
PYTHONHOME: C:/msys64/ucrt64
|
|
|
|
# prevents MSYS bash from resetting error mode
|
|
|
|
MSYS: winjitdebug
|
|
|
|
# Start bash in current working directory
|
|
|
|
CHERE_INVOKING: 1
|
|
|
|
BASH: C:\msys64\usr\bin\bash.exe -l
|
2023-08-23 12:25:56 -07:00
|
|
|
|
|
|
|
<<: *windows_task_template
|
2022-11-17 16:22:25 -08:00
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: ${CCACHE_DIR}
|
|
|
|
|
|
|
|
setup_additional_packages_script: |
|
|
|
|
REM C:\msys64\usr\bin\pacman.exe -S --noconfirm ...
|
|
|
|
|
|
|
|
mingw_info_script: |
|
|
|
|
%BASH% -c "where gcc"
|
|
|
|
%BASH% -c "gcc --version"
|
|
|
|
%BASH% -c "where perl"
|
|
|
|
%BASH% -c "perl --version"
|
|
|
|
|
|
|
|
# disable -Dnls as the number of files it creates cause a noticable slowdown
|
|
|
|
configure_script: |
|
2024-01-23 12:01:18 +09:00
|
|
|
%BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
|
2022-11-17 16:22:25 -08:00
|
|
|
|
|
|
|
build_script: |
|
2025-02-04 17:45:56 -05:00
|
|
|
%BASH% -c "ninja -C build ${MBUILD_TARGET}"
|
2022-11-17 16:22:25 -08:00
|
|
|
|
|
|
|
upload_caches: ccache
|
|
|
|
|
|
|
|
test_world_script: |
|
|
|
|
%BASH% -c "meson test %MTEST_ARGS% --num-processes %TEST_JOBS%"
|
|
|
|
|
|
|
|
on_failure:
|
|
|
|
<<: *on_failure_meson
|
|
|
|
crashlog_artifacts:
|
|
|
|
path: "crashlog-*.txt"
|
|
|
|
type: text/plain
|
|
|
|
|
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
task:
|
|
|
|
name: CompilerWarnings
|
|
|
|
|
2022-11-21 15:13:09 -08:00
|
|
|
# To limit unnecessary work only run this once the SanityCheck
|
|
|
|
# succeeds. This is particularly important for this task as we intentionally
|
|
|
|
# use always: to continue after failures. Task that did not run count as a
|
|
|
|
# success, so we need to recheck SanityChecks's condition here ...
|
|
|
|
depends_on: SanityCheck
|
|
|
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
env:
|
|
|
|
CPUS: 4
|
|
|
|
BUILD_JOBS: 4
|
2024-07-15 09:26:01 -07:00
|
|
|
IMAGE_FAMILY: pg-ci-bookworm
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
# Use larger ccache cache, as this task compiles with multiple compilers /
|
|
|
|
# flag combinations
|
2023-03-13 07:23:45 +01:00
|
|
|
CCACHE_MAXSIZE: "1G"
|
2021-12-30 18:59:20 -08:00
|
|
|
CCACHE_DIR: "/tmp/ccache_dir"
|
|
|
|
|
|
|
|
LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
|
2022-09-21 21:53:18 -07:00
|
|
|
LINUX_MESON_FEATURES: *LINUX_MESON_FEATURES
|
2021-12-30 18:59:20 -08:00
|
|
|
|
2024-07-15 15:04:15 -07:00
|
|
|
# GCC emits a warning for llvm-14, so switch to a newer one.
|
|
|
|
LLVM_CONFIG: llvm-config-16
|
|
|
|
|
2023-08-23 12:25:56 -07:00
|
|
|
<<: *linux_task_template
|
2021-12-30 18:59:20 -08:00
|
|
|
|
|
|
|
sysinfo_script: |
|
|
|
|
id
|
|
|
|
uname -a
|
|
|
|
cat /proc/cmdline
|
|
|
|
ulimit -a -H && ulimit -a -S
|
|
|
|
gcc -v
|
|
|
|
clang -v
|
|
|
|
export
|
|
|
|
|
|
|
|
ccache_cache:
|
|
|
|
folder: $CCACHE_DIR
|
|
|
|
|
2022-03-18 15:42:02 -07:00
|
|
|
setup_additional_packages_script: |
|
2025-03-05 22:12:20 +01:00
|
|
|
#apt-get update
|
|
|
|
#DEBIAN_FRONTEND=noninteractive apt-get -y install ...
|
2022-03-18 15:42:02 -07:00
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
###
|
|
|
|
# Test that code can be built with gcc/clang without warnings
|
|
|
|
###
|
|
|
|
|
|
|
|
setup_script: echo "COPT=-Werror" > src/Makefile.custom
|
|
|
|
|
|
|
|
# Trace probes have a history of getting accidentally broken. Use the
|
|
|
|
# different compilers to build with different combinations of dtrace on/off
|
|
|
|
# and cassert on/off.
|
|
|
|
|
|
|
|
# gcc, cassert off, dtrace on
|
|
|
|
always:
|
|
|
|
gcc_warning_script: |
|
|
|
|
time ./configure \
|
|
|
|
--cache gcc.cache \
|
|
|
|
--enable-dtrace \
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
|
2021-12-30 18:59:20 -08:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} world-bin
|
|
|
|
|
|
|
|
# gcc, cassert on, dtrace off
|
|
|
|
always:
|
|
|
|
gcc_a_warning_script: |
|
|
|
|
time ./configure \
|
|
|
|
--cache gcc.cache \
|
|
|
|
--enable-cassert \
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
|
2021-12-30 18:59:20 -08:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} world-bin
|
|
|
|
|
|
|
|
# clang, cassert off, dtrace off
|
|
|
|
always:
|
|
|
|
clang_warning_script: |
|
|
|
|
time ./configure \
|
|
|
|
--cache clang.cache \
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="ccache clang" CXX="ccache clang++-16" CLANG="ccache clang-16"
|
2021-12-30 18:59:20 -08:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} world-bin
|
|
|
|
|
|
|
|
# clang, cassert on, dtrace on
|
|
|
|
always:
|
|
|
|
clang_a_warning_script: |
|
|
|
|
time ./configure \
|
|
|
|
--cache clang.cache \
|
|
|
|
--enable-cassert \
|
|
|
|
--enable-dtrace \
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="ccache clang" CXX="ccache clang++-16" CLANG="ccache clang-16"
|
2021-12-30 18:59:20 -08:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} world-bin
|
|
|
|
|
|
|
|
# cross-compile to windows
|
|
|
|
always:
|
|
|
|
mingw_cross_warning_script: |
|
|
|
|
time ./configure \
|
|
|
|
--host=x86_64-w64-mingw32 \
|
|
|
|
--enable-cassert \
|
2023-04-18 13:20:11 -07:00
|
|
|
--without-icu \
|
2021-12-30 18:59:20 -08:00
|
|
|
CC="ccache x86_64-w64-mingw32-gcc" \
|
|
|
|
CXX="ccache x86_64-w64-mingw32-g++"
|
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} world-bin
|
|
|
|
|
|
|
|
###
|
|
|
|
# Verify docs can be built
|
|
|
|
###
|
|
|
|
# XXX: Only do this if there have been changes in doc/ since last build
|
|
|
|
always:
|
|
|
|
docs_build_script: |
|
|
|
|
time ./configure \
|
|
|
|
--cache gcc.cache \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang-16"
|
2021-12-30 18:59:20 -08:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s -j${BUILD_JOBS} -C doc
|
|
|
|
|
2022-03-23 11:33:01 -07:00
|
|
|
###
|
|
|
|
# Verify headerscheck / cpluspluscheck succeed
|
|
|
|
#
|
|
|
|
# - Don't use ccache, the files are uncacheable, polluting ccache's
|
|
|
|
# cache
|
|
|
|
# - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
|
|
|
|
# - XXX have to disable ICU to avoid errors:
|
|
|
|
# https://postgr.es/m/20220323002024.f2g6tivduzrktgfa%40alap3.anarazel.de
|
|
|
|
###
|
|
|
|
always:
|
|
|
|
headers_headerscheck_script: |
|
|
|
|
time ./configure \
|
|
|
|
${LINUX_CONFIGURE_FEATURES} \
|
|
|
|
--without-icu \
|
|
|
|
--quiet \
|
2024-07-15 15:04:15 -07:00
|
|
|
CC="gcc" CXX"=g++" CLANG="clang-16"
|
2022-03-23 11:33:01 -07:00
|
|
|
make -s -j${BUILD_JOBS} clean
|
|
|
|
time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
|
|
|
|
headers_cpluspluscheck_script: |
|
2022-09-24 12:01:06 -07:00
|
|
|
time make -s cpluspluscheck EXTRAFLAGS='-fmax-errors=10'
|
2022-03-23 11:33:01 -07:00
|
|
|
|
2021-12-30 18:59:20 -08:00
|
|
|
always:
|
|
|
|
upload_caches: ccache
|