Skip to content

Stamp version.h from $SOLO5_VERSION for tarball pins - #642

Closed
samoht wants to merge 1 commit into
Solo5:mainfrom
samoht:version-from-env
Closed

Stamp version.h from $SOLO5_VERSION for tarball pins#642
samoht wants to merge 1 commit into
Solo5:mainfrom
samoht:version-from-env

Conversation

@samoht

@samoht samoht commented Jun 23, 2026

Copy link
Copy Markdown

gen_version_h.sh needs a version string when .git is absent. Today the only fallback is version.h.distrib, shipped in a make distrib release tarball. An opam tarball pin (or any exported git snapshot, e.g. a GitHub codeload archive) has neither a Git tree nor a version.h.distrib, so the build fails at gen_version_h.sh.

This PR adds $SOLO5_VERSION as a third source, after git describe and version.h.distrib, and passes it from the opam files as %{version}%. So opam pin add solo5 <tarball> and an opam-repository release from a codeload archive both build without a Git tree.

The macOS cross-build PR #641 carries this as a temporary commit so its CI can tar-pin solo5; that commit drops once this lands.

gen_version_h.sh needs a version when .git is absent. Today the only fallback is
version.h.distrib from a `make distrib` release tarball; an opam tarball pin (or
any exported git snapshot) has neither a Git tree nor a .distrib, so the build
fails.

Add $SOLO5_VERSION as a third source, after git describe and version.h.distrib,
and pass it from the opam files as %{version}% so a tarball pin builds.
samoht added a commit to samoht/solo5 that referenced this pull request Jun 23, 2026
Carried so the macOS e2e can tar-pin solo5; the real change is Solo5#642. Drop once
that lands.
@hannesm

hannesm commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I struggle to understand why this is needed. Now given the amount of maintenance of solo5, I'm not very comfortable to add this much more compexity (in the shell script, as well as opam pushing through some environment variable) for which I don't understand the use case. Why can't you use a git pin or a released version?

@samoht

samoht commented Jun 23, 2026

Copy link
Copy Markdown
Author

The current issue is that solo5 breaks if you try tin pin install it from a tarball. I agree this is a narrow use-case and I'm fine to drop it if you don't think that's useful.

@dinosaure

Copy link
Copy Markdown
Collaborator

try tin pin install it from a tarball.

It is, in fact, far too specific when other suitable solutions (such as pin a Git repository) are available and do not have the problem described here.

@samoht samoht closed this Jun 29, 2026
@samoht

samoht commented Jun 29, 2026

Copy link
Copy Markdown
Author

Fair. Thanks for reviewing this anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants