Skip to content

Commit 49911af

Browse files
committed
build: Include tag name in release tarball for bitcoin-build-info.h
1 parent e40be71 commit 49911af

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

cmake/script/GenerateBuildInfo.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ if(DEFINED BUILD_INFO_HEADER_PATH AND IS_ABSOLUTE "${BUILD_INFO_HEADER_PATH}")
1515
file(STRINGS ${BUILD_INFO_HEADER_PATH} INFO LIMIT_COUNT 1)
1616
endif()
1717
else()
18-
fatal_error()
18+
unset(INFO)
19+
set(BUILD_INFO_HEADER_PATH "/dev/stdout")
1920
endif()
2021

2122
if(DEFINED SOURCE_DIR)
@@ -104,7 +105,9 @@ if(GIT_TAG)
104105
elseif(GIT_COMMIT)
105106
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"")
106107
else()
107-
set(NEWINFO "// No build information available")
108+
# NOTE: The NEWINFO line below this comment gets replaced by a string-match in contrib/guix/libexec/make_release_tarball.sh
109+
# If changing it, update the script too!
110+
set(NEWINFO [[// No build information available]])
108111
endif()
109112

110113
# Only update the header if necessary.

contrib/guix/libexec/make_release_tarball.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ git archive --prefix="${DISTNAME}/" HEAD |
1818
tar -xp \
1919
--exclude '*minisketch*' \
2020
# end of tar options
21+
22+
# Generate correct build info file from git, before we lose git
23+
GIT_BUILD_INFO="$(cmake -P cmake/script/GenerateBuildInfo.cmake)"
24+
sed 's/\/\/ No build information available/'"${GIT_BUILD_INFO}"'/' -i "${DISTNAME}/cmake/script/GenerateBuildInfo.cmake"
25+
2126
tar \
2227
--format=ustar \
2328
--sort=name \

0 commit comments

Comments
 (0)