bitcoin: cmake: (release) version handling is broken
Create a test tag: v99.99
Checkout v99.99 and perform a guix build:./contrib/guix/guix-build.
Take the dist-archive tarball: /bitcoin/guix-build-99.99/output/dist-archive/bitcoin-99.99.tar.gz and perform a build:
tar xf bitcoin-99.99.tar.gz
cd bitcoin-99.99
cmake -B build
cmake --build build
# ./build/src/bitcoind --version
Bitcoin Core daemon version v28.99.0-g43e287b3ff5f0d223b0911b6ef90054ce5eb69d2
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (23 by maintainers)
Should this issue still be tagged for v29.0? If so, what immediate actions are expected?
Since guix builds from this tarball, how is it that the guix build results in binaries the output the correct version, prior to cmake?
Edit:
I don’t see these issues when performing all of the release steps. When setting the version numbers and tagging as laid out in release-process.md, everything works as expected.
It looks like it’s only defined when building inside of a git tree. This is the same behavior as with autotools. My understanding is that the version numbers are also put in the build system because builds will not always occur inside of a git tree.
For reference, I reviewed and tested this specifically for the cmake switch last year and I concluded that everything has been ported accurately. So I don’t think there is a regression or a release-blocker.
In any case, it would be good to include full steps to reproduce here, starting from a fresh clone, because IIRC in some edge cases, the parent directory structure may influence the result if it is a git dir. The edge-cases aren’t well documented, sometimes only mentioned in the release notes:
https://github.com/bitcoin/bitcoin/blame/43e287b3ff5f0d223b0911b6ef90054ce5eb69d2/doc/release-notes/release-notes-0.20.0.md#L56
It would be nice to flatten the complexity here to something simple, but I don’t see how this can be achieved without possibly breaking someones build-setup.