From 3fe6b6fd95a1fdb670501c35c82e8f534cc16bb0 Mon Sep 17 00:00:00 2001 From: Jan Sarenik Date: Thu, 31 May 2018 11:34:50 +0200 Subject: [PATCH 1/3] external/Makefile: Simplify build and fix race condition Git magic should not happen from inside the Makefiles. It may case pain when simultaneous make jobs are run. See #1538 where I first mentioned this issue. --- external/Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/external/Makefile b/external/Makefile index 48bca5479f58..f1910b651dfe 100644 --- a/external/Makefile +++ b/external/Makefile @@ -21,21 +21,13 @@ EXTERNAL_INCLUDE_FLAGS := \ EXTERNAL_LDLIBS := -Lexternal $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIBS))) -# Might exist, but need updating. Nuke and rebuild. -submodcheck-%: FORCE - if git submodule status external/$* | grep -q '^[-+]'; then rm -rf external/$*; git submodule update --init external/$*; fi - # We build libsodium, since Ubuntu xenial has one too old. external/libsodium.a: external/libsodium/src/libsodium/libsodium.la $(MAKE) -C external/libsodium DESTDIR=$$(pwd)/external install-exec -external/libsodium/src/libsodium/include/sodium.h: submodcheck-libsodium - external/libsodium/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h cd external/libsodium && ./autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-shared=no --enable-tests=no --prefix=/ --libdir=/ && $(MAKE) -$(LIBWALLY_HEADERS) $(LIBSECP_HEADERS): submodcheck-libwally-core - # libsecp included in libwally. # Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file external/libsecp256k1.% external/libwallycore.%: external/libwally-core/src/secp256k1/libsecp256k1.la external/libwally-core/src/libwallycore.la @@ -44,8 +36,6 @@ external/libsecp256k1.% external/libwallycore.%: external/libwally-core/src/secp external/libwally-core/src/libwallycore.% external/libwally-core/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE) -external/jsmn/jsmn.h: submodcheck-jsmn - # If we tell Make that the above builds both, it runs it twice in # parallel. So we lie :( external/jsmn/jsmn.c: external/jsmn/jsmn.h @@ -61,8 +51,6 @@ LIBBASE58_SRC := external/libbase58/base58.c $(LIBBASE58_SRC): $(LIBBASE58_HEADERS) -$(LIBBASE58_HEADERS): submodcheck-libbase58 - # Can't be inside submodule, as that makes git think it's dirty. external/base58.o: $(LIBBASE58_SRC) Makefile $(COMPILE.c) $(OUTPUT_OPTION) $< @@ -70,8 +58,6 @@ external/base58.o: $(LIBBASE58_SRC) Makefile external/libbase58.a: external/base58.o $(AR) rc $@ $< -external/libbacktrace/backtrace.h: submodcheck-libbacktrace - # Need separate build dir: changes inside submodule make git think it's dirty. external/libbacktrace.a: external/libbacktrace/backtrace.h @mkdir external/libbacktrace-build 2>/dev/null || true From a2a9598be34dbbbc815c965d981d6a2f5c6a1493 Mon Sep 17 00:00:00 2001 From: Jan Sarenik Date: Tue, 5 Jun 2018 00:31:00 +0200 Subject: [PATCH 2/3] .travis.yml: Add explicit recursive submodules init The sources I have found are not clear about if Travis does recursive submodules init for non-private repositories. According to https://docs.travis-ci.com/user/private-dependencies/ it does it for private ones. Adding this line just makes sure the git submodules are properly initialized. It does not break anything even if they were and because this is closed-source hosted service, I suggest this extra verbosity. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0cb8b19258aa..473b797aa13c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: c dist: trusty sudo: true +before_install: + - git submodule update --init --recursive + notifications: email: false From 6913a22f08de921188e69dab25901ff3d884f215 Mon Sep 17 00:00:00 2001 From: Jan Sarenik Date: Tue, 5 Jun 2018 17:38:28 +0200 Subject: [PATCH 3/3] external/libbacktrace: Update to latest master This contains recent updates to config.sub and config.guess files. --- external/libbacktrace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/libbacktrace b/external/libbacktrace index 14d377e9be7c..078f841be602 160000 --- a/external/libbacktrace +++ b/external/libbacktrace @@ -1 +1 @@ -Subproject commit 14d377e9be7c89511c472d728e1b88b4e96f1946 +Subproject commit 078f841be6029a59eb49d645e3720422df1dc9f2