Skip to content

Commit 3a3b1f8

Browse files
committed
Makefile: make testpack.tar.gz from (almost) all changed files.
Here are the speeds and sizes of different compressors: gzip -1: 0m20.914s 789012066 gzip -2: 0m23.846s 775576167 gzip -3: 0m26.088s 765520181 gzip -4: 0m28.264s 748485795 gzip -5: 0m35.916s 736567221 gzip -6: 0m49.906s 730337022 gzip -7: 1m2.391s 728726884 bzip2: 1m32.191s 711695852 gzip -8: 1m51.655s 727303811 gzip -9: 2m51.123s 726946796 Uncompressing time: bzip2: 0m43.353s gzip -5: 0m8.318s The downside is that this is only useful on a *freshly built* tree: it will include everything config.vars and newer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 2b2fa20 commit 3a3b1f8

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

Makefile

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -921,26 +921,20 @@ install-data: installdirs $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(
921921

922922
install: install-program install-data
923923

924-
# Non-artifacts that are needed for testing. These are added to the
925-
# testpack.tar, used to transfer things between builder and tester
926-
# phase. If you get a missing file/executable while testing on CI it
927-
# is likely missing from this variable.
928-
TESTBINS = \
929-
$(CLN_PLUGIN_EXAMPLES) \
930-
tests/plugins/test_libplugin \
931-
tests/plugins/channeld_fakenet \
932-
tests/plugins/test_selfdisable_after_getmanifest \
933-
tools/hsmtool
924+
# We exclude most of target/ and external, but we need:
925+
# 1. config files (we only tar up files *newer* than these)
926+
# 2. $(DEFAULT_TARGETS) for rust stuff.
927+
# 3. $(EXTERNAL_LIBS) for prebuild external libraries.
928+
TESTPACK_EXTRAS := \
929+
config.vars ccan/config.h \
930+
$(DEFAULT_TARGETS) \
931+
$(EXTERNAL_LIBS)
934932

935933
# The testpack is used in CI to transfer built artefacts between the
936-
# build and the test phase. This is necessary because the fixtures in
937-
# `tests/` explicitly use the binaries built in the current directory
938-
# rather than using `$PATH`, as that may pick up some other installed
939-
# version of `lightningd` leading to bogus results. We bundle up all
940-
# built artefacts here, and will unpack them on the tester (overlaying
941-
# on top of the checked out repo as if we had just built it in place).
942-
testpack.tar.bz2: $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(DOC_DATA) config.vars $(TESTBINS) $(DEVTOOLS)
943-
tar -caf $@ $^
934+
# build and the test phase. Only useful on a freshly build tree!
935+
# We use Posix format for timestamps with subsecond accuracy.
936+
testpack.tar.gz: all-programs all-fuzz-programs all-test-programs default-targets
937+
(find * -path external -prune -o -path target -prune -o -newer config.vars -print; ls $(TESTPACK_EXTRAS)) | tar --verbatim-files-from -T- -c --format=posix -f - | gzip -5 > $@
944938

945939
uninstall:
946940
@$(NORMAL_UNINSTALL)

0 commit comments

Comments
 (0)