8000 Fix release tarball generated by gitian by luke-jr · Pull Request #18818 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix release tarball generated by gitian #18818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ script: |

GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"

# Create the source tarball
# Create the release tarball using (arbitrarily) the first host
mkdir -p "$(dirname "$GIT_ARCHIVE")"
git archive --prefix="${DISTNAME}/" --output="$GIT_ARCHIVE" HEAD
CONFIG_SITE="${BASEPREFIX}/${HOSTS/ */}/share/config.site" \
REFERENCE_DATETIME="${REFERENCE_DATETIME}" \
contrib/gitian-descriptors/make_release_tarball "${GIT_ARCHIVE}"

ORIGPATH="$PATH"
# Extract the git archive into a dir for each host and build
Expand All @@ -131,7 +133,6 @@ script: |
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf "${GIT_ARCHIVE}"

./autogen.sh
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
make ${MAKEOPTS}
make ${MAKEOPTS} -C src check-security
Expand Down
7 changes: 4 additions & 3 deletions contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ script: |

GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"

# Create the source tarball
# Create the release tarball using (arbitrarily) the first host
mkdir -p "$(dirname "$GIT_ARCHIVE")"
git archive --prefix="${DISTNAME}/" --output="$GIT_ARCHIVE" HEAD
CONFIG_SITE="${BASEPREFIX}/${HOSTS/ */}/share/config.site" \
REFERENCE_DATETIME="${REFERENCE_DATETIME}" \
contrib/gitian-descriptors/make_release_tarball "${GIT_ARCHIVE}"

ORIGPATH="$PATH"
# Extract the git archive into a dir for each host and build
Expand All @@ -123,7 +125,6 @@ script: |
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf "${GIT_ARCHIVE}"

./autogen.sh
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
make ${MAKEOPTS}
make ${MAKEOPTS} -C src check-security
Expand Down
7 changes: 4 additions & 3 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ script: |

GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"

# Create the source tarball
# Create the release tarball using (arbitrarily) the first host
mkdir -p "$(dirname "$GIT_ARCHIVE")"
git archive --prefix="${DISTNAME}/" --output="$GIT_ARCHIVE" HEAD
CONFIG_SITE="${BASEPREFIX}/${HOSTS/ */}/share/config.site" \
REFERENCE_DATETIME="${REFERENCE_DATETIME}" \
contrib/gitian-descriptors/make_release_tarball "${GIT_ARCHIVE}"

ORIGPATH="$PATH"
# Extract the git archive into a dir for each host and build
Expand All @@ -128,7 +130,6 @@ script: |
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf "${GIT_ARCHIVE}"

./autogen.sh
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}"
make ${MAKEOPTS}
make ${MAKEOPTS} -C src check-security
Expand Down
33 changes: 33 additions & 0 deletions contrib/gitian-descriptors/make_release_tarball
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# 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 generate source release tarball

set -e

GIT_ARCHIVE="$1"
. "`dirname "$0"`/assign_DISTNAME"

git archive --prefix="${DISTNAME}/" HEAD | tar -xp
cd "${DISTNAME}"

./autogen.sh
./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking
make distclean

cd ..
tar \
--format=ustar \
--exclude autom4te.cache \
--exclude .deps \
Comment on lines +23 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the only things we need to exclude?

Would be nice to have a comparison between "make dist minus all the git-tracked files" vs "bootstrapped files created this way minus the git-tracked files"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tar -tpf build/out/src/bitcoin-3897f3a2ec07.tar.gz | cut -b 22- | sort
git ls-files | perl -nle '$a=$_; while (s[/[^/]+/?$][/]) { if (not exists $d{$_}) { $d{$_} = undef; print } } print $a' | sort

Result:

Makefile.in
aclocal.m4
build-aux/compile
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/m4/lt~obsolete.m4
build-aux/missing
build-aux/test-driver
configure
doc/man/Makefile.in
src/Makefile.in
src/config/bitcoin-config.h.in
src/secp256k1/Makefile.in
src/secp256k1/aclocal.m4
src/secp256k1/build-aux/compile
src/secp256k1/build-aux/config.guess
src/secp256k1/build-aux/config.sub
src/secp256k1/build-aux/depcomp
src/secp256k1/build-aux/install-sh
src/secp256k1/build-aux/ltmain.sh
src/secp256k1/build-aux/m4/libtool.m4
src/secp256k1/build-aux/m4/ltoptions.m4
src/secp256k1/build-aux/m4/ltsugar.m4
src/secp256k1/build-aux/m4/ltversion.m4
src/secp256k1/build-aux/m4/lt~obsolete.m4
src/secp256k1/build-aux/missing
src/secp256k1/build-aux/test-driver
src/secp256k1/configure
src/secp256k1/src/libsecp256k1-config.h.in
src/univalue/Makefile.in
src/univalue/aclocal.m4
src/univalue/build-aux/compile
src/univalue/build-aux/config.guess
src/univalue/build-aux/config.sub
src/univalue/build-aux/depcomp
src/univalue/build-aux/install-sh
src/univalue/build-aux/ltmain.sh
src/univalue/build-aux/m4/libtool.m4
src/univalue/build-aux/m4/ltoptions.m4
src/univalue/build-aux/m4/ltsugar.m4
src/univalue/build-aux/m4/ltversion.m4
src/univalue/build-aux/m4/lt~obsolete.m4
src/univalue/build-aux/missing
src/univalue/build-aux/test-driver
src/univalue/configure
src/univalue/univalue-config.h.in

--exclude .git \
--sort=name \
--mode='u+rw,go+r-w,a+X' --owner=0 --group=0 \
--mtime="${REFERENCE_DATETIME}" \
-c "${DISTNAME}" | \
gzip -9n \
>"${GIT_ARCHIVE}"

rm -r "${DISTNAME}"
5 changes: 2 additions & 3 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
# Create the source tarball if not already there
if [ ! -e "$GIT_ARCHIVE" ]; then
mkdir -p "$(dirname "$GIT_ARCHIVE")"
git archive --prefix="${DISTNAME}/" --output="$GIT_ARCHIVE" HEAD
CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \
contrib/gitian-descriptors/make_release_tarball "${GIT_ARCHIVE}"
fi

###########################
Expand Down Expand Up @@ -195,8 +196,6 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
# Extract the source tarball
tar --strip-components=1 -xf "${GIT_ARCHIVE}"

./autogen.sh

# Configure this DISTSRC for $HOST
# shellcheck disable=SC2086
env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \
Expand Down
0