mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
Merge #18741: guix: Make source tarball using git-archive
bfe1ba2f5b
rel-builds: Specify core.abbrev for git-rev-parse (Carl Dong)27e63e01cc
build: Accomodate makensis v2.x (Carl Dong)1f2c39a30e
guix: Remove logical cores requirement (Carl Dong)a4f6ffa71e
lint: Also enable source statements for non-gitian (Carl Dong)d256f91cb1
rel-builds: Directly deploy win installer to OUTDIR (Carl Dong)fa791da02f
nsis: Specify OutFile path only once (Carl Dong)14701604d0
guix: Expose GIT_COMMON_DIR in container as readonly (Carl Dong)f5a6ac4f48
guix: Make source tarball using git-archive (Carl Dong)395c1137f6
gitian: Limit sourced script to just assignments (Carl Dong) Pull request description: Based on: #18556 Related: https://github.com/bitcoin/bitcoin/pull/17595#discussion_r399728721 ACKs for top commit: fanquake: ACKbfe1ba2f5b
- I agree with Carl, and am going to merge this. I'd like for Linux Guix builds to be working again, and we can rebase #18818. Tree-SHA512: c87ada7e3de17ca0b692a91029b86573442ded5780fc081c214773f6b374a0cdbeaf6f6898c36669c2e247ee32aa7f82defb1180f8decac52c65f0c140f18674
This commit is contained in:
commit
d96fdc2a39
12 changed files with 64 additions and 58 deletions
|
@ -80,7 +80,7 @@ $(BITCOIN_WIN_INSTALLER): all-recursive
|
||||||
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
|
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
|
||||||
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TX_BIN) $(top_builddir)/release
|
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TX_BIN) $(top_builddir)/release
|
||||||
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_WALLET_BIN) $(top_builddir)/release
|
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_WALLET_BIN) $(top_builddir)/release
|
||||||
@test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
|
@test -f $(MAKENSIS) && echo 'OutFile "$@"' | cat $(top_builddir)/share/setup.nsi - | $(MAKENSIS) -V2 - || \
|
||||||
echo error: could not build $@
|
echo error: could not build $@
|
||||||
@echo built $@
|
@echo built $@
|
||||||
|
|
||||||
|
|
12
contrib/gitian-descriptors/assign_DISTNAME
Executable file
12
contrib/gitian-descriptors/assign_DISTNAME
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
# Copyright (c) 2020 The Bitcoin Core developers
|
||||||
|
# Distributed under the MIT software license, see the accompanying
|
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
#
|
||||||
|
# A helper script to be sourced into the gitian descriptors
|
||||||
|
|
||||||
|
if RECENT_TAG="$(git describe --exact-match HEAD)"; then
|
||||||
|
VERSION="${RECENT_TAG#v}"
|
||||||
|
else
|
||||||
|
VERSION="$(git rev-parse --short=12 HEAD)"
|
||||||
|
fi
|
||||||
|
DISTNAME="bitcoin-${VERSION}"
|
|
@ -140,9 +140,15 @@ script: |
|
||||||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||||
export PATH=${WRAP_DIR}:${PATH}
|
export PATH=${WRAP_DIR}:${PATH}
|
||||||
|
|
||||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
# Define DISTNAME variable.
|
||||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||||
source contrib/gitian-descriptors/make_git_archive
|
source contrib/gitian-descriptors/assign_DISTNAME
|
||||||
|
|
||||||
|
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||||
|
|
||||||
|
# Create the source tarball
|
||||||
|
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||||
|
git archive --output="$GIT_ARCHIVE" HEAD
|
||||||
|
|
||||||
ORIGPATH="$PATH"
|
ORIGPATH="$PATH"
|
||||||
# Extract the git archive into a dir for each host and build
|
# Extract the git archive into a dir for each host and build
|
||||||
|
|
|
@ -103,9 +103,15 @@ script: |
|
||||||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||||
export PATH=${WRAP_DIR}:${PATH}
|
export PATH=${WRAP_DIR}:${PATH}
|
||||||
|
|
||||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
# Define DISTNAME variable.
|
||||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||||
source contrib/gitian-descriptors/make_git_archive
|
source contrib/gitian-descriptors/assign_DISTNAME
|
||||||
|
|
||||||
|
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||||
|
|
||||||
|
# Create the source tarball
|
||||||
|
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||||
|
git archive --output="$GIT_ARCHIVE" HEAD
|
||||||
|
|
||||||
ORIGPATH="$PATH"
|
ORIGPATH="$PATH"
|
||||||
# Extract the git archive into a dir for each host and build
|
# Extract the git archive into a dir for each host and build
|
||||||
|
|
|
@ -108,9 +108,15 @@ script: |
|
||||||
create_per-host_compiler_wrapper "${REFERENCE_DATETIME}"
|
create_per-host_compiler_wrapper "${REFERENCE_DATETIME}"
|
||||||
export PATH=${WRAP_DIR}:${PATH}
|
export PATH=${WRAP_DIR}:${PATH}
|
||||||
|
|
||||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
# Define DISTNAME variable.
|
||||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||||
source contrib/gitian-descriptors/make_git_archive
|
source contrib/gitian-descriptors/assign_DISTNAME
|
||||||
|
|
||||||
|
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||||
|
|
||||||
|
# Create the source tarball
|
||||||
|
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||||
|
git archive --output="$GIT_ARCHIVE" HEAD
|
||||||
|
|
||||||
ORIGPATH="$PATH"
|
ORIGPATH="$PATH"
|
||||||
# Extract the git archive into a dir for each host and build
|
# Extract the git archive into a dir for each host and build
|
||||||
|
@ -127,9 +133,8 @@ script: |
|
||||||
make ${MAKEOPTS}
|
make ${MAKEOPTS}
|
||||||
make ${MAKEOPTS} -C src check-security
|
make ${MAKEOPTS} -C src check-security
|
||||||
make ${MAKEOPTS} -C src check-symbols
|
make ${MAKEOPTS} -C src check-symbols
|
||||||
make deploy
|
make deploy BITCOIN_WIN_INSTALLER="${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
|
||||||
make install DESTDIR=${INSTALLPATH}
|
make install DESTDIR=${INSTALLPATH}
|
||||||
cp -f ./bitcoin-*-win64-setup-unsigned.exe ${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe
|
|
||||||
cd installed
|
cd installed
|
||||||
mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/
|
mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/
|
||||||
find . -name "lib*.la" -delete
|
find . -name "lib*.la" -delete
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
|
||||||
# Distributed under the MIT software license, see the accompanying
|
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
||||||
#
|
|
||||||
# A helper script to be sourced into the gitian descriptors
|
|
||||||
|
|
||||||
mkdir -p ${OUTDIR}/src
|
|
||||||
RECENT_TAG=$(git describe --abbrev=0 HEAD)
|
|
||||||
if [ $RECENT_TAG = $(git describe HEAD) ]; then
|
|
||||||
if [[ $RECENT_TAG == v* ]]; then
|
|
||||||
VERSION=${RECENT_TAG:1}
|
|
||||||
else
|
|
||||||
VERSION=$RECENT_TAG
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
VERSION=$(git rev-parse --short HEAD)
|
|
||||||
fi
|
|
||||||
DISTNAME=bitcoin-${VERSION}
|
|
||||||
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
|
||||||
git archive --output=$GIT_ARCHIVE HEAD
|
|
|
@ -13,7 +13,6 @@ We achieve bootstrappability by using Guix as a functional package manager.
|
||||||
|
|
||||||
Conservatively, a x86_64 machine with:
|
Conservatively, a x86_64 machine with:
|
||||||
|
|
||||||
- 2 or more logical cores
|
|
||||||
- 4GB of free disk space on the partition that /gnu/store will reside in
|
- 4GB of free disk space on the partition that /gnu/store will reside in
|
||||||
- 24GB of free disk space on the partition that the Bitcoin Core git repository
|
- 24GB of free disk space on the partition that the Bitcoin Core git repository
|
||||||
resides in
|
resides in
|
||||||
|
|
|
@ -105,6 +105,7 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
|
||||||
--pure \
|
--pure \
|
||||||
--no-cwd \
|
--no-cwd \
|
||||||
--share="$PWD"=/bitcoin \
|
--share="$PWD"=/bitcoin \
|
||||||
|
--expose="$(git rev-parse --git-common-dir)" \
|
||||||
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
|
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
|
||||||
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
|
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
|
||||||
-- env HOST="$host" \
|
-- env HOST="$host" \
|
||||||
|
|
|
@ -141,19 +141,17 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \
|
||||||
# Source Tarball Building #
|
# Source Tarball Building #
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
# Create the source tarball and move it to "${OUTDIR}/src" if not already there
|
# Define DISTNAME variable.
|
||||||
if [ -z "$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')" ]; then
|
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||||
./autogen.sh
|
source contrib/gitian-descriptors/assign_DISTNAME
|
||||||
env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" ./configure --prefix=/
|
|
||||||
make dist GZIP_ENV='-9n' ${V:+V=1}
|
|
||||||
mkdir -p "${OUTDIR}/src"
|
|
||||||
mv "$(find "${PWD}" -name 'bitcoin-*.tar.gz')" "${OUTDIR}/src/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine the full path to our source tarball
|
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||||
SOURCEDIST="$(find "${OUTDIR}/src" -name 'bitcoin-*.tar.gz')"
|
|
||||||
# Determine our distribution name (e.g. bitcoin-0.18.0)
|
# Create the source tarball if not already there
|
||||||
DISTNAME="$(basename "$SOURCEDIST" '.tar.gz')"
|
if [ ! -e "$GIT_ARCHIVE" ]; then
|
||||||
|
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||||
|
git archive --output="$GIT_ARCHIVE" HEAD
|
||||||
|
fi
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Binary Tarball Building #
|
# Binary Tarball Building #
|
||||||
|
@ -187,7 +185,9 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
|
||||||
cd "$DISTSRC"
|
cd "$DISTSRC"
|
||||||
|
|
||||||
# Extract the source tarball
|
# Extract the source tarball
|
||||||
tar --strip-components=1 -xf "${SOURCEDIST}"
|
tar -xf "${GIT_ARCHIVE}"
|
||||||
|
|
||||||
|
./autogen.sh
|
||||||
|
|
||||||
# Configure this DISTSRC for $HOST
|
# Configure this DISTSRC for $HOST
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
@ -220,7 +220,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
|
||||||
# Make the os-specific installers
|
# Make the os-specific installers
|
||||||
case "$HOST" in
|
case "$HOST" in
|
||||||
*mingw*)
|
*mingw*)
|
||||||
make deploy ${V:+V=1}
|
make deploy ${V:+V=1} BITCOIN_WIN_INSTALLER="${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -232,11 +232,6 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
|
||||||
# Install built Bitcoin Core to $INSTALLPATH
|
# Install built Bitcoin Core to $INSTALLPATH
|
||||||
make install DESTDIR="${INSTALLPATH}" ${V:+V=1}
|
make install DESTDIR="${INSTALLPATH}" ${V:+V=1}
|
||||||
|
|
||||||
case "$HOST" in
|
|
||||||
*mingw*)
|
|
||||||
cp -f --target-directory="$OUTDIR" ./*-setup-unsigned.exe
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
(
|
(
|
||||||
cd installed
|
cd installed
|
||||||
|
|
||||||
|
@ -264,7 +259,7 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
|
||||||
cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt"
|
cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt"
|
||||||
;;
|
;;
|
||||||
*linux*)
|
*linux*)
|
||||||
cp "${DISTSRC}/doc/README.md" "${DISTNAME}/"
|
cp "${DISTSRC}/README.md" "${DISTNAME}/"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -307,7 +302,7 @@ case "$HOST" in
|
||||||
(
|
(
|
||||||
cd ./windeploy
|
cd ./windeploy
|
||||||
mkdir unsigned
|
mkdir unsigned
|
||||||
cp --target-directory=unsigned/ "$OUTDIR"/bitcoin-*-setup-unsigned.exe
|
cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
|
||||||
find . -print0 \
|
find . -print0 \
|
||||||
| sort --zero-terminated \
|
| sort --zero-terminated \
|
||||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
(gnu packages pkg-config)
|
(gnu packages pkg-config)
|
||||||
(gnu packages python)
|
(gnu packages python)
|
||||||
(gnu packages shells)
|
(gnu packages shells)
|
||||||
|
(gnu packages version-control)
|
||||||
(guix build-system gnu)
|
(guix build-system gnu)
|
||||||
(guix build-system trivial)
|
(guix build-system trivial)
|
||||||
(guix gexp)
|
(guix gexp)
|
||||||
|
@ -181,6 +182,8 @@ chain for " target " development."))
|
||||||
;; Scripting
|
;; Scripting
|
||||||
perl
|
perl
|
||||||
python-3.7
|
python-3.7
|
||||||
|
;; Git
|
||||||
|
git
|
||||||
;; Native gcc 9 toolchain targeting glibc 2.27
|
;; Native gcc 9 toolchain targeting glibc 2.27
|
||||||
(make-gcc-toolchain gcc-9 glibc-2.27))
|
(make-gcc-toolchain gcc-9 glibc-2.27))
|
||||||
(let ((target (getenv "HOST")))
|
(let ((target (getenv "HOST")))
|
||||||
|
|
|
@ -51,7 +51,6 @@ Var StartMenuGroup
|
||||||
!insertmacro MUI_LANGUAGE English
|
!insertmacro MUI_LANGUAGE English
|
||||||
|
|
||||||
# Installer attributes
|
# Installer attributes
|
||||||
OutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-win64-setup-unsigned.exe
|
|
||||||
InstallDir $PROGRAMFILES64\Bitcoin
|
InstallDir $PROGRAMFILES64\Bitcoin
|
||||||
CRCCheck on
|
CRCCheck on
|
||||||
XPStyle on
|
XPStyle on
|
||||||
|
|
|
@ -35,8 +35,9 @@ if ! command -v shellcheck > /dev/null; then
|
||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced)
|
||||||
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
|
EXCLUDE="--exclude=$(IFS=','; echo "${disabled[*]}")"
|
||||||
if ! shellcheck "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
|
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -46,14 +47,13 @@ if ! command -v yq > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EXCLUDE_GITIAN=${EXCLUDE}",$(IFS=','; echo "${disabled_gitian[*]}")"
|
EXCLUDE_GITIAN=${EXCLUDE}",$(IFS=','; echo "${disabled_gitian[*]}")"
|
||||||
SHELLCHECK_CMD="shellcheck --external-sources --check-sourced $EXCLUDE_GITIAN"
|
|
||||||
for descriptor in $(git ls-files -- 'contrib/gitian-descriptors/*.yml')
|
for descriptor in $(git ls-files -- 'contrib/gitian-descriptors/*.yml')
|
||||||
do
|
do
|
||||||
script=$(basename "$descriptor")
|
script=$(basename "$descriptor")
|
||||||
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
|
# Use #!/bin/bash as gitian-builder/bin/gbuild does to complete a script.
|
||||||
echo "#!/bin/bash" > $script
|
echo "#!/bin/bash" > $script
|
||||||
yq -r .script "$descriptor" >> $script
|
yq -r .script "$descriptor" >> $script
|
||||||
if ! $SHELLCHECK_CMD $script; then
|
if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE_GITIAN" $script; then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
rm $script
|
rm $script
|
||||||
|
|
Loading…
Add table
Reference in a new issue