Skip to content

Fall back to an older opam release when the latest lacks binaries#1100

Merged
smorimoto merged 1 commit intomasterfrom
fallback-opam-release-with-binaries
Apr 16, 2026
Merged

Fall back to an older opam release when the latest lacks binaries#1100
smorimoto merged 1 commit intomasterfrom
fallback-opam-release-with-binaries

Conversation

@smorimoto
Copy link
Copy Markdown
Member

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:

Failed to find opam binary for 'linux' and 'x86_64'. Please check if this combination is supported by opam.

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 — passes
  • npm run typecheck — passes
  • npm run lint — passes (the only flagged file is .claude/settings.local.json, unrelated to this change)
  • The fix can be verified end-to-end by running the action on any platform; it should now resolve to opam 2.5.0 instead of erroring out on 2.5.1

@smorimoto smorimoto added the bug Something isn't working label Apr 16, 2026
@smorimoto smorimoto force-pushed the fallback-opam-release-with-binaries branch from df741f9 to cd2a424 Compare April 16, 2026 01:27
@smorimoto smorimoto force-pushed the fallback-opam-release-with-binaries branch from cd2a424 to b14c9ed Compare April 16, 2026 01:28
@smorimoto smorimoto merged commit 2ad4989 into master Apr 16, 2026
19 checks passed
@smorimoto smorimoto deleted the fallback-opam-release-with-binaries branch April 16, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant