lightning
lightning copied to clipboard
(24.02.2) make "ERROR: git is required for generating version information"
Issue and Steps to Reproduce
When building latest release v24.02.2 from source on RaspiOS armhf (Bullseye), "make" fails with the following error:
"ERROR: git is required for generating version information"
When I reverted to earlier release v23.11.2, the error no longer occurred, so the issue appears to have been introduced after that release.
getinfo output
N/A
@ShahanaFarooqui is this related to the out-of-tree build being changed somehow? I'm not aware of a change to the version self-detection, or we might be missing a change in the source tar all?
This is still a problem in 24.08.1
I figured out this only happens when building the source from the ZIP file on the release page. The error doesn't happen if I clone the repo with git and checkout the release tag.
@cdecker, the issue is not related to a dirty tree; it is due to the absence of the .git directory in the source code (both zip and tar formats).
In short, the solution is to clone the repository instead of using the source zip from the release page.
To elaborate, we could have suggested a solution to initialise a new Git repository (using git init) and add submodules as follows:
find external -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
git submodule add https://github.com/jedisct1/libsodium.git external/libsodium
git submodule add https://github.com/ianlancetaylor/libbacktrace.git external/libbacktrace
git submodule add https://github.com/ElementsProject/libwally-core.git external/libwally-core
git submodule add https://github.com/valyala/gheap external/gheap
git submodule add https://github.com/kristapsdz/lowdown.git external/lowdown
git submodule add https://github.com/zserge/jsmn external/jsmn
However, this approach will install the latest versions of the submodules instead of the specific versions we are currently using, as version information is stored in the .git directory. Even if we check out specific commits, the make command reinitialise and clones all submodules again, leading to build failures with different errors.
Closing the issue while acknowledging it as a known limitation. Please feel free to reopen or comment if needed.