Skip to content

Commit baa72cd

Browse files
committed
Merge #18331: build: Use git archive as source tarball
e4d3667 build: Drop needless EXTRA_DIST content (Hennadii Stepanov) 6c4da59 build: Drop SOURCEDIST reordering (Hennadii Stepanov) 5e6b8b3 build: Use git archive as source tarball (Hennadii Stepanov) Pull request description: This PR: - is an alternative to #17104 - closes #16734 - closes #6753 The idea is clear described by some developers: - [MarcoFalke](bitcoin/bitcoin#17097 (comment)): > This whole concept of explicitly listing each and every file manually (or with a fragile wildcard) is an obvious sisyphean task. I'd say all we need to do is run git archive and be done with it forever, see #16734, #6753, #11530 ... - [laanwj](bitcoin/bitcoin#17097 (comment)): > I agree, I've never been a fan of it. I don't think we have any files in the git repository we don't want to ship in the source tarball. --- The suggested changes have a downside which is pointed by [**luke-jr**](bitcoin/bitcoin#17104 (comment)): > ... but the distfile needs to include autogen-generated files. This means that a user is not able to run `./configure && make` right away. One must run `./autogen.sh` at first. Here are opinions about mandatory use of `./autogen.sh`: - [ryanofsky](bitcoin/bitcoin#16734 (comment)): > It's probably ok to require autogen. I think historically configure scripts were supposed to work on obscure unix systems that would just have a generic shell + make tool + c compiler, and not necessarily need gnu packages like m4 which are needed for autogen. - [laanwj](bitcoin/bitcoin#16734 (comment)): > I also think it's fine to require autogen. What is one dependency more, if you're building from source. --- ~Also this PR provides Windows users with ZIP archives of the sources. Additionally the commit ID is stored in these ZIP files as a file comment:~ --- Note for reviewers: please verify is `git archive` output deterministic? ACKs for top commit: MarcoFalke: re-ACK e4d3667, only change is adding two dots in a the path 🛳 laanwj: ACK e4d3667 Tree-SHA512: d1153d3ca4a580696019b92be3555ab004d197d9a2146aacff9d3150eb7093b7d40eebd6eea12d861d93ff62d62b68706e04e64dbe5ea796ff6757486e462193
2 parents 3f5107d + e4d3667 commit baa72cd

File tree

4 files changed

+15
-40
lines changed

4 files changed

+15
-40
lines changed

Makefile.am

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013-2016 The Bitcoin Core developers
1+
# Copyright (c) 2013-2020 The Bitcoin Core developers
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

@@ -43,16 +43,7 @@ OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
4343
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
4444
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
4545

46-
DIST_DOCS = \
47-
README.md \
48-
$(wildcard doc/*.md) \
49-
$(wildcard doc/release-notes/*.md)
50-
DIST_CONTRIB = $(top_srcdir)/contrib/bitcoin-cli.bash-completion \
51-
$(top_srcdir)/contrib/bitcoin-tx.bash-completion \
52-
$(top_srcdir)/contrib/bitcoind.bash-completion \
53-
$(top_srcdir)/contrib/debian/copyright \
54-
$(top_srcdir)/contrib/init \
55-
$(top_srcdir)/contrib/install_db4.sh \
46+
DIST_CONTRIB = \
5647
$(top_srcdir)/contrib/linearize/linearize-data.py \
5748
$(top_srcdir)/contrib/linearize/linearize-hashes.py
5849

@@ -246,7 +237,7 @@ endif
246237

247238
dist_noinst_SCRIPTS = autogen.sh
248239

249-
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
240+
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
250241

251242
EXTRA_DIST += \
252243
test/functional \

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ script: |
147147
SOURCEDIST=$(echo bitcoin-*.tar.gz)
148148
DISTNAME=${SOURCEDIST/%.tar.gz}
149149
150-
# Correct tar file order
151-
mkdir -p temp
152-
pushd temp
153-
tar -xf ../$SOURCEDIST
154-
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
155-
popd
156-
157150
# Workaround for tarball not building with the bare tag version (prep)
158151
make -C src obj/build.h
159152
@@ -190,11 +183,12 @@ script: |
190183
rm -rf ${DISTNAME}/lib/pkgconfig
191184
find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
192185
find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
193-
cp ../README.md ${DISTNAME}/
186+
cp ../../README.md ${DISTNAME}/
194187
find ${DISTNAME} -not -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
195188
find ${DISTNAME} -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz
196189
cd ../../
197190
rm -rf distsrc-${i}
198191
done
199-
mkdir -p $OUTDIR/src
200-
mv $SOURCEDIST $OUTDIR/src
192+
193+
mkdir -p ${OUTDIR}/src
194+
git archive --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ script: |
110110
SOURCEDIST=$(echo bitcoin-*.tar.gz)
111111
DISTNAME=${SOURCEDIST/%.tar.gz}
112112
113-
# Correct tar file order
114-
mkdir -p temp
115-
pushd temp
116-
tar -xf ../$SOURCEDIST
117-
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
118-
popd
119-
120113
# Workaround for tarball not building with the bare tag version (prep)
121114
make -C src obj/build.h
122115
@@ -166,6 +159,8 @@ script: |
166159
find ${DISTNAME} | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
167160
cd ../../
168161
done
169-
mkdir -p $OUTDIR/src
170-
mv $SOURCEDIST $OUTDIR/src
162+
163+
mkdir -p ${OUTDIR}/src
164+
git archive --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD
165+
171166
mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,6 @@ script: |
117117
SOURCEDIST=$(echo bitcoin-*.tar.gz)
118118
DISTNAME=${SOURCEDIST/%.tar.gz}
119119
120-
# Correct tar file order
121-
mkdir -p temp
122-
pushd temp
123-
tar -xf ../$SOURCEDIST
124-
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
125-
popd
126-
127120
# Workaround for tarball not building with the bare tag version (prep)
128121
make -C src obj/build.h
129122
@@ -161,8 +154,10 @@ script: |
161154
cd ../../
162155
rm -rf distsrc-${i}
163156
done
164-
mkdir -p $OUTDIR/src
165-
mv $SOURCEDIST $OUTDIR/src
157+
158+
mkdir -p ${OUTDIR}/src
159+
git archive --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD
160+
166161
cp -rf contrib/windeploy $BUILD_DIR
167162
cd $BUILD_DIR/windeploy
168163
mkdir unsigned

0 commit comments

Comments
 (0)