Fall back to an older opam release when the latest lacks binaries#1100
Merged
Fall back to an older opam release when the latest lacks binaries#1100
Conversation
df741f9 to
cd2a424
Compare
cd2a424 to
b14c9ed
Compare
This was referenced Apr 16, 2026
Merged
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
opam 2.5.1 was released with only a source tarball (
opam-full-2.5.1.tar.gz) and no pre-built binaries. The current logic selects the latest semver-matching release and then looks for a binary asset for the runner's platform and architecture. When the latest release has no binaries, the action fails immediately with:This broke CI for all users on the default (stable) configuration. See the failing run: https://github.com/ocaml/setup-ocaml/actions/runs/24321628257
Solution
Instead of checking only the single latest release, iterate through all semver-matched releases (sorted newest-first) and return the first one that contains a binary asset for the current platform and architecture. If no release has a suitable binary, the same error is raised as before.
This means opam 2.5.1 (source-only) is silently skipped and opam 2.5.0 (which has full binary assets) is used instead.
Verification
npm run build— passesnpm run typecheck— passesnpm run lint— passes (the only flagged file is.claude/settings.local.json, unrelated to this change)