CI, macports, darwin version problems
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-06-25T23:54:09Z
Lists: pgsql-hackers
Attachments
- 0001-ci-Upgrade-macOS-version-from-13-to-14.patch (text/x-patch) patch 0001
Hi, Problem #1: we're still using Ventura, but Cirrus has started doing this: Only ghcr.io/cirruslabs/macos-runner:sonoma is allowed. Automatically upgraded. It doesn't do it to cfbot, which runs macOS stuff on PGDG-hosted Mac Minis, but it does it to regular users who use free compute minutes tagged "instance:OSXCommunityInstance". This causes them to fail, because: [11:17:42.711] Error: Current platform "darwin 23" does not match expected platform "darwin 22" Sure enough, the sysinfo task shows "... Darwin Kernel Version 23.5.0...", but for cfbot it's still 22.y.z. So probably it's time to change to macOS 14 AKA sonoma AKA darwin 23. Problem #2: Once you do that with a simple s/ventura/sonoma/, it still "upgrades" to macos-runner:sonoma, which is not the same as macos-sonoma-base:latest. It has more versions of xcode installed? Not sure what else will break with that because I haven't successfully run it yet due to the next problem, but blind patch attached. Problem #3: If you have a macports installation cached (eg for CI in your github account), then the pre-existing macports installation will be for the wrong darwin version (error shown above). So I think we need to teach src/tools/ci/ci_macports_packages.sh to detect that condition and do a clean install. I can look into that, but does anyone already know how to do it? I know how to find out which darwin version is running: uname -r | sed 's/\..*//'. What I don't know is how to find the darwin version for a macports installation. I have found a terrible way to deduce it: sqlite3 /opt/local/var/macports/registry/registry.db "select max(os_major) from ports where os_major != 'any'" But that's stupid. There must be a way to ask it what version it was installed for ... I think it's the variable macports::os_major[2] (which is written in TCL, a language I can't follow too well), but I can't figure out where it's reading it from.... I hope there is a text file under /opt/local or at worst a SQLite database, or a way to ask the port command to spit that number out or ask it if it thinks migration is necessary... [1] https://github.com/cirruslabs/macos-image-templates/pkgs/container/macos-ventura-xcode [2] https://github.com/macports/macports-base/blob/bf27e0c98c7443877e081d5f6b6
Commits
-
ci: Pin MacPorts version to 2.9.3.
- 541f493dc128 15.8 landed
- daca4f1419e8 16.4 landed
- 5f03da8518ce 17.0 landed
- 64c39bd5047e 18.0 landed
-
ci: Upgrade macOS version from 13 to 14.
- 0151b4d6bdf0 15.8 landed
- 9302f6fa58ba 16.4 landed
- f8c1bb2bb90d 17.0 landed
- d01ce180d9b5 18.0 landed