aboutsummaryrefslogtreecommitdiff
path: root/.cirrus.yml
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-08-19 12:40:45 -0700
committerAndres Freund <andres@anarazel.de>2023-08-19 14:38:56 -0700
commitdd2a731d9caffa8c9f6d82f2b72dd460b67decd7 (patch)
tree6220ee3261fd200ccce6285544acb68a79ac8831 /.cirrus.yml
parentdcfc49c1b652dfe41273579aeaf6b454c51f037b (diff)
downloadpostgresql-dd2a731d9caffa8c9f6d82f2b72dd460b67decd7.tar.gz
postgresql-dd2a731d9caffa8c9f6d82f2b72dd460b67decd7.zip
ci: macos: use cached macports install
A significant chunk of the time on the macos CI task is spent installing packages using homebrew. The downloads of the packages are cached, but the installation needs to happen every time. We can't cache the whole homebrew installation, because it is too large due to pre-installed packages. Speed this up by installing packages using macports and caching the installation as .dmg. That's a lot faster than unpacking a tarball. In addition, don't install llvm - it wasn't enabled when building, so it's just a waste of time/space. This substantially speeds up the mac CI time, both in the cold cache and in the warm cache case (the latter from ~1m20s to ~5s). It doesn't seem great to have diverging sources of packages for CI between branches, so backpatch to 15 (where CI was added). Discussion: https://postgr.es/m/20230805202539.r3umyamsnctysdc7@awork3.anarazel.de Backpatch: 15-, where CI was added
Diffstat (limited to '.cirrus.yml')
-rw-r--r--.cirrus.yml63
1 files changed, 25 insertions, 38 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 626766e39f6..8203b2f90a6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -435,8 +435,7 @@ task:
CIRRUS_WORKING_DIR: ${HOME}/pgsql/
CCACHE_DIR: ${HOME}/ccache
- HOMEBREW_CACHE: ${HOME}/homebrew-cache
- PERL5LIB: ${HOME}/perl5/lib/perl5
+ MACPORTS_CACHE: ${HOME}/macports-cache
CC: ccache cc
CXX: ccache c++
@@ -459,55 +458,43 @@ task:
- mkdir ${HOME}/cores
- sudo sysctl kern.corefile="${HOME}/cores/core.%P"
- perl_cache:
- folder: ~/perl5
- cpan_install_script:
- - perl -mIPC::Run -e 1 || cpan -T IPC::Run
- - perl -mIO::Pty -e 1 || cpan -T IO::Pty
- upload_caches: perl
-
-
- # XXX: Could we instead install homebrew into a cached directory? The
- # homebrew installation takes a good bit of time every time, even if the
- # packages do not need to be downloaded.
- homebrew_cache:
- folder: $HOMEBREW_CACHE
+ # 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}
setup_additional_packages_script: |
- brew install \
+ sh src/tools/ci/ci_macports_packages.sh \
ccache \
- icu4c \
- krb5 \
- llvm \
+ icu \
+ kerberos5 \
lz4 \
- make \
meson \
openldap \
openssl \
- python \
- tcl-tk \
+ p5.34-io-tty \
+ p5.34-ipc-run \
+ tcl \
zstd
-
- brew cleanup -s # to reduce cache size
- upload_caches: homebrew
+ # Make macports install visible for subsequent steps
+ echo PATH=/opt/local/sbin/:/opt/local/bin/:$PATH >> $CIRRUS_ENV
+ upload_caches: macports
ccache_cache:
folder: $CCACHE_DIR
configure_script: |
- brewpath="/opt/homebrew"
- PKG_CONFIG_PATH="${brewpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
-
- for pkg in icu4c krb5 openldap openssl zstd ; do
- pkgpath="${brewpath}/opt/${pkg}"
- PKG_CONFIG_PATH="${pkgpath}/lib/pkgconfig:${PKG_CONFIG_PATH}"
- PATH="${pkgpath}/bin:${pkgpath}/sbin:$PATH"
- done
-
- export PKG_CONFIG_PATH PATH
-
+ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig/"
meson setup \
--buildtype=debug \
- -Dextra_include_dirs=${brewpath}/include \
- -Dextra_lib_dirs=${brewpath}/lib \
+ -Dextra_include_dirs=/opt/local/include \
+ -Dextra_lib_dirs=/opt/local/lib \
-Dcassert=true \
-Duuid=e2fs -Ddtrace=auto \
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \