Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc93dffd

Browse files
committed
ci: Fix cached MacPorts installation management
1. The error reporting of "port setrequested list-of-packages..."changed, hiding errors we were relying on to know if all packages in ourlist were already installed. Use a loop instead.2. The cached MacPorts installation was shared between PostgreSQLmajor branches, though each branch wanted different packages. Add thelist of packages to cache key, so that different branches, when testedin one github account/repo such as postgres/postgres, stop fighting witheach other, adding and removing packages.Back-patch to 15 where CI began.Author: Thomas Munro <thomas.munro@gmail.com>Author: Nazir Bilal Yavuz <byavuz81@gmail.com>Suggested-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/au2uqfuy2nf43nwy2txmc5t2emhwij7kzupygto3d2ffgtrdgr%40ckvrlwyflnh2
1 parentadb103f commitc93dffd

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

‎.cirrus.tasks.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,20 @@ task:
426426
CCACHE_DIR:${HOME}/ccache
427427
MACPORTS_CACHE:${HOME}/macports-cache
428428

429+
MACOS_PACKAGE_LIST:>-
430+
ccache
431+
icu
432+
kerberos5
433+
lz4
434+
meson
435+
openldap
436+
openssl
437+
p5.34-io-tty
438+
p5.34-ipc-run
439+
python312
440+
tcl
441+
zstd
442+
429443
CC:ccache cc
430444
CXX:ccache c++
431445
CFLAGS:-Og -ggdb
@@ -461,26 +475,14 @@ task:
461475
macports_cache:
462476
folder:${MACPORTS_CACHE}
463477
fingerprint_script:|
464-
#Includethe OS major version inthecache key. IftheOS image changes
465-
# toa different major version, we need to reinstall.
478+
#Reinstall packages ifthe OS major version,thelist ofthepackages
479+
# toinstall or the MacPorts install script changes.
466480
sw_vers -productVersion | sed 's/\..*//'
467-
# Also start afresh if we change our MacPorts install script.
481+
echo $MACOS_PACKAGE_LIST
468482
md5 src/tools/ci/ci_macports_packages.sh
469483
reupload_on_changes:true
470484
setup_additional_packages_script:|
471-
sh src/tools/ci/ci_macports_packages.sh \
472-
ccache \
473-
icu \
474-
kerberos5 \
475-
lz4 \
476-
meson \
477-
openldap \
478-
openssl \
479-
p5.34-io-tty \
480-
p5.34-ipc-run \
481-
python312 \
482-
tcl \
483-
zstd
485+
sh src/tools/ci/ci_macports_packages.sh $MACOS_PACKAGE_LIST
484486
# system python doesn't provide headers
485487
sudo /opt/local/bin/port select python3 python312
486488
# Make macports install visible for subsequent steps

‎src/tools/ci/ci_macports_packages.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,18 @@ if [ -n "$(port -q installed installed)" ] ; then
5959
sudo port unsetrequested installed
6060
fi
6161

62-
# if setting all the required packages as requested fails, we need
63-
# to install at least one of them
64-
if! sudo port setrequested$packages> /dev/null2>&1;then
65-
echo not all required packages installed, doing so now
62+
# If setting all the required packages as requested fails, we need
63+
# to install at least one of them. Need to do so one-by-one as
64+
# port setrequested only reports failures for the first package.
65+
echo"checking if all required packages are installed"
66+
forpackagein$packages;do
67+
if! sudo port setrequested$package> /dev/null2>&1;then
6668
update_cached_image=1
69+
fi
70+
done
71+
echo"done"
72+
if ["$update_cached_image"-eq 1 ];then
73+
echo not all required packages installed, doing so now
6774
# to keep the image small, we deleted the ports tree from the image...
6875
sudo port selfupdate
6976
# XXX likely we'll need some other way to force an upgrade at some

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp