Verify embedded version metadata after fetching a source tag
A Git tag or release name may not match the version string the built tool reports. After fetching version-pinned source, inspect the tree's own version metadata and reconcile it with the requested version before building.
Procedure:
- List available tags and map them to the request:
git ls-remote --tags <repo-url> | grep -i <requested-version> - After cloning or extracting, read embedded version files:
cat VERSION head -30 Changelog.md grep -RIn "version" --include="VERSION" --include="*.md" . | head - Compare the embedded string with the requested version. A tag
v3.13.1may identify a tree whoseVERSIONsaysversion=3.13and whose Changelog head says# Release 3.13; the built tool would then report3.13, not3.13.1. - If they differ, do not assume the tag is sufficient. Confirm what the built tool will actually report, and look for the tag or tarball that embeds the exact requested version before proceeding.
Why: for CompCert 3.13.1, git ls-remote --tags showed v3.13.1, but the cloned tree had VERSION version=3.13, Changelog.md # Release 3.13, 2023-07-04, and the GitHub release name was CompCert 3.13.
Supporting evidence: compile-compcert (this batch).