ci: Pin MacPorts version to 2.9.3.
authorThomas Munro <[email protected]>
Thu, 25 Jul 2024 02:46:01 +0000 (14:46 +1200)
committerThomas Munro <[email protected]>
Thu, 25 Jul 2024 02:48:43 +0000 (14:48 +1200)
Commit d01ce180 invented a new way to find the latest MacPorts version.
By bad luck, a new beta release has just been published, and it seems
to lack some packages we need.  Go back to searching for this specific
version for now.  We still search with a pattern so that we can find the
package for the running version of macOS, but for now we always look for
2.9.3.  The code to do that had been anticipated already in a commented
out line, I just didn't expect to have to use it so soon...

Also include the whole MacPorts installation script in the cache key, so
that changes to the script cause a fresh installation.  This should make
it a bit easier to reason about the effect of changes on cached state in
github accounts using CI, when we make adjustments.

Back-patch to 15, like d01ce180.

Discussion: https://postgr.es/m/CA%2BhUKGLqJdv6RcwyZ_0H7khxtLTNJyuK%2BvDFzv3uwYbn8hKH6A%40mail.gmail.com

.cirrus.tasks.yml
src/tools/ci/ci_macports_packages.sh

index 0616fb9ba3436312b9ba584f65a1ff4cf87b9f72..d8b7f9d32ab7dcd48d0ecaf0c171895c84b44ae4 100644 (file)
@@ -460,6 +460,8 @@ task:
       # Include the OS major version in the cache key.  If the OS image changes
       # to a different major version, we need to reinstall.
       sw_vers -productVersion | sed 's/\..*//'
+      # Also start afresh if we change our MacPorts install script.
+      md5 src/tools/ci/ci_macports_packages.sh
     reupload_on_changes: true
   setup_additional_packages_script: |
     sh src/tools/ci/ci_macports_packages.sh \
index 722bc8e948d50b625b454ffd979219cdfa248306..5b5fad97aca033d1e37e7aa2cca2b39259474cc6 100755 (executable)
@@ -16,13 +16,10 @@ packages="$@"
 macos_major_version="` sw_vers -productVersion | sed 's/\..*//' `"
 echo "macOS major version: $macos_major_version"
 
-# Scan the avialable MacPorts releases to find the latest one for the
-# running macOS release.  By default we assume the first match is the most
-# recent MacPorts version but that can be changed below if it turns out to be
-# problematic or a particular MacPorts release turns out to be broken.
+# Scan the available MacPorts releases to find one that matches the running
+# macOS release.
 macports_release_list_url="https://api.github.com/repos/macports/macports-base/releases"
-macports_version_pattern=".*"
-#macports_version_pattern="2\.9\.3"
+macports_version_pattern="2\.9\.3"
 macports_url="$( curl -s $macports_release_list_url | grep "\"https://github.com/macports/macports-base/releases/download/v$macports_version_pattern/MacPorts-$macports_version_pattern-$macos_major_version-[A-Za-z]*\.pkg\"" | sed 's/.*: "//;s/".*//' | head -1 )"
 echo "MacPorts package URL: $macports_url"