Do not assert that the version parameter pins MacPorts base - #5
Open
jolierabideau wants to merge 1 commit into
Open
jolierabideau wants to merge 1 commit into
jolierabideau wants to merge 1 commit into
Conversation
The postflight script of the MacPorts package runs `port selfupdate`
(portmgr/dmg/postflight.in in macports-base), which upgrades MacPorts
base to the newest release. So installing the pinned package and then
asserting the installed version equals the requested one only holds
while the requested version happens to be the latest release.
That stopped being true when 2.12.6 was released on 2026-08-25 against
a 2.12.5 pin, and CI on main has failed since:
Run test "$(port version)" = 'Version: 2.12.5'
Process completed with exit code 1
The breakage went unnoticed because the previous run on main was on
2026-06-24, while the requested and latest versions still agreed.
Compare with a version sort instead, so the check accepts a base that
selfupdate has moved forward but still fails on a base older than
requested. A plain string comparison would be wrong here: it makes
2.9.0 look newer than 2.12.5.
The postflight cannot be told to skip the selfupdate — it is called on
every exit path, and it is also what creates the macports run user and
the default configuration files, so it cannot simply be bypassed.
Document the version parameter for what it does instead: choose the
package that bootstraps the installation, not pin base.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI on
mainfails, and has since 2026-08-25:Confirmed on unmodified
mainby dispatching the workflow there: run 34489699502. The breakage went unnoticed because the previous run onmainwas 2026-06-24.Cause
The postflight script of the MacPorts package runs
port -v selfupdate(portmgr/dmg/postflight.in):selfupdateupgrades MacPorts base to the newest release. We install the pinnedMacPorts-2.12.5-*.pkg— verified as the correct asset, 7,417,131 bytes — and the postflight then upgrades base to 2.12.6, released 2026-08-25.So the
version:parameter does not pin MacPorts base. It selects the package that bootstraps the installation; base then moves to whatever is current. The assertion only ever passed while the pinned version was the latest release, which was true from 2026-04-23 to 2026-08-25.The postflight cannot be told to skip the selfupdate:
update_macportsis called on every exit path, and the same script also creates themacportsrun user and the default configuration files, so bypassing it wholesale would break the installation.Change
Validate installed MacPorts versionnow compares with a version sort, accepting a base that selfupdate moved forward while still failing on a base older than requested — so a genuinely broken install is still caught.README.mdandaction.yamldocumentversion:for what it actually does, and theversionoutput as the version requested rather than the one installed.port version.A plain string comparison would be wrong here — it makes
2.9.0look newer than2.12.5— hencesort -V.Verification
sort -Vis available on macOS (sort 2.3-Apple). I ran the step's exact script underbash -ewith a stubbedport:Both YAML files parse.
Note
This is the pre-existing failure that blocks #4. It is independent of that PR: the action step there succeeds, and only this assertion fails. Merging this should turn #4 green.
🤖 Generated with Claude Code
This change is