From 0c07861404f5aef0a605020b729fea269211c12e Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 17 Mar 2021 14:04:02 +0100 Subject: [PATCH 01/37] - Fix #441: Minimal NSEC range not accepted for top level domains. --- doc/Changelog | 3 +++ iterator/iter_scrub.c | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index b6bbfa210..bce6fbee0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +17 March 2021: Wouter + - Fix #441: Minimal NSEC range not accepted for top level domains. + 11 March 2021: Wouter - Fix parse of LOC RR type for decimetres. diff --git a/iterator/iter_scrub.c b/iterator/iter_scrub.c index aae934dd4..f093c1bf9 100644 --- a/iterator/iter_scrub.c +++ b/iterator/iter_scrub.c @@ -640,25 +640,37 @@ store_rrset(sldns_buffer* pkt, struct msg_parse* msg, struct module_env* env, /** * Check if right hand name in NSEC is within zone + * @param pkt: the packet buffer for decompression. * @param rrset: the NSEC rrset * @param zonename: the zone name. * @return true if BAD. */ -static int sanitize_nsec_is_overreach(struct rrset_parse* rrset, - uint8_t* zonename) +static int sanitize_nsec_is_overreach(sldns_buffer* pkt, + struct rrset_parse* rrset, uint8_t* zonename) { struct rr_parse* rr; uint8_t* rhs; size_t len; log_assert(rrset->type == LDNS_RR_TYPE_NSEC); for(rr = rrset->rr_first; rr; rr = rr->next) { + size_t pos = sldns_buffer_position(pkt); + size_t rhspos; rhs = rr->ttl_data+4+2; len = sldns_read_uint16(rr->ttl_data+4); - if(!dname_valid(rhs, len)) { - /* malformed domain name in rdata */ + rhspos = rhs-sldns_buffer_begin(pkt); + sldns_buffer_set_position(pkt, rhspos); + if(pkt_dname_len(pkt) == 0) { + /* malformed */ + sldns_buffer_set_position(pkt, pos); return 1; } - if(!dname_subdomain_c(rhs, zonename)) { + if(sldns_buffer_position(pkt)-rhspos > len) { + /* outside of rdata boundaries */ + sldns_buffer_set_position(pkt, pos); + return 1; + } + sldns_buffer_set_position(pkt, pos); + if(!pkt_sub(pkt, rhs, zonename)) { /* overreaching */ return 1; } @@ -791,7 +803,7 @@ scrub_sanitize(sldns_buffer* pkt, struct msg_parse* msg, } /* check if right hand side of NSEC is within zone */ if(rrset->type == LDNS_RR_TYPE_NSEC && - sanitize_nsec_is_overreach(rrset, zonename)) { + sanitize_nsec_is_overreach(pkt, rrset, zonename)) { remove_rrset("sanitize: removing overreaching NSEC " "RRset:", pkt, msg, prev, &rrset); continue; From 57d4c3a8a4592cf1411c2600bb2debcddcc2416d Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 19 Mar 2021 17:43:36 +0100 Subject: [PATCH 02/37] - Fix for #447: squelch connection refused tcp connection failures from the log, unless verbosity is high. --- doc/Changelog | 4 ++++ util/netevent.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index bce6fbee0..12d98eb21 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +19 March 2021: Wouter + - Fix for #447: squelch connection refused tcp connection failures + from the log, unless verbosity is high. + 17 March 2021: Wouter - Fix #441: Minimal NSEC range not accepted for top level domains. diff --git a/util/netevent.c b/util/netevent.c index 6ef84133b..aac717f8d 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -1633,6 +1633,10 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok) if(errno == ECONNRESET && verbosity < 2) return 0; /* silence reset by peer */ #endif +#ifdef ECONNREFUSED + if(errno == ECONNREFUSED && verbosity < 2) + return 0; /* silence reset by peer */ +#endif #ifdef ENETUNREACH if(errno == ENETUNREACH && verbosity < 2) return 0; /* silence it */ @@ -1661,6 +1665,16 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok) } #endif #else /* USE_WINSOCK */ + if(WSAGetLastError() == WSAECONNREFUSED && verbosity < 2) + return 0; + if(WSAGetLastError() == WSAEHOSTDOWN && verbosity < 2) + return 0; + if(WSAGetLastError() == WSAEHOSTUNREACH && verbosity < 2) + return 0; + if(WSAGetLastError() == WSAENETDOWN && verbosity < 2) + return 0; + if(WSAGetLastError() == WSAENETUNREACH && verbosity < 2) + return 0; if(WSAGetLastError() == WSAECONNRESET) return 0; if(WSAGetLastError() == WSAEINPROGRESS) From 839cce1a7b864eb10651e7d7ca03748ef8184721 Mon Sep 17 00:00:00 2001 From: orbea Date: Sun, 21 Mar 2021 16:28:58 -0700 Subject: [PATCH 03/37] build: Add missing linker flags. --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index b640af006..3b040d359 100644 --- a/Makefile.in +++ b/Makefile.in @@ -464,7 +464,7 @@ libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i un # Pyunbound python unbound wrapper _unbound.la: libunbound_wrap.lo libunbound.la - $(LIBTOOL) --tag=CC --mode=link $(CC) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -module -avoid-version -no-undefined -shared -o $@ libunbound_wrap.lo -rpath $(PYTHON_SITE_PKG) -L. -L.libs -lunbound + $(LIBTOOL) --tag=CC --mode=link $(CC) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -module -avoid-version -no-undefined -shared -o $@ libunbound_wrap.lo -rpath $(PYTHON_SITE_PKG) -L. -L.libs -lunbound $(LIBS) util/config_file.c: util/configparser.h util/configlexer.c: $(srcdir)/util/configlexer.lex util/configparser.h From 52953c86a267fb2297a177b8312def3f6e4eb772 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 08:57:01 +0100 Subject: [PATCH 04/37] Changelog note for #449. --- doc/Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 12d98eb21..616969f2a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +22 March 2021: Wouter + - Merge #449 from orbea: build: Add missing linker flags. + 19 March 2021: Wouter - Fix for #447: squelch connection refused tcp connection failures from the log, unless verbosity is high. From 5b782d0a220cb2495481f1ed64f780ed9b7648fa Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 09:12:41 +0100 Subject: [PATCH 05/37] - iana portlist update. --- doc/Changelog | 1 + util/iana_ports.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 616969f2a..2d1cb04a0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 22 March 2021: Wouter - Merge #449 from orbea: build: Add missing linker flags. + - iana portlist update. 19 March 2021: Wouter - Fix for #447: squelch connection refused tcp connection failures diff --git a/util/iana_ports.inc b/util/iana_ports.inc index 82bbc867b..60bf59115 100644 --- a/util/iana_ports.inc +++ b/util/iana_ports.inc @@ -4736,6 +4736,7 @@ 8006, 8007, 8008, +8017, 8019, 8020, 8021, From f9e34757766fb43c8d390f6772b3d99a6c41a430 Mon Sep 17 00:00:00 2001 From: George Thessalonikefs Date: Mon, 22 Mar 2021 14:31:58 +0100 Subject: [PATCH 06/37] - Fix unused-function warning when compiling with --enable-dnscrypt. --- dnscrypt/dnscrypt.c | 2 ++ doc/Changelog | 3 +++ 2 files changed, 5 insertions(+) diff --git a/dnscrypt/dnscrypt.c b/dnscrypt/dnscrypt.c index 843735018..9b324ae69 100644 --- a/dnscrypt/dnscrypt.c +++ b/dnscrypt/dnscrypt.c @@ -863,6 +863,7 @@ dnsc_parse_keys(struct dnsc_env *env, struct config_file *cfg) return cert_id; } +#ifdef SODIUM_MISUSE_HANDLER static void sodium_misuse_handler(void) { @@ -872,6 +873,7 @@ sodium_misuse_handler(void) " unbound in a chroot, make sure /dev/urandom is available. See" " https://www.unbound.net/documentation/unbound.conf.html"); } +#endif /** diff --git a/doc/Changelog b/doc/Changelog index 2d1cb04a0..3b138ccee 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +22 March 2021: George + - Fix unused-function warning when compiling with --enable-dnscrypt. + 22 March 2021: Wouter - Merge #449 from orbea: build: Add missing linker flags. - iana portlist update. From 864ac4a6c6fedd16c0697accbe715ec0d9b578f8 Mon Sep 17 00:00:00 2001 From: Alex Band Date: Mon, 22 Mar 2021 14:35:30 +0100 Subject: [PATCH 07/37] Add docs badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3e11ce58c..c8877d1e9 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Travis Build Status](https://travis-ci.org/NLnetLabs/unbound.svg?branch=master)](https://travis-ci.org/NLnetLabs/unbound) [![Packaging status](https://repology.org/badge/tiny-repos/unbound.svg)](https://repology.org/project/unbound/versions) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/unbound.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:unbound) +[![Documentation Status](https://readthedocs.org/projects/unbound/badge/?version=latest)](https://unbound.readthedocs.io/en/latest/?badge=latest) Unbound is a validating, recursive, caching DNS resolver. It is designed to be fast and lean and incorporates modern features based on open standards. If you From e92270bae44a2941a690188a7a666c6cdde29730 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 14:53:05 +0100 Subject: [PATCH 08/37] - Comment out nonworking OSX and IOS travis tests, vm fails to start. --- .travis.yml | 198 +++++++++++++++++++++++++------------------------- doc/Changelog | 1 + 2 files changed, 100 insertions(+), 99 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37ea672b3..19b5602bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,13 +31,13 @@ jobs: arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" - - os: osx - name: Clang on OS X, Amd64 - compiler: clang - arch: amd64 - env: - - TEST_OSX=yes - - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" +# - os: osx +# name: Clang on OS X, Amd64 +# compiler: clang +# arch: amd64 +# env: +# - TEST_OSX=yes +# - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" - os: linux name: Libevent, GCC on Linux, Amd64 compiler: gcc @@ -52,14 +52,14 @@ jobs: env: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" - - os: osx - name: Libevent, Clang on OS X, Amd64 - compiler: clang - arch: amd64 - env: - - TEST_OSX=yes - - TEST_LIBEVENT=yes - - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/" +# - os: osx +# name: Libevent, Clang on OS X, Amd64 +# compiler: clang +# arch: amd64 +# env: +# - TEST_OSX=yes +# - TEST_LIBEVENT=yes +# - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/" - os: linux name: UBsan, GCC on Linux, Amd64 compiler: gcc @@ -130,90 +130,90 @@ jobs: dist: bionic env: - CONFIG_OPTS="--enable-debug --disable-flto" - - os: osx - osx_image: xcode10 - name: Apple iPhone on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=iPhoneOS - - IOS_CPU=armv7s - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: Apple iPhone on iOS, arm64 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=aarch64-apple-ios - - OPENSSL_HOST=ios64-cross - - IOS_SDK=iPhoneOS - - IOS_CPU=arm64 - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: Apple TV on iOS, arm64 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=aarch64-apple-ios - - OPENSSL_HOST=ios64-cross - - IOS_SDK=AppleTVOS - - IOS_CPU=arm64 - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: Apple Watch on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=WatchOS - - IOS_CPU=armv7k - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: iPhoneSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: iPhoneSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: AppleTVSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=AppleTVSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: WatchSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=WatchSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple iPhone on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=iPhoneOS +# - IOS_CPU=armv7s +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple iPhone on iOS, arm64 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=aarch64-apple-ios +# - OPENSSL_HOST=ios64-cross +# - IOS_SDK=iPhoneOS +# - IOS_CPU=arm64 +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple TV on iOS, arm64 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=aarch64-apple-ios +# - OPENSSL_HOST=ios64-cross +# - IOS_SDK=AppleTVOS +# - IOS_CPU=arm64 +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple Watch on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=WatchOS +# - IOS_CPU=armv7k +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: iPhoneSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: iPhoneSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: AppleTVSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=AppleTVSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: WatchSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=WatchSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - os: linux name: Android armv7a, Linux, Amd64 compiler: clang diff --git a/doc/Changelog b/doc/Changelog index 2d1cb04a0..3761d3d46 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 22 March 2021: Wouter - Merge #449 from orbea: build: Add missing linker flags. - iana portlist update. + - Comment out nonworking OSX and IOS travis tests, vm fails to start. 19 March 2021: Wouter - Fix for #447: squelch connection refused tcp connection failures From 574c1fa50a981fd82af75cc7cb22533c162e2b3e Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 15:02:19 +0100 Subject: [PATCH 09/37] - Fix compile error in listen_dnsport on Android. --- doc/Changelog | 1 + services/listen_dnsport.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 71d4d7839..bc2ec6e72 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - Merge #449 from orbea: build: Add missing linker flags. - iana portlist update. - Comment out nonworking OSX and IOS travis tests, vm fails to start. + - Fix compile error in listen_dnsport on Android. 19 March 2021: Wouter - Fix for #447: squelch connection refused tcp connection failures diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index b8c04a3ec..b22beab6e 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -1579,7 +1579,7 @@ int resolve_interface_names(char** ifs, int num_ifs, } *num_resif = num_ifs; for(p = list; p; p = p->next) { - *num_resif ++; + (*num_resif)++; } *resif = calloc(*num_resif, sizeof(**resif)); if(!*resif) { @@ -1600,15 +1600,17 @@ int resolve_interface_names(char** ifs, int num_ifs, } } if(list) { + int idx = num_ifs; for(p = list; p; p = p->next) { - (*resif)[i] = strdup(p->str); - if(!((*resif)[i])) { + (*resif)[idx] = strdup(p->str); + if(!((*resif)[idx])) { log_err("out of memory"); config_del_strarray(*resif, *num_resif); *resif = NULL; *num_resif = 0; return 0; } + idx++; } } return 1; From 6289806f41ab45a76c12381878803bc50f23a463 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 15:29:34 +0100 Subject: [PATCH 10/37] - Fix memory leak reported by asan in rpz SOA record query name. --- doc/Changelog | 1 + services/rpz.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index bc2ec6e72..d83948982 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,7 @@ - iana portlist update. - Comment out nonworking OSX and IOS travis tests, vm fails to start. - Fix compile error in listen_dnsport on Android. + - Fix memory leak reported by asan in rpz SOA record query name. 19 March 2021: Wouter - Fix for #447: squelch connection refused tcp connection failures diff --git a/services/rpz.c b/services/rpz.c index 0c79a0620..3a1ec00d7 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -488,8 +488,10 @@ rpz_insert_qname_trigger(struct rpz* r, uint8_t* dname, size_t dnamelen, rrtype == LDNS_RR_TYPE_NSEC || rrtype == LDNS_RR_TYPE_NSEC3PARAM || rrtype == LDNS_RR_TYPE_NSEC3 || - rrtype == LDNS_RR_TYPE_DS) + rrtype == LDNS_RR_TYPE_DS) { + free(dname); return; /* no need to log these types as unsupported */ + } dname_str(dname, str); verbose(VERB_ALGO, "RPZ: qname trigger, %s skipping unsupported action: %s", str, rpz_action_to_string(a)); From 0d2160ebd19c32f14dc61ed8fc9d360bb0aec93e Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 16:36:46 +0100 Subject: [PATCH 11/37] Travis test for OSX, ASAN results. --- .travis.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19b5602bf..eec2cf272 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ addons: - openssl - libevent - expat - update: true + #update: true jobs: include: @@ -25,19 +25,21 @@ jobs: arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" + - TEST_ENABLED=yes - os: linux name: Clang on Linux, Amd64 compiler: clang arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: osx -# name: Clang on OS X, Amd64 -# compiler: clang -# arch: amd64 -# env: -# - TEST_OSX=yes -# - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" + - os: osx + name: Clang on OS X, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" + - TEST_ENABLED=yes - os: linux name: Libevent, GCC on Linux, Amd64 compiler: gcc @@ -81,6 +83,7 @@ jobs: dist: bionic env: - TEST_ASAN=yes + - TEST_ENABLED=yes - os: linux name: Asan, Clang on Linux, Amd64 compiler: clang @@ -88,6 +91,7 @@ jobs: dist: bionic env: - TEST_ASAN=yes + - TEST_ENABLED=yes - os: linux name: GCC on Linux, Aarch64 compiler: gcc @@ -294,6 +298,7 @@ before_script: # https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs. script: - | + if [ "$TEST_ENABLED" = "yes" ]; then if [ "$TEST_UBSAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" ./configure @@ -342,3 +347,4 @@ script: make test (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi + fi From 50d773436d58810d4ebe12f03ef1e85a37e3b8ae Mon Sep 17 00:00:00 2001 From: George Thessalonikefs Date: Mon, 22 Mar 2021 16:46:17 +0100 Subject: [PATCH 12/37] - Fix for #367: fix memory leak when cannot bind to listening port. --- doc/Changelog | 1 + services/listen_dnsport.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index d83948982..67a53e8f4 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 22 March 2021: George - Fix unused-function warning when compiling with --enable-dnscrypt. + - Fix for #367: fix memory leak when cannot bind to listening port. 22 March 2021: Wouter - Merge #449 from orbea: build: Add missing linker flags. diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index b22beab6e..81a7856eb 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -1166,6 +1166,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1, &noip6, rcv, snd, reuseport, transparent, tcp_mss, nodelay, freebind, use_systemd, dscp, ub_sock)) == -1) { + freeaddrinfo(ub_sock->addr); free(ub_sock); if(noip6) { log_warn("IPv6 protocol not available"); @@ -1176,12 +1177,14 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, /* getting source addr packet info is highly non-portable */ if(!set_recvpktinfo(s, hints->ai_family)) { sock_close(s); + freeaddrinfo(ub_sock->addr); free(ub_sock); return 0; } if(!port_insert(list, s, is_dnscrypt?listen_type_udpancil_dnscrypt:listen_type_udpancil, ub_sock)) { sock_close(s); + freeaddrinfo(ub_sock->addr); free(ub_sock); return 0; } @@ -1193,6 +1196,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1, &noip6, rcv, snd, reuseport, transparent, tcp_mss, nodelay, freebind, use_systemd, dscp, ub_sock)) == -1) { + freeaddrinfo(ub_sock->addr); free(ub_sock); if(noip6) { log_warn("IPv6 protocol not available"); @@ -1203,6 +1207,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, if(!port_insert(list, s, is_dnscrypt?listen_type_udp_dnscrypt:listen_type_udp, ub_sock)) { sock_close(s); + freeaddrinfo(ub_sock->addr); free(ub_sock); return 0; } @@ -1225,6 +1230,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, if((s = make_sock_port(SOCK_STREAM, ifname, port, hints, 1, &noip6, 0, 0, reuseport, transparent, tcp_mss, nodelay, freebind, use_systemd, dscp, ub_sock)) == -1) { + freeaddrinfo(ub_sock->addr); free(ub_sock); if(noip6) { /*log_warn("IPv6 protocol not available");*/ @@ -1236,6 +1242,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, verbose(VERB_ALGO, "setup TCP for SSL service"); if(!port_insert(list, s, port_type, ub_sock)) { sock_close(s); + freeaddrinfo(ub_sock->addr); free(ub_sock); return 0; } From 7d5050c729638b0305553d8a1531755ad186cb0a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 22 Mar 2021 17:02:06 +0100 Subject: [PATCH 13/37] Asan tests shown to work, run OSX test. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eec2cf272..0b1bae9d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,7 +83,6 @@ jobs: dist: bionic env: - TEST_ASAN=yes - - TEST_ENABLED=yes - os: linux name: Asan, Clang on Linux, Amd64 compiler: clang @@ -91,7 +90,6 @@ jobs: dist: bionic env: - TEST_ASAN=yes - - TEST_ENABLED=yes - os: linux name: GCC on Linux, Aarch64 compiler: gcc From a13d935153d01beb12ffb4842f7c5d2cc2f7d956 Mon Sep 17 00:00:00 2001 From: George Thessalonikefs Date: Mon, 22 Mar 2021 18:45:31 +0100 Subject: [PATCH 14/37] - Reformat pythonmod/pythonmod_utils.{c,h}. --- doc/Changelog | 1 + pythonmod/pythonmod_utils.c | 189 ++++++++++++++++++------------------ pythonmod/pythonmod_utils.h | 52 ++++++---- 3 files changed, 129 insertions(+), 113 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 67a53e8f4..dca62e20e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 22 March 2021: George - Fix unused-function warning when compiling with --enable-dnscrypt. - Fix for #367: fix memory leak when cannot bind to listening port. + - Reformat pythonmod/pythonmod_utils.{c,h}. 22 March 2021: Wouter - Merge #449 from orbea: build: Add missing linker flags. diff --git a/pythonmod/pythonmod_utils.c b/pythonmod/pythonmod_utils.c index 9f7282540..21a16bbe8 100644 --- a/pythonmod/pythonmod_utils.c +++ b/pythonmod/pythonmod_utils.c @@ -5,18 +5,18 @@ * Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) * * This software is open source. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * * Neither the name of the organization nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. @@ -56,113 +56,118 @@ #undef _XOPEN_SOURCE #include -/* Store the reply_info and query_info pair in message cache (qstate->msg_cache) */ -int storeQueryInCache(struct module_qstate* qstate, struct query_info* qinfo, struct reply_info* msgrep, int is_referral) +/* Store the reply_info and query_info pair in message cache + * (qstate->msg_cache) */ +int storeQueryInCache(struct module_qstate* qstate, struct query_info* qinfo, + struct reply_info* msgrep, int is_referral) { - if (!msgrep) - return 0; + if (!msgrep) + return 0; - if (msgrep->authoritative) /*authoritative answer can't be stored in cache*/ - { - PyErr_SetString(PyExc_ValueError, "Authoritative answer can't be stored"); - return 0; - } + /* authoritative answer can't be stored in cache */ + if (msgrep->authoritative) { + PyErr_SetString(PyExc_ValueError, + "Authoritative answer can't be stored"); + return 0; + } - return dns_cache_store(qstate->env, qinfo, msgrep, is_referral, - qstate->prefetch_leeway, 0, NULL, qstate->query_flags); + return dns_cache_store(qstate->env, qinfo, msgrep, is_referral, + qstate->prefetch_leeway, 0, NULL, qstate->query_flags); } -/* Invalidate the message associated with query_info stored in message cache */ -void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qinfo) -{ - hashvalue_type h; - struct lruhash_entry* e; - struct reply_info *r; - size_t i, j; +/* Invalidate the message associated with query_info stored in message cache */ +void invalidateQueryInCache(struct module_qstate* qstate, + struct query_info* qinfo) +{ + hashvalue_type h; + struct lruhash_entry* e; + struct reply_info *r; + size_t i, j; - h = query_info_hash(qinfo, qstate->query_flags); - if ((e=slabhash_lookup(qstate->env->msg_cache, h, qinfo, 0))) - { - r = (struct reply_info*)(e->data); - if (r) - { - r->ttl = 0; - if(rrset_array_lock(r->ref, r->rrset_count, *qstate->env->now)) { - for(i=0; i< r->rrset_count; i++) - { - struct packed_rrset_data* data = - (struct packed_rrset_data*) r->ref[i].key->entry.data; - if(i>0 && r->ref[i].key == r->ref[i-1].key) - continue; - - data->ttl = r->ttl; - for(j=0; jcount + data->rrsig_count; j++) - data->rr_ttl[j] = r->ttl; - } - rrset_array_unlock(r->ref, r->rrset_count); - } + h = query_info_hash(qinfo, qstate->query_flags); + if ((e=slabhash_lookup(qstate->env->msg_cache, h, qinfo, 0))) { + r = (struct reply_info*)(e->data); + if (r) { + r->ttl = 0; + if(rrset_array_lock(r->ref, r->rrset_count, *qstate->env->now)) { + for(i=0; i< r->rrset_count; i++) { + struct packed_rrset_data* data = + (struct packed_rrset_data*) r->ref[i].key->entry.data; + if(i>0 && r->ref[i].key == r->ref[i-1].key) + continue; + + data->ttl = r->ttl; + for(j=0; jcount + data->rrsig_count; j++) + data->rr_ttl[j] = r->ttl; + } + rrset_array_unlock(r->ref, r->rrset_count); + } + } + lock_rw_unlock(&e->lock); + } else { + log_info("invalidateQueryInCache: qinfo is not in cache"); } - lock_rw_unlock(&e->lock); - } else { - log_info("invalidateQueryInCache: qinfo is not in cache"); - } } /* Create response according to the ldns packet content */ int createResponse(struct module_qstate* qstate, sldns_buffer* pkt) { - struct msg_parse* prs; - struct edns_data edns; - - /* parse message */ - prs = (struct msg_parse*) regional_alloc(qstate->env->scratch, sizeof(struct msg_parse)); - if (!prs) { - log_err("storeResponse: out of memory on incoming message"); - return 0; - } + struct msg_parse* prs; + struct edns_data edns; - memset(prs, 0, sizeof(*prs)); - memset(&edns, 0, sizeof(edns)); + /* parse message */ + prs = (struct msg_parse*) regional_alloc(qstate->env->scratch, + sizeof(struct msg_parse)); + if(!prs) { + log_err("createResponse: out of memory on incoming message"); + return 0; + } - sldns_buffer_set_position(pkt, 0); - if (parse_packet(pkt, prs, qstate->env->scratch) != LDNS_RCODE_NOERROR) { - verbose(VERB_ALGO, "storeResponse: parse error on reply packet"); - return 0; - } - /* edns is not examined, but removed from message to help cache */ - if(parse_extract_edns(prs, &edns, qstate->env->scratch) != - LDNS_RCODE_NOERROR) - return 0; + memset(prs, 0, sizeof(*prs)); + memset(&edns, 0, sizeof(edns)); - /* remove CD-bit, we asked for in case we handle validation ourself */ - prs->flags &= ~BIT_CD; + sldns_buffer_set_position(pkt, 0); + if(parse_packet(pkt, prs, qstate->env->scratch) != LDNS_RCODE_NOERROR) { + verbose(VERB_ALGO, "createResponse: parse error on reply packet"); + return 0; + } + /* edns is not examined, but removed from message to help cache */ + if(parse_extract_edns(prs, &edns, qstate->env->scratch) != + LDNS_RCODE_NOERROR) + return 0; - /* allocate response dns_msg in region */ - qstate->return_msg = (struct dns_msg*)regional_alloc(qstate->region, sizeof(struct dns_msg)); - if (!qstate->return_msg) - return 0; + /* remove CD-bit, we asked for in case we handle validation ourself */ + prs->flags &= ~BIT_CD; - memset(qstate->return_msg, 0, sizeof(*qstate->return_msg)); - if(!parse_create_msg(pkt, prs, NULL, &(qstate->return_msg)->qinfo, &(qstate->return_msg)->rep, qstate->region)) { - log_err("storeResponse: malloc failure: allocating incoming dns_msg"); - return 0; - } - - /* Make sure that the RA flag is set (since the presence of - * this module means that recursion is available) */ - /* qstate->return_msg->rep->flags |= BIT_RA; */ + /* allocate response dns_msg in region */ + qstate->return_msg = (struct dns_msg*) regional_alloc(qstate->region, + sizeof(struct dns_msg)); + if(!qstate->return_msg) + return 0; - /* Clear the AA flag */ - /* FIXME: does this action go here or in some other module? */ - /*qstate->return_msg->rep->flags &= ~BIT_AA; */ + memset(qstate->return_msg, 0, sizeof(*qstate->return_msg)); + if(!parse_create_msg(pkt, prs, NULL, &(qstate->return_msg)->qinfo, + &(qstate->return_msg)->rep, qstate->region)) { + log_err("createResponse: malloc failure: allocating incoming dns_msg"); + return 0; + } - /* make sure QR flag is on */ - /*qstate->return_msg->rep->flags |= BIT_QR; */ + /* Make sure that the RA flag is set (since the presence of + * this module means that recursion is available) */ + /* qstate->return_msg->rep->flags |= BIT_RA; */ - if(verbosity >= VERB_ALGO) - log_dns_msg("storeResponse: packet:", &qstate->return_msg->qinfo, qstate->return_msg->rep); + /* Clear the AA flag */ + /* FIXME: does this action go here or in some other module? */ + /*qstate->return_msg->rep->flags &= ~BIT_AA; */ - return 1; + /* make sure QR flag is on */ + /*qstate->return_msg->rep->flags |= BIT_QR; */ + + if(verbosity >= VERB_ALGO) + log_dns_msg("createResponse: packet:", &qstate->return_msg->qinfo, + qstate->return_msg->rep); + + return 1; } @@ -176,7 +181,7 @@ void reply_addr2str(struct comm_reply* reply, char* dest, int maxlen) sinaddr = &((struct sockaddr_in6*)&(reply->addr))->sin6_addr; dest[0] = 0; if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0) - return; + return; dest[maxlen-1] = 0; } @@ -190,6 +195,6 @@ void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen) sinaddr = &((struct sockaddr_in6*)&(target->addr))->sin6_addr; dest[0] = 0; if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0) - return; + return; dest[maxlen-1] = 0; } diff --git a/pythonmod/pythonmod_utils.h b/pythonmod/pythonmod_utils.h index 4ea86f9be..3fb0c0d7f 100644 --- a/pythonmod/pythonmod_utils.h +++ b/pythonmod/pythonmod_utils.h @@ -1,22 +1,22 @@ /* * pythonmod_utils.h: utils header file - * + * * Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz) * Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) * * This software is open source. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * * Neither the name of the organization nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. @@ -46,34 +46,38 @@ struct delegpt_addr; struct sldns_buffer; /** - * Store the reply_info and query_info pair in message cache (qstate->msg_cache) + * Store the reply_info and query_info pair in message cache + * (qstate->msg_cache). * * @param qstate: module environment * @param qinfo: query info, the query for which answer is stored. * @param msgrep: reply in dns_msg * @param is_referral: If true, then the given message to be stored is a - * referral. The cache implementation may use this as a hint. - * It will store only the RRsets, not the message. + * referral. The cache implementation may use this as a hint. + * It will store only the RRsets, not the message. * @return 0 on alloc error (out of memory). */ -int storeQueryInCache(struct module_qstate* qstate, struct query_info* qinfo, struct reply_info* msgrep, int is_referral); +int storeQueryInCache(struct module_qstate* qstate, struct query_info* qinfo, + struct reply_info* msgrep, int is_referral); /** - * Invalidate the message associated with query_info stored in message cache. + * Invalidate the message associated with query_info stored in message cache. * - * This function invalidates the record in message cache associated with the given query only if such a record exists. + * This function invalidates the record in message cache associated with the + * given query only if such a record exists. * * @param qstate: module environment * @param qinfo: query info, the query for which answer is stored. */ -void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qinfo); +void invalidateQueryInCache(struct module_qstate* qstate, + struct query_info* qinfo); /** - * Create response according to the ldns packet content + * Create response according to the ldns packet content. + * + * This function fills qstate.return_msg up with data of a given packet * - * This function fills qstate.return_msg up with data of a given packet - * * @param qstate: module environment * @param pkt: a sldns_buffer which contains sldns_packet data * @return 0 on failure, out of memory or parse error. @@ -81,14 +85,20 @@ void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qin int createResponse(struct module_qstate* qstate, struct sldns_buffer* pkt); /** - * Convert reply->addr to string - * @param reply: comm reply with address in it. - * @param dest: destination string. - * @param maxlen: length of string buffer. + * Convert reply->addr to string. + * @param reply: comm reply with address in it. + * @param dest: destination string. + * @param maxlen: length of string buffer. */ void reply_addr2str(struct comm_reply* reply, char* dest, int maxlen); -/* Convert target->addr to string */ -void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen); +/** + * Convert target->addr to string. + * @param target: delegpt_addr with address in it. + * @param dest: destination string. + * @param maxlen: length of string buffer. + */ +void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, + int maxlen); #endif /* PYTHONMOD_UTILS_H */ From 6e8fdd8650c6b74a2b4f0af8537ef2a43f05471d Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 08:56:42 +0100 Subject: [PATCH 15/37] Travis enable all tests again. Clang analyzer only a couple times, when there is a difference. homebrew updates disabled, so it does not hang. removed trailing slashes from configure paths. Moved iOS tests to allow-failure. --- .travis.yml | 220 ++++++++++++++++++++++++++++------------------------ 1 file changed, 120 insertions(+), 100 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b1bae9d8..8931dd0d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ addons: - openssl - libevent - expat + #homebrew hangs when updates are enabled. So it is kept off. #update: true jobs: @@ -25,21 +26,21 @@ jobs: arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" - - TEST_ENABLED=yes - os: linux name: Clang on Linux, Amd64 compiler: clang arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" + - TEST_ANALYZER=yes - os: osx name: Clang on OS X, Amd64 compiler: clang arch: amd64 env: - TEST_OSX=yes - - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" - - TEST_ENABLED=yes + - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl" + - TEST_ANALYZER=yes - os: linux name: Libevent, GCC on Linux, Amd64 compiler: gcc @@ -54,14 +55,15 @@ jobs: env: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" -# - os: osx -# name: Libevent, Clang on OS X, Amd64 -# compiler: clang -# arch: amd64 -# env: -# - TEST_OSX=yes -# - TEST_LIBEVENT=yes -# - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/" + - TEST_ANALYZER=yes + - os: osx + name: Libevent, Clang on OS X, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent" - os: linux name: UBsan, GCC on Linux, Amd64 compiler: gcc @@ -132,90 +134,90 @@ jobs: dist: bionic env: - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: osx -# osx_image: xcode10 -# name: Apple iPhone on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=iPhoneOS -# - IOS_CPU=armv7s -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: Apple iPhone on iOS, arm64 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=aarch64-apple-ios -# - OPENSSL_HOST=ios64-cross -# - IOS_SDK=iPhoneOS -# - IOS_CPU=arm64 -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: Apple TV on iOS, arm64 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=aarch64-apple-ios -# - OPENSSL_HOST=ios64-cross -# - IOS_SDK=AppleTVOS -# - IOS_CPU=arm64 -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: Apple Watch on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=WatchOS -# - IOS_CPU=armv7k -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: iPhoneSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: iPhoneSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: AppleTVSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=AppleTVSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - os: osx -# osx_image: xcode10 -# name: WatchSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=WatchSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple iPhone on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=armv7s + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple iPhone on iOS, arm64 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=aarch64-apple-ios + - OPENSSL_HOST=ios64-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=arm64 + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple TV on iOS, arm64 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=aarch64-apple-ios + - OPENSSL_HOST=ios64-cross + - IOS_SDK=AppleTVOS + - IOS_CPU=arm64 + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple Watch on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=WatchOS + - IOS_CPU=armv7k + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: iPhoneSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: iPhoneSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: AppleTVSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=AppleTVSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: WatchSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=WatchSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - os: linux name: Android armv7a, Linux, Amd64 compiler: clang @@ -274,6 +276,22 @@ jobs: - ANDROID_NDK_ROOT="$HOME/android-ndk" allow_failures: + - os: osx + name: Apple iPhone on iOS, armv7 + - os: osx + name: Apple iPhone on iOS, arm64 + - os: osx + name: Apple TV on iOS, arm64 + - os: osx + name: Apple Watch on iOS, armv7 + - os: osx + name: iPhoneSimulator on OS X, i386 + - os: osx + name: iPhoneSimulator on OS X, x86_64 + - os: osx + name: AppleTVSimulator on OS X, x86_64 + - os: osx + name: WatchSimulator on OS X, i386 - os: linux name: Android armv7a, Linux, Amd64 - os: linux @@ -296,7 +314,6 @@ before_script: # https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs. script: - | - if [ "$TEST_ENABLED" = "yes" ]; then if [ "$TEST_UBSAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" ./configure @@ -335,14 +352,17 @@ script: make -j 2 make install elif [ "$TEST_OSX" = "yes" ]; then - ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/ + ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl make -j 2 make test - (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + if [ "$TEST_ANALYZER" = "yes" ]; then + (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + fi else ./configure ${CONFIG_OPTS} make -j 2 make test - (cd testdata/clang-analysis.tdir; bash clang-analysis.test) - fi + if [ "$TEST_ANALYZER" = "yes" ]; then + (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + fi fi From 0b7efaf620fd115f8bbfb5e8e3d5557e8d635776 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 09:17:22 +0100 Subject: [PATCH 16/37] Travis changelog noted. --- .travis.yml | 6 +++--- doc/Changelog | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8931dd0d6..9429b5cda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,14 +27,14 @@ jobs: env: - CONFIG_OPTS="--enable-debug --disable-flto" - os: linux - name: Clang on Linux, Amd64 + name: Clang on Linux, Amd64, clang-analysis compiler: clang arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" - TEST_ANALYZER=yes - os: osx - name: Clang on OS X, Amd64 + name: Clang on OS X, Amd64, clang-analysis compiler: clang arch: amd64 env: @@ -49,7 +49,7 @@ jobs: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" - os: linux - name: Libevent, Clang on Linux, Amd64 + name: Libevent, Clang on Linux, Amd64, clang-analysis compiler: clang arch: amd64 env: diff --git a/doc/Changelog b/doc/Changelog index dca62e20e..94bd8747d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,9 @@ +23 March 2021: Wouter + - Travis enable all tests again. Clang analyzer only a couple times, + when there is a difference. homebrew updates disabled, so it does + not hang. removed trailing slashes from configure paths. Moved iOS + tests to allow-failure. + 22 March 2021: George - Fix unused-function warning when compiling with --enable-dnscrypt. - Fix for #367: fix memory leak when cannot bind to listening port. From 85f8d72a894dd1eff375a00155f1344e95f7433b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 09:29:11 +0100 Subject: [PATCH 17/37] Travis, attempt to omit ios brew update. --- contrib/ios/install_tools.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/ios/install_tools.sh b/contrib/ios/install_tools.sh index 55fef454e..93c730a4d 100755 --- a/contrib/ios/install_tools.sh +++ b/contrib/ios/install_tools.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash # This step should install tools needed for all packages - OpenSSL, Expat and Unbound -echo "Updating tools" -brew update 1>/dev/null +# brew update hangs, so we try to skip that step. +#echo "Updating tools" +#brew update 1>/dev/null echo "Installing tools" # already installed are: autoconf automake libtool pkg-config brew install curl perl 1>/dev/null From b5ee27f810dc1b84a2ca1987ad04d80f3b05d2e5 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 13:38:46 +0100 Subject: [PATCH 18/37] travis, analyzer disabled on test without debug, that does not run anway. Turn off failing tests except one. Update iOS test to xcode image 12.2. --- .travis.yml | 179 ++++++++++++++++++++++++++-------------------------- 1 file changed, 89 insertions(+), 90 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9429b5cda..765dc6eb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,13 +49,12 @@ jobs: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" - os: linux - name: Libevent, Clang on Linux, Amd64, clang-analysis + name: Libevent, Clang on Linux, Amd64 compiler: clang arch: amd64 env: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" - - TEST_ANALYZER=yes - os: osx name: Libevent, Clang on OS X, Amd64 compiler: clang @@ -134,19 +133,19 @@ jobs: dist: bionic env: - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: osx +# osx_image: xcode10 +# name: Apple iPhone on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=iPhoneOS +# - IOS_CPU=armv7s +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - os: osx - osx_image: xcode10 - name: Apple iPhone on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=iPhoneOS - - IOS_CPU=armv7s - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 + osx_image: xcode12.2 name: Apple iPhone on iOS, arm64 compiler: clang env: @@ -156,68 +155,68 @@ jobs: - IOS_SDK=iPhoneOS - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: Apple TV on iOS, arm64 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=aarch64-apple-ios - - OPENSSL_HOST=ios64-cross - - IOS_SDK=AppleTVOS - - IOS_CPU=arm64 - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: Apple Watch on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=WatchOS - - IOS_CPU=armv7k - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: iPhoneSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: iPhoneSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: AppleTVSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=AppleTVSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - os: osx - osx_image: xcode10 - name: WatchSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=WatchSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple TV on iOS, arm64 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=aarch64-apple-ios +# - OPENSSL_HOST=ios64-cross +# - IOS_SDK=AppleTVOS +# - IOS_CPU=arm64 +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: Apple Watch on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=WatchOS +# - IOS_CPU=armv7k +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: iPhoneSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: iPhoneSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: AppleTVSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=AppleTVSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - os: osx +# osx_image: xcode10 +# name: WatchSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=WatchSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - os: linux name: Android armv7a, Linux, Amd64 compiler: clang @@ -276,22 +275,22 @@ jobs: - ANDROID_NDK_ROOT="$HOME/android-ndk" allow_failures: - - os: osx - name: Apple iPhone on iOS, armv7 +# - os: osx +# name: Apple iPhone on iOS, armv7 - os: osx name: Apple iPhone on iOS, arm64 - - os: osx - name: Apple TV on iOS, arm64 - - os: osx - name: Apple Watch on iOS, armv7 - - os: osx - name: iPhoneSimulator on OS X, i386 - - os: osx - name: iPhoneSimulator on OS X, x86_64 - - os: osx - name: AppleTVSimulator on OS X, x86_64 - - os: osx - name: WatchSimulator on OS X, i386 +# - os: osx +# name: Apple TV on iOS, arm64 +# - os: osx +# name: Apple Watch on iOS, armv7 +# - os: osx +# name: iPhoneSimulator on OS X, i386 +# - os: osx +# name: iPhoneSimulator on OS X, x86_64 +# - os: osx +# name: AppleTVSimulator on OS X, x86_64 +# - os: osx +# name: WatchSimulator on OS X, i386 - os: linux name: Android armv7a, Linux, Amd64 - os: linux From 61e6a3910f7e009b06912018f52078d2813e68b1 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 14:22:00 +0100 Subject: [PATCH 19/37] Travis, note changelog, disable homebrew update in script and cfg. --- .travis.yml | 1 + contrib/ios/install_tools.sh | 3 ++- doc/Changelog | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 765dc6eb1..301420005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -155,6 +155,7 @@ jobs: - IOS_SDK=iPhoneOS - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: Apple TV on iOS, arm64 diff --git a/contrib/ios/install_tools.sh b/contrib/ios/install_tools.sh index 93c730a4d..e2f381425 100755 --- a/contrib/ios/install_tools.sh +++ b/contrib/ios/install_tools.sh @@ -6,4 +6,5 @@ #brew update 1>/dev/null echo "Installing tools" # already installed are: autoconf automake libtool pkg-config -brew install curl perl 1>/dev/null +#brew install curl perl 1>/dev/null +HOMEBREW_NO_AUTO_UPDATE=1 brew install curl perl 1>/dev/null diff --git a/doc/Changelog b/doc/Changelog index 94bd8747d..7076ec13d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,9 @@ when there is a difference. homebrew updates disabled, so it does not hang. removed trailing slashes from configure paths. Moved iOS tests to allow-failure. + - travis, analyzer disabled on test without debug, that does not + run anway. Turn off failing tests except one. Update iOS test + to xcode image 12.2. 22 March 2021: George - Fix unused-function warning when compiling with --enable-dnscrypt. From 26bf371e95dfc01238d31e35392f86f47d8734e3 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 14:45:14 +0100 Subject: [PATCH 20/37] Travis, try to enable brew update for the 12.2 osx image. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 301420005..15d8ea0c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,7 @@ addons: - openssl - libevent - expat - #homebrew hangs when updates are enabled. So it is kept off. - #update: true + update: true jobs: include: @@ -155,7 +154,6 @@ jobs: - IOS_SDK=iPhoneOS - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: Apple TV on iOS, arm64 From f11d99b6dcbbbe3eebb8eac4be7af7d7b7f3fa39 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 16:03:58 +0100 Subject: [PATCH 21/37] Travis, turn off homebrew update, and move to 12.2 for OSX compile. --- .travis.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 15d8ea0c5..3ef0867e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,8 @@ addons: - openssl - libevent - expat - update: true + # homebrew update takes 20min or hangs, so disable update + #update: true jobs: include: @@ -33,6 +34,7 @@ jobs: - CONFIG_OPTS="--enable-debug --disable-flto" - TEST_ANALYZER=yes - os: osx + osx_image: xcode12.2 name: Clang on OS X, Amd64, clang-analysis compiler: clang arch: amd64 @@ -40,6 +42,7 @@ jobs: - TEST_OSX=yes - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl" - TEST_ANALYZER=yes + - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: Libevent, GCC on Linux, Amd64 compiler: gcc @@ -55,6 +58,7 @@ jobs: - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-libevent" - os: osx + osx_image: xcode12.2 name: Libevent, Clang on OS X, Amd64 compiler: clang arch: amd64 @@ -62,6 +66,7 @@ jobs: - TEST_OSX=yes - TEST_LIBEVENT=yes - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent" + - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: UBsan, GCC on Linux, Amd64 compiler: gcc @@ -143,6 +148,7 @@ jobs: # - IOS_SDK=iPhoneOS # - IOS_CPU=armv7s # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 - os: osx osx_image: xcode12.2 name: Apple iPhone on iOS, arm64 @@ -154,6 +160,7 @@ jobs: - IOS_SDK=iPhoneOS - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: Apple TV on iOS, arm64 @@ -165,6 +172,7 @@ jobs: # - IOS_SDK=AppleTVOS # - IOS_CPU=arm64 # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: Apple Watch on iOS, armv7 @@ -176,6 +184,7 @@ jobs: # - IOS_SDK=WatchOS # - IOS_CPU=armv7k # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: iPhoneSimulator on OS X, i386 @@ -186,6 +195,7 @@ jobs: # - IOS_CPU=i386 # - IOS_SDK=iPhoneSimulator # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: iPhoneSimulator on OS X, x86_64 @@ -196,6 +206,7 @@ jobs: # - IOS_CPU=x86_64 # - IOS_SDK=iPhoneSimulator # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: AppleTVSimulator on OS X, x86_64 @@ -206,6 +217,7 @@ jobs: # - IOS_CPU=x86_64 # - IOS_SDK=AppleTVSimulator # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 # - os: osx # osx_image: xcode10 # name: WatchSimulator on OS X, i386 @@ -216,6 +228,7 @@ jobs: # - IOS_CPU=i386 # - IOS_SDK=WatchSimulator # - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: Android armv7a, Linux, Amd64 compiler: clang From 1af851e7911cb3d87dc2e816e475d89f4766809a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 16:27:49 +0100 Subject: [PATCH 22/37] Travis, fix location of libexpat, stop on error. --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ef0867e2..b6f62223e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ jobs: arch: amd64 env: - TEST_OSX=yes - - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl" + - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat" - TEST_ANALYZER=yes - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux @@ -65,7 +65,7 @@ jobs: env: - TEST_OSX=yes - TEST_LIBEVENT=yes - - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent" + - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: UBsan, GCC on Linux, Amd64 @@ -327,13 +327,13 @@ script: - | if [ "$TEST_UBSAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" - ./configure - make -j 2 + ./configure && \ + make -j 2 && \ make test elif [ "$TEST_ASAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" - ./configure - make -j 2 + ./configure && \ + make -j 2 && \ make test elif [ "$TEST_IOS" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" @@ -345,8 +345,8 @@ script: --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ --prefix="$IOS_PREFIX" \ --with-ssl="$IOS_PREFIX" --disable-gost \ - --with-libexpat="$IOS_PREFIX"; - make -j 2 + --with-libexpat="$IOS_PREFIX"; && \ + make -j 2 && \ make install elif [ "$TEST_ANDROID" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" @@ -359,20 +359,20 @@ script: --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ --prefix="$ANDROID_PREFIX" \ --with-ssl="$ANDROID_PREFIX" --disable-gost \ - --with-libexpat="$ANDROID_PREFIX"; - make -j 2 + --with-libexpat="$ANDROID_PREFIX"; && \ + make -j 2 && \ make install elif [ "$TEST_OSX" = "yes" ]; then - ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl - make -j 2 - make test + ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl && \ + make -j 2 && \ + make test && \ if [ "$TEST_ANALYZER" = "yes" ]; then (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi else - ./configure ${CONFIG_OPTS} - make -j 2 - make test + ./configure ${CONFIG_OPTS} && \ + make -j 2 && \ + make test && \ if [ "$TEST_ANALYZER" = "yes" ]; then (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi From 0894f059a10b445f06ba398050931e7d2c1ee5f8 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 16:34:56 +0100 Subject: [PATCH 23/37] Travis, undo the && code and enable other iOS jobs. --- .travis.yml | 216 ++++++++++++++++++++++++++-------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6f62223e..cc2937d20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -137,18 +137,18 @@ jobs: dist: bionic env: - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: osx -# osx_image: xcode10 -# name: Apple iPhone on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=iPhoneOS -# - IOS_CPU=armv7s -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: Apple iPhone on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=armv7s + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 - os: osx osx_image: xcode12.2 name: Apple iPhone on iOS, arm64 @@ -161,74 +161,74 @@ jobs: - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: Apple TV on iOS, arm64 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=aarch64-apple-ios -# - OPENSSL_HOST=ios64-cross -# - IOS_SDK=AppleTVOS -# - IOS_CPU=arm64 -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: Apple Watch on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=WatchOS -# - IOS_CPU=armv7k -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: iPhoneSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: iPhoneSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: AppleTVSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=AppleTVSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode10 -# name: WatchSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=WatchSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: Apple TV on iOS, arm64 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=aarch64-apple-ios + - OPENSSL_HOST=ios64-cross + - IOS_SDK=AppleTVOS + - IOS_CPU=arm64 + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: Apple Watch on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=WatchOS + - IOS_CPU=armv7k + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: iPhoneSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: iPhoneSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: AppleTVSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=AppleTVSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: WatchSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=WatchSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: Android armv7a, Linux, Amd64 compiler: clang @@ -287,22 +287,22 @@ jobs: - ANDROID_NDK_ROOT="$HOME/android-ndk" allow_failures: -# - os: osx -# name: Apple iPhone on iOS, armv7 + - os: osx + name: Apple iPhone on iOS, armv7 - os: osx name: Apple iPhone on iOS, arm64 -# - os: osx -# name: Apple TV on iOS, arm64 -# - os: osx -# name: Apple Watch on iOS, armv7 -# - os: osx -# name: iPhoneSimulator on OS X, i386 -# - os: osx -# name: iPhoneSimulator on OS X, x86_64 -# - os: osx -# name: AppleTVSimulator on OS X, x86_64 -# - os: osx -# name: WatchSimulator on OS X, i386 + - os: osx + name: Apple TV on iOS, arm64 + - os: osx + name: Apple Watch on iOS, armv7 + - os: osx + name: iPhoneSimulator on OS X, i386 + - os: osx + name: iPhoneSimulator on OS X, x86_64 + - os: osx + name: AppleTVSimulator on OS X, x86_64 + - os: osx + name: WatchSimulator on OS X, i386 - os: linux name: Android armv7a, Linux, Amd64 - os: linux @@ -327,13 +327,13 @@ script: - | if [ "$TEST_UBSAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" - ./configure && \ - make -j 2 && \ + ./configure + make -j 2 make test elif [ "$TEST_ASAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" - ./configure && \ - make -j 2 && \ + ./configure + make -j 2 make test elif [ "$TEST_IOS" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" @@ -345,8 +345,8 @@ script: --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ --prefix="$IOS_PREFIX" \ --with-ssl="$IOS_PREFIX" --disable-gost \ - --with-libexpat="$IOS_PREFIX"; && \ - make -j 2 && \ + --with-libexpat="$IOS_PREFIX"; + make -j 2 make install elif [ "$TEST_ANDROID" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" @@ -359,20 +359,20 @@ script: --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ --prefix="$ANDROID_PREFIX" \ --with-ssl="$ANDROID_PREFIX" --disable-gost \ - --with-libexpat="$ANDROID_PREFIX"; && \ - make -j 2 && \ + --with-libexpat="$ANDROID_PREFIX"; + make -j 2 make install elif [ "$TEST_OSX" = "yes" ]; then - ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl && \ - make -j 2 && \ - make test && \ + ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl + make -j 2 + make test if [ "$TEST_ANALYZER" = "yes" ]; then (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi else - ./configure ${CONFIG_OPTS} && \ - make -j 2 && \ - make test && \ + ./configure ${CONFIG_OPTS} + make -j 2 + make test if [ "$TEST_ANALYZER" = "yes" ]; then (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi From 0e1d64de940fbdab104dd5f497a2ecdfb6e99cfc Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Mar 2021 16:51:50 +0100 Subject: [PATCH 24/37] Travis, use config opts when testing on OSX. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc2937d20..03af21f7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ jobs: env: - TEST_OSX=yes - TEST_LIBEVENT=yes - - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" + - CONFIG_OPTS="--disable-flto --with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" - HOMEBREW_NO_AUTO_UPDATE=1 - os: linux name: UBsan, GCC on Linux, Amd64 @@ -363,7 +363,7 @@ script: make -j 2 make install elif [ "$TEST_OSX" = "yes" ]; then - ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl + ./configure ${CONFIG_OPTS} make -j 2 make test if [ "$TEST_ANALYZER" = "yes" ]; then From d56a1c38bc28bc19018cf9aaf8554904ef045b13 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 09:57:53 +0100 Subject: [PATCH 25/37] Travis, test deprecation configure output. Debug output from configure and remove a lot of timeconsuming tests temporarily. --- .travis.yml | 510 +++++++++++++++++++++++------------------------ acx_nlnetlabs.m4 | 4 + configure | 4 + 3 files changed, 263 insertions(+), 255 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03af21f7e..de8211717 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,129 +26,129 @@ jobs: arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: Clang on Linux, Amd64, clang-analysis - compiler: clang - arch: amd64 - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - TEST_ANALYZER=yes - - os: osx - osx_image: xcode12.2 - name: Clang on OS X, Amd64, clang-analysis - compiler: clang - arch: amd64 - env: - - TEST_OSX=yes - - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat" - - TEST_ANALYZER=yes - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: linux - name: Libevent, GCC on Linux, Amd64 - compiler: gcc - arch: amd64 - env: - - TEST_LIBEVENT=yes - - CONFIG_OPTS="--with-libevent" - - os: linux - name: Libevent, Clang on Linux, Amd64 - compiler: clang - arch: amd64 - env: - - TEST_LIBEVENT=yes - - CONFIG_OPTS="--with-libevent" - - os: osx - osx_image: xcode12.2 - name: Libevent, Clang on OS X, Amd64 - compiler: clang - arch: amd64 - env: - - TEST_OSX=yes - - TEST_LIBEVENT=yes - - CONFIG_OPTS="--disable-flto --with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: linux - name: UBsan, GCC on Linux, Amd64 - compiler: gcc - arch: amd64 - dist: bionic - env: - - TEST_UBSAN=yes - - os: linux - name: UBsan, Clang on Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_UBSAN=yes - - os: linux - name: Asan, GCC on Linux, Amd64 - compiler: gcc - arch: amd64 - dist: bionic - env: - - TEST_ASAN=yes - - os: linux - name: Asan, Clang on Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_ASAN=yes - - os: linux - name: GCC on Linux, Aarch64 - compiler: gcc - arch: arm64 - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: Clang on Linux, Aarch64 - compiler: clang - arch: arm64 - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: GCC on Linux, PowerPC64 - compiler: gcc - arch: ppc64le - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: Clang on Linux, PowerPC64 - compiler: clang - arch: ppc64le - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: GCC on Linux, s390x - compiler: gcc - arch: s390x - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: linux - name: Clang on Linux, s390x - compiler: clang - arch: s390x - dist: bionic - env: - - CONFIG_OPTS="--enable-debug --disable-flto" - - os: osx - osx_image: xcode12.2 - name: Apple iPhone on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=iPhoneOS - - IOS_CPU=armv7s - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: linux +# name: Clang on Linux, Amd64, clang-analysis +# compiler: clang +# arch: amd64 +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - TEST_ANALYZER=yes +# - os: osx +# osx_image: xcode12.2 +# name: Clang on OS X, Amd64, clang-analysis +# compiler: clang +# arch: amd64 +# env: +# - TEST_OSX=yes +# - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat" +# - TEST_ANALYZER=yes +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: linux +# name: Libevent, GCC on Linux, Amd64 +# compiler: gcc +# arch: amd64 +# env: +# - TEST_LIBEVENT=yes +# - CONFIG_OPTS="--with-libevent" +# - os: linux +# name: Libevent, Clang on Linux, Amd64 +# compiler: clang +# arch: amd64 +# env: +# - TEST_LIBEVENT=yes +# - CONFIG_OPTS="--with-libevent" +# - os: osx +# osx_image: xcode12.2 +# name: Libevent, Clang on OS X, Amd64 +# compiler: clang +# arch: amd64 +# env: +# - TEST_OSX=yes +# - TEST_LIBEVENT=yes +# - CONFIG_OPTS="--disable-flto --with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: linux +# name: UBsan, GCC on Linux, Amd64 +# compiler: gcc +# arch: amd64 +# dist: bionic +# env: +# - TEST_UBSAN=yes +# - os: linux +# name: UBsan, Clang on Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_UBSAN=yes +# - os: linux +# name: Asan, GCC on Linux, Amd64 +# compiler: gcc +# arch: amd64 +# dist: bionic +# env: +# - TEST_ASAN=yes +# - os: linux +# name: Asan, Clang on Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_ASAN=yes +# - os: linux +# name: GCC on Linux, Aarch64 +# compiler: gcc +# arch: arm64 +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: linux +# name: Clang on Linux, Aarch64 +# compiler: clang +# arch: arm64 +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: linux +# name: GCC on Linux, PowerPC64 +# compiler: gcc +# arch: ppc64le +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: linux +# name: Clang on Linux, PowerPC64 +# compiler: clang +# arch: ppc64le +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: linux +# name: GCC on Linux, s390x +# compiler: gcc +# arch: s390x +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: linux +# name: Clang on Linux, s390x +# compiler: clang +# arch: s390x +# dist: bionic +# env: +# - CONFIG_OPTS="--enable-debug --disable-flto" +# - os: osx +# osx_image: xcode12.2 +# name: Apple iPhone on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=iPhoneOS +# - IOS_CPU=armv7s +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 - os: osx osx_image: xcode12.2 name: Apple iPhone on iOS, arm64 @@ -173,144 +173,144 @@ jobs: - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - HOMEBREW_NO_AUTO_UPDATE=1 - - os: osx - osx_image: xcode12.2 - name: Apple Watch on iOS, armv7 - compiler: clang - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=armv7-apple-ios - - OPENSSL_HOST=ios-cross - - IOS_SDK=WatchOS - - IOS_CPU=armv7k - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: osx - osx_image: xcode12.2 - name: iPhoneSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: osx - osx_image: xcode12.2 - name: iPhoneSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=iPhoneSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: osx - osx_image: xcode12.2 - name: AppleTVSimulator on OS X, x86_64 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=x86_64-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=x86_64 - - IOS_SDK=AppleTVSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: osx - osx_image: xcode12.2 - name: WatchSimulator on OS X, i386 - env: - - TEST_IOS=yes - - AUTOTOOLS_HOST=i386-apple-ios - - OPENSSL_HOST=iphoneos-cross - - IOS_CPU=i386 - - IOS_SDK=WatchSimulator - - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - - HOMEBREW_NO_AUTO_UPDATE=1 - - os: linux - name: Android armv7a, Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_ANDROID=yes - - AUTOTOOLS_HOST=armv7a-linux-androideabi - - OPENSSL_HOST=android-arm - - ANDROID_CPU=armv7a - - ANDROID_API=23 - - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" - - ANDROID_SDK_ROOT="$HOME/android-sdk" - - ANDROID_NDK_ROOT="$HOME/android-ndk" - - os: linux - name: Android aarch64, Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_ANDROID=yes - - AUTOTOOLS_HOST=aarch64-linux-android - - OPENSSL_HOST=android-arm64 - - ANDROID_CPU=aarch64 - - ANDROID_API=23 - - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" - - ANDROID_SDK_ROOT="$HOME/android-sdk" - - ANDROID_NDK_ROOT="$HOME/android-ndk" - - os: linux - name: Android x86, Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_ANDROID=yes - - AUTOTOOLS_HOST=i686-linux-android - - OPENSSL_HOST=android-x86 - - ANDROID_CPU=x86 - - ANDROID_API=23 - - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" - - ANDROID_SDK_ROOT="$HOME/android-sdk" - - ANDROID_NDK_ROOT="$HOME/android-ndk" - - os: linux - name: Android x86_64, Linux, Amd64 - compiler: clang - arch: amd64 - dist: bionic - env: - - TEST_ANDROID=yes - - AUTOTOOLS_HOST=x86_64-linux-android - - OPENSSL_HOST=android-x86_64 - - ANDROID_CPU=x86_64 - - ANDROID_API=23 - - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" - - ANDROID_SDK_ROOT="$HOME/android-sdk" - - ANDROID_NDK_ROOT="$HOME/android-ndk" +# - os: osx +# osx_image: xcode12.2 +# name: Apple Watch on iOS, armv7 +# compiler: clang +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=armv7-apple-ios +# - OPENSSL_HOST=ios-cross +# - IOS_SDK=WatchOS +# - IOS_CPU=armv7k +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: osx +# osx_image: xcode12.2 +# name: iPhoneSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: osx +# osx_image: xcode12.2 +# name: iPhoneSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=iPhoneSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: osx +# osx_image: xcode12.2 +# name: AppleTVSimulator on OS X, x86_64 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=x86_64-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=x86_64 +# - IOS_SDK=AppleTVSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: osx +# osx_image: xcode12.2 +# name: WatchSimulator on OS X, i386 +# env: +# - TEST_IOS=yes +# - AUTOTOOLS_HOST=i386-apple-ios +# - OPENSSL_HOST=iphoneos-cross +# - IOS_CPU=i386 +# - IOS_SDK=WatchSimulator +# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +# - HOMEBREW_NO_AUTO_UPDATE=1 +# - os: linux +# name: Android armv7a, Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_ANDROID=yes +# - AUTOTOOLS_HOST=armv7a-linux-androideabi +# - OPENSSL_HOST=android-arm +# - ANDROID_CPU=armv7a +# - ANDROID_API=23 +# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" +# - ANDROID_SDK_ROOT="$HOME/android-sdk" +# - ANDROID_NDK_ROOT="$HOME/android-ndk" +# - os: linux +# name: Android aarch64, Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_ANDROID=yes +# - AUTOTOOLS_HOST=aarch64-linux-android +# - OPENSSL_HOST=android-arm64 +# - ANDROID_CPU=aarch64 +# - ANDROID_API=23 +# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" +# - ANDROID_SDK_ROOT="$HOME/android-sdk" +# - ANDROID_NDK_ROOT="$HOME/android-ndk" +# - os: linux +# name: Android x86, Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_ANDROID=yes +# - AUTOTOOLS_HOST=i686-linux-android +# - OPENSSL_HOST=android-x86 +# - ANDROID_CPU=x86 +# - ANDROID_API=23 +# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" +# - ANDROID_SDK_ROOT="$HOME/android-sdk" +# - ANDROID_NDK_ROOT="$HOME/android-ndk" +# - os: linux +# name: Android x86_64, Linux, Amd64 +# compiler: clang +# arch: amd64 +# dist: bionic +# env: +# - TEST_ANDROID=yes +# - AUTOTOOLS_HOST=x86_64-linux-android +# - OPENSSL_HOST=android-x86_64 +# - ANDROID_CPU=x86_64 +# - ANDROID_API=23 +# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" +# - ANDROID_SDK_ROOT="$HOME/android-sdk" +# - ANDROID_NDK_ROOT="$HOME/android-ndk" allow_failures: - - os: osx - name: Apple iPhone on iOS, armv7 +# - os: osx +# name: Apple iPhone on iOS, armv7 - os: osx name: Apple iPhone on iOS, arm64 - os: osx name: Apple TV on iOS, arm64 - - os: osx - name: Apple Watch on iOS, armv7 - - os: osx - name: iPhoneSimulator on OS X, i386 - - os: osx - name: iPhoneSimulator on OS X, x86_64 - - os: osx - name: AppleTVSimulator on OS X, x86_64 - - os: osx - name: WatchSimulator on OS X, i386 - - os: linux - name: Android armv7a, Linux, Amd64 - - os: linux - name: Android aarch64, Linux, Amd64 - - os: linux - name: Android x86, Linux, Amd64 - - os: linux - name: Android x86_64, Linux, Amd64 +# - os: osx +# name: Apple Watch on iOS, armv7 +# - os: osx +# name: iPhoneSimulator on OS X, i386 +# - os: osx +# name: iPhoneSimulator on OS X, x86_64 +# - os: osx +# name: AppleTVSimulator on OS X, x86_64 +# - os: osx +# name: WatchSimulator on OS X, i386 +# - os: linux +# name: Android armv7a, Linux, Amd64 +# - os: linux +# name: Android aarch64, Linux, Amd64 +# - os: linux +# name: Android x86, Linux, Amd64 +# - os: linux +# name: Android x86_64, Linux, Amd64 before_script: - | diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index d33352f17..993ad16c1 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -888,6 +888,10 @@ AC_CACHE_VAL(cv_cc_deprecated_$cache, [ echo '$3' >conftest.c echo 'void f(){ $2 }' >>conftest.c +echo "deprecation test for $1 results in" +echo "`$CC -c conftest.c 2>&1 `" +echo "and from the commandline" +$CC -c conftest.c if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then eval "cv_cc_deprecated_$cache=no" else diff --git a/configure b/configure index b067e48fe..0407db3a0 100755 --- a/configure +++ b/configure @@ -20151,6 +20151,10 @@ echo ' #include ' >conftest.c echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c +echo "deprecation test for daemon results in" +echo "`$CC -c conftest.c 2>&1 `" +echo "and from the commandline" +$CC -c conftest.c if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then eval "cv_cc_deprecated_$cache=no" else From e18c4f53aa465bf3b010e36b05bdd3dac20db9bb Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:07:18 +0100 Subject: [PATCH 26/37] Travis, fix deprecation test to use CFLAGS and CPPFLAGS. --- acx_nlnetlabs.m4 | 6 +++--- configure | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 993ad16c1..64b376238 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -889,10 +889,10 @@ AC_CACHE_VAL(cv_cc_deprecated_$cache, echo '$3' >conftest.c echo 'void f(){ $2 }' >>conftest.c echo "deprecation test for $1 results in" -echo "`$CC -c conftest.c 2>&1 `" +echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" echo "and from the commandline" -$CC -c conftest.c -if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then +$CC $CPPFLAGS $CFLAGS -c conftest.c +if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep deprecated`"; then eval "cv_cc_deprecated_$cache=no" else eval "cv_cc_deprecated_$cache=yes" diff --git a/configure b/configure index 0407db3a0..d991794f2 100755 --- a/configure +++ b/configure @@ -20152,10 +20152,10 @@ echo ' ' >conftest.c echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c echo "deprecation test for daemon results in" -echo "`$CC -c conftest.c 2>&1 `" +echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" echo "and from the commandline" -$CC -c conftest.c -if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then +$CC $CPPFLAGS $CFLAGS -c conftest.c +if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep deprecated`"; then eval "cv_cc_deprecated_$cache=no" else eval "cv_cc_deprecated_$cache=yes" From 5644036ffd5c5ed57523113f349609cabfa9f72b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:15:24 +0100 Subject: [PATCH 27/37] Travis, deprecation test also checks if item unavailable. --- acx_nlnetlabs.m4 | 2 +- configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 64b376238..064202c69 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -892,7 +892,7 @@ echo "deprecation test for $1 results in" echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" echo "and from the commandline" $CC $CPPFLAGS $CFLAGS -c conftest.c -if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep deprecated`"; then +if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then eval "cv_cc_deprecated_$cache=no" else eval "cv_cc_deprecated_$cache=yes" diff --git a/configure b/configure index d991794f2..0b318575b 100755 --- a/configure +++ b/configure @@ -20155,7 +20155,7 @@ echo "deprecation test for daemon results in" echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" echo "and from the commandline" $CC $CPPFLAGS $CFLAGS -c conftest.c -if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep deprecated`"; then +if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then eval "cv_cc_deprecated_$cache=no" else eval "cv_cc_deprecated_$cache=yes" From 9f03bccf9653a46e6cc8617e2b5dc99e9c4288b3 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:22:37 +0100 Subject: [PATCH 28/37] Add unistd include, and changelog note. --- configure | 1 + configure.ac | 1 + doc/Changelog | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/configure b/configure index 0b318575b..0199097db 100755 --- a/configure +++ b/configure @@ -20149,6 +20149,7 @@ else echo ' #include +#include ' >conftest.c echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c echo "deprecation test for daemon results in" diff --git a/configure.ac b/configure.ac index cba6ca018..f38f3a9fd 100644 --- a/configure.ac +++ b/configure.ac @@ -1509,6 +1509,7 @@ AC_CHECK_FUNCS([daemon]) if test $ac_cv_func_daemon = yes; then ACX_FUNC_DEPRECATED([daemon], [(void)daemon(0, 0);], [ #include +#include ]) fi diff --git a/doc/Changelog b/doc/Changelog index 7076ec13d..875a6ae9f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +24 March 2021: Wouter + - Fix deprecation test to work for iOS TVOS and WatchOS, it uses + CFLAGS and CPPFLAGS and also checks if the item is unavailable. + 23 March 2021: Wouter - Travis enable all tests again. Clang analyzer only a couple times, when there is a difference. homebrew updates disabled, so it does From 1d199d4a7b5c286e8050a9731bdda4ffa2a9932b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:31:46 +0100 Subject: [PATCH 29/37] remove debug output. --- acx_nlnetlabs.m4 | 7 ++----- configure | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 064202c69..dd8d8c329 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -2,7 +2,8 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 37 +# Version 38 +# 2021-03-24 fix ACX_FUNC_DEPRECATED to use CPPFLAGS and CFLAGS. # 2021-01-05 fix defun for aclocal # 2021-01-05 autoconf 2.70 autoupdate and fixes, no AC_TRY_COMPILE # 2020-08-24 Use EVP_sha256 instead of HMAC_Update (for openssl-3.0.0). @@ -888,10 +889,6 @@ AC_CACHE_VAL(cv_cc_deprecated_$cache, [ echo '$3' >conftest.c echo 'void f(){ $2 }' >>conftest.c -echo "deprecation test for $1 results in" -echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" -echo "and from the commandline" -$CC $CPPFLAGS $CFLAGS -c conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then eval "cv_cc_deprecated_$cache=no" else diff --git a/configure b/configure index 0199097db..ab4be4f36 100755 --- a/configure +++ b/configure @@ -20152,10 +20152,6 @@ echo ' #include ' >conftest.c echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c -echo "deprecation test for daemon results in" -echo "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 `" -echo "and from the commandline" -$CC $CPPFLAGS $CFLAGS -c conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then eval "cv_cc_deprecated_$cache=no" else From 808bb64e508d059c956c32af76d8499ed986f013 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:42:03 +0100 Subject: [PATCH 30/37] travis, script at outer scope so failed lines fail build. --- .travis.yml | 66 ++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index de8211717..9e5cd7de1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -325,55 +325,49 @@ before_script: # https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs. script: - | + export MAKE_TEST="yes" if [ "$TEST_UBSAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" - ./configure - make -j 2 - make test elif [ "$TEST_ASAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" - ./configure - make -j 2 - make test - elif [ "$TEST_IOS" = "yes" ]; then + fi + if [ "$TEST_IOS" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig" source ./contrib/ios/setenv_ios.sh ./contrib/ios/install_openssl.sh ./contrib/ios/install_expat.sh - ./configure \ - --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ - --prefix="$IOS_PREFIX" \ - --with-ssl="$IOS_PREFIX" --disable-gost \ - --with-libexpat="$IOS_PREFIX"; - make -j 2 - make install - elif [ "$TEST_ANDROID" = "yes" ]; then + export CFLAGS="\ + --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ + --prefix=\"$IOS_PREFIX\" \ + --with-ssl=\"$IOS_PREFIX\" --disable-gost \ + --with-libexpat=\"$IOS_PREFIX\" " + MAKE_TEST=no + TEST_INSTALL=yes + fi + if [ "$TEST_ANDROID" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig" ./contrib/android/install_ndk.sh source ./contrib/android/setenv_android.sh ./contrib/android/install_openssl.sh ./contrib/android/install_expat.sh - ./configure \ - --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ - --prefix="$ANDROID_PREFIX" \ - --with-ssl="$ANDROID_PREFIX" --disable-gost \ - --with-libexpat="$ANDROID_PREFIX"; - make -j 2 - make install - elif [ "$TEST_OSX" = "yes" ]; then - ./configure ${CONFIG_OPTS} - make -j 2 - make test - if [ "$TEST_ANALYZER" = "yes" ]; then - (cd testdata/clang-analysis.tdir; bash clang-analysis.test) - fi - else - ./configure ${CONFIG_OPTS} - make -j 2 - make test - if [ "$TEST_ANALYZER" = "yes" ]; then - (cd testdata/clang-analysis.tdir; bash clang-analysis.test) - fi + export CFLAGS="\ + --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ + --prefix=\"$ANDROID_PREFIX\" \ + --with-ssl=\"$ANDROID_PREFIX\" --disable-gost \ + --with-libexpat=\"$ANDROID_PREFIX\" " + MAKE_TEST=no + TEST_INSTALL=yes + fi + ./configure ${CONFIG_OPTS} + make -j 2 + if [ "$MAKE_TEST" = "yes" ]; then + make test + fi + if [ "$TEST_INSTALL" = "yes" ]; then + make install + fi + if [ "$TEST_ANALYZER" = "yes" ]; then + (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi From c682d423c9de16fc36eac73f029d05f2fe64122b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:49:56 +0100 Subject: [PATCH 31/37] Travis, fix script with steps and export variables and config opts. --- .travis.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e5cd7de1..101563ac9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -331,20 +331,22 @@ script: elif [ "$TEST_ASAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" fi + - | if [ "$TEST_IOS" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig" source ./contrib/ios/setenv_ios.sh ./contrib/ios/install_openssl.sh ./contrib/ios/install_expat.sh - export CFLAGS="\ + export CONFIG_OPTS="\ --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ --prefix=\"$IOS_PREFIX\" \ --with-ssl=\"$IOS_PREFIX\" --disable-gost \ --with-libexpat=\"$IOS_PREFIX\" " - MAKE_TEST=no - TEST_INSTALL=yes + export MAKE_TEST=no + export TEST_INSTALL=yes fi + - | if [ "$TEST_ANDROID" = "yes" ]; then export AUTOTOOLS_BUILD="$(./config.guess)" export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig" @@ -352,22 +354,25 @@ script: source ./contrib/android/setenv_android.sh ./contrib/android/install_openssl.sh ./contrib/android/install_expat.sh - export CFLAGS="\ + export CONFIG_OPTS="\ --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ --prefix=\"$ANDROID_PREFIX\" \ --with-ssl=\"$ANDROID_PREFIX\" --disable-gost \ --with-libexpat=\"$ANDROID_PREFIX\" " - MAKE_TEST=no - TEST_INSTALL=yes + export MAKE_TEST=no + export TEST_INSTALL=yes fi - ./configure ${CONFIG_OPTS} - make -j 2 + - ./configure ${CONFIG_OPTS} + - make -j 2 + - | if [ "$MAKE_TEST" = "yes" ]; then make test fi + - | if [ "$TEST_INSTALL" = "yes" ]; then make install fi + - | if [ "$TEST_ANALYZER" = "yes" ]; then (cd testdata/clang-analysis.tdir; bash clang-analysis.test) fi From 569fb4d2f40f8838cc7fa01138ab6cec7faf2301 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 10:57:59 +0100 Subject: [PATCH 32/37] Travis, debug print config opts. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 101563ac9..65260c6ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -343,6 +343,7 @@ script: --prefix=\"$IOS_PREFIX\" \ --with-ssl=\"$IOS_PREFIX\" --disable-gost \ --with-libexpat=\"$IOS_PREFIX\" " + echo CONFIG_OPTS ${CONFIG_OPTS} export MAKE_TEST=no export TEST_INSTALL=yes fi @@ -359,6 +360,7 @@ script: --prefix=\"$ANDROID_PREFIX\" \ --with-ssl=\"$ANDROID_PREFIX\" --disable-gost \ --with-libexpat=\"$ANDROID_PREFIX\" " + echo CONFIG_OPTS ${CONFIG_OPTS} export MAKE_TEST=no export TEST_INSTALL=yes fi From 4041342cf23c611dbae804d9684b80195e3875fb Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 11:06:10 +0100 Subject: [PATCH 33/37] Travis, fix quotes on config opts for iOS and Android configure. --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 65260c6ba..d6a720d7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -339,10 +339,10 @@ script: ./contrib/ios/install_openssl.sh ./contrib/ios/install_expat.sh export CONFIG_OPTS="\ - --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ - --prefix=\"$IOS_PREFIX\" \ - --with-ssl=\"$IOS_PREFIX\" --disable-gost \ - --with-libexpat=\"$IOS_PREFIX\" " + --build=$AUTOTOOLS_BUILD --host=$AUTOTOOLS_HOST \ + --prefix=$IOS_PREFIX \ + --with-ssl=$IOS_PREFIX --disable-gost \ + --with-libexpat=$IOS_PREFIX " echo CONFIG_OPTS ${CONFIG_OPTS} export MAKE_TEST=no export TEST_INSTALL=yes @@ -356,10 +356,10 @@ script: ./contrib/android/install_openssl.sh ./contrib/android/install_expat.sh export CONFIG_OPTS="\ - --build=\"$AUTOTOOLS_BUILD\" --host=\"$AUTOTOOLS_HOST\" \ - --prefix=\"$ANDROID_PREFIX\" \ - --with-ssl=\"$ANDROID_PREFIX\" --disable-gost \ - --with-libexpat=\"$ANDROID_PREFIX\" " + --build=$AUTOTOOLS_BUILD --host=$AUTOTOOLS_HOST \ + --prefix=$ANDROID_PREFIX \ + --with-ssl=$ANDROID_PREFIX --disable-gost \ + --with-libexpat=$ANDROID_PREFIX " echo CONFIG_OPTS ${CONFIG_OPTS} export MAKE_TEST=no export TEST_INSTALL=yes From 3fddde30cb5682847b93bbc1595427cb6d03059e Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 11:18:35 +0100 Subject: [PATCH 34/37] Travis, enable jobs, changelog note. - Travis, fix script to fail when tasks fail. --- .travis.yml | 510 +++++++++++++++++++++++++------------------------- doc/Changelog | 1 + 2 files changed, 256 insertions(+), 255 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6a720d7e..f2fc6c19f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,129 +26,129 @@ jobs: arch: amd64 env: - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: Clang on Linux, Amd64, clang-analysis -# compiler: clang -# arch: amd64 -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - TEST_ANALYZER=yes -# - os: osx -# osx_image: xcode12.2 -# name: Clang on OS X, Amd64, clang-analysis -# compiler: clang -# arch: amd64 -# env: -# - TEST_OSX=yes -# - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat" -# - TEST_ANALYZER=yes -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: linux -# name: Libevent, GCC on Linux, Amd64 -# compiler: gcc -# arch: amd64 -# env: -# - TEST_LIBEVENT=yes -# - CONFIG_OPTS="--with-libevent" -# - os: linux -# name: Libevent, Clang on Linux, Amd64 -# compiler: clang -# arch: amd64 -# env: -# - TEST_LIBEVENT=yes -# - CONFIG_OPTS="--with-libevent" -# - os: osx -# osx_image: xcode12.2 -# name: Libevent, Clang on OS X, Amd64 -# compiler: clang -# arch: amd64 -# env: -# - TEST_OSX=yes -# - TEST_LIBEVENT=yes -# - CONFIG_OPTS="--disable-flto --with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: linux -# name: UBsan, GCC on Linux, Amd64 -# compiler: gcc -# arch: amd64 -# dist: bionic -# env: -# - TEST_UBSAN=yes -# - os: linux -# name: UBsan, Clang on Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_UBSAN=yes -# - os: linux -# name: Asan, GCC on Linux, Amd64 -# compiler: gcc -# arch: amd64 -# dist: bionic -# env: -# - TEST_ASAN=yes -# - os: linux -# name: Asan, Clang on Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_ASAN=yes -# - os: linux -# name: GCC on Linux, Aarch64 -# compiler: gcc -# arch: arm64 -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: Clang on Linux, Aarch64 -# compiler: clang -# arch: arm64 -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: GCC on Linux, PowerPC64 -# compiler: gcc -# arch: ppc64le -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: Clang on Linux, PowerPC64 -# compiler: clang -# arch: ppc64le -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: GCC on Linux, s390x -# compiler: gcc -# arch: s390x -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: linux -# name: Clang on Linux, s390x -# compiler: clang -# arch: s390x -# dist: bionic -# env: -# - CONFIG_OPTS="--enable-debug --disable-flto" -# - os: osx -# osx_image: xcode12.2 -# name: Apple iPhone on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=iPhoneOS -# - IOS_CPU=armv7s -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 + - os: linux + name: Clang on Linux, Amd64, clang-analysis + compiler: clang + arch: amd64 + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - TEST_ANALYZER=yes + - os: osx + osx_image: xcode12.2 + name: Clang on OS X, Amd64, clang-analysis + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat" + - TEST_ANALYZER=yes + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: linux + name: Libevent, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + env: + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-libevent" + - os: linux + name: Libevent, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-libevent" + - os: osx + osx_image: xcode12.2 + name: Libevent, Clang on OS X, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--disable-flto --with-ssl=/usr/local/opt/openssl --with-libevent=/usr/local/opt/libevent --with-libexpat=/usr/local/opt/expat" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: linux + name: UBsan, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + dist: bionic + env: + - TEST_UBSAN=yes + - os: linux + name: UBsan, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_UBSAN=yes + - os: linux + name: Asan, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + dist: bionic + env: + - TEST_ASAN=yes + - os: linux + name: Asan, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ASAN=yes + - os: linux + name: GCC on Linux, Aarch64 + compiler: gcc + arch: arm64 + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, Aarch64 + compiler: clang + arch: arm64 + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: GCC on Linux, PowerPC64 + compiler: gcc + arch: ppc64le + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, PowerPC64 + compiler: clang + arch: ppc64le + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: GCC on Linux, s390x + compiler: gcc + arch: s390x + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, s390x + compiler: clang + arch: s390x + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: osx + osx_image: xcode12.2 + name: Apple iPhone on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=armv7s + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 - os: osx osx_image: xcode12.2 name: Apple iPhone on iOS, arm64 @@ -173,144 +173,144 @@ jobs: - IOS_CPU=arm64 - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode12.2 -# name: Apple Watch on iOS, armv7 -# compiler: clang -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=armv7-apple-ios -# - OPENSSL_HOST=ios-cross -# - IOS_SDK=WatchOS -# - IOS_CPU=armv7k -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode12.2 -# name: iPhoneSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode12.2 -# name: iPhoneSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=iPhoneSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode12.2 -# name: AppleTVSimulator on OS X, x86_64 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=x86_64-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=x86_64 -# - IOS_SDK=AppleTVSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: osx -# osx_image: xcode12.2 -# name: WatchSimulator on OS X, i386 -# env: -# - TEST_IOS=yes -# - AUTOTOOLS_HOST=i386-apple-ios -# - OPENSSL_HOST=iphoneos-cross -# - IOS_CPU=i386 -# - IOS_SDK=WatchSimulator -# - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" -# - HOMEBREW_NO_AUTO_UPDATE=1 -# - os: linux -# name: Android armv7a, Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_ANDROID=yes -# - AUTOTOOLS_HOST=armv7a-linux-androideabi -# - OPENSSL_HOST=android-arm -# - ANDROID_CPU=armv7a -# - ANDROID_API=23 -# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" -# - ANDROID_SDK_ROOT="$HOME/android-sdk" -# - ANDROID_NDK_ROOT="$HOME/android-ndk" -# - os: linux -# name: Android aarch64, Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_ANDROID=yes -# - AUTOTOOLS_HOST=aarch64-linux-android -# - OPENSSL_HOST=android-arm64 -# - ANDROID_CPU=aarch64 -# - ANDROID_API=23 -# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" -# - ANDROID_SDK_ROOT="$HOME/android-sdk" -# - ANDROID_NDK_ROOT="$HOME/android-ndk" -# - os: linux -# name: Android x86, Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_ANDROID=yes -# - AUTOTOOLS_HOST=i686-linux-android -# - OPENSSL_HOST=android-x86 -# - ANDROID_CPU=x86 -# - ANDROID_API=23 -# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" -# - ANDROID_SDK_ROOT="$HOME/android-sdk" -# - ANDROID_NDK_ROOT="$HOME/android-ndk" -# - os: linux -# name: Android x86_64, Linux, Amd64 -# compiler: clang -# arch: amd64 -# dist: bionic -# env: -# - TEST_ANDROID=yes -# - AUTOTOOLS_HOST=x86_64-linux-android -# - OPENSSL_HOST=android-x86_64 -# - ANDROID_CPU=x86_64 -# - ANDROID_API=23 -# - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" -# - ANDROID_SDK_ROOT="$HOME/android-sdk" -# - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: osx + osx_image: xcode12.2 + name: Apple Watch on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=WatchOS + - IOS_CPU=armv7k + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: iPhoneSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: iPhoneSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: AppleTVSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=AppleTVSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: osx + osx_image: xcode12.2 + name: WatchSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=WatchSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - HOMEBREW_NO_AUTO_UPDATE=1 + - os: linux + name: Android armv7a, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=armv7a-linux-androideabi + - OPENSSL_HOST=android-arm + - ANDROID_CPU=armv7a + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android aarch64, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=aarch64-linux-android + - OPENSSL_HOST=android-arm64 + - ANDROID_CPU=aarch64 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android x86, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=i686-linux-android + - OPENSSL_HOST=android-x86 + - ANDROID_CPU=x86 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android x86_64, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=x86_64-linux-android + - OPENSSL_HOST=android-x86_64 + - ANDROID_CPU=x86_64 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" allow_failures: -# - os: osx -# name: Apple iPhone on iOS, armv7 + - os: osx + name: Apple iPhone on iOS, armv7 - os: osx name: Apple iPhone on iOS, arm64 - os: osx name: Apple TV on iOS, arm64 -# - os: osx -# name: Apple Watch on iOS, armv7 -# - os: osx -# name: iPhoneSimulator on OS X, i386 -# - os: osx -# name: iPhoneSimulator on OS X, x86_64 -# - os: osx -# name: AppleTVSimulator on OS X, x86_64 -# - os: osx -# name: WatchSimulator on OS X, i386 -# - os: linux -# name: Android armv7a, Linux, Amd64 -# - os: linux -# name: Android aarch64, Linux, Amd64 -# - os: linux -# name: Android x86, Linux, Amd64 -# - os: linux -# name: Android x86_64, Linux, Amd64 + - os: osx + name: Apple Watch on iOS, armv7 + - os: osx + name: iPhoneSimulator on OS X, i386 + - os: osx + name: iPhoneSimulator on OS X, x86_64 + - os: osx + name: AppleTVSimulator on OS X, x86_64 + - os: osx + name: WatchSimulator on OS X, i386 + - os: linux + name: Android armv7a, Linux, Amd64 + - os: linux + name: Android aarch64, Linux, Amd64 + - os: linux + name: Android x86, Linux, Amd64 + - os: linux + name: Android x86_64, Linux, Amd64 before_script: - | diff --git a/doc/Changelog b/doc/Changelog index 875a6ae9f..a524c7f3a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 24 March 2021: Wouter - Fix deprecation test to work for iOS TVOS and WatchOS, it uses CFLAGS and CPPFLAGS and also checks if the item is unavailable. + - Travis, fix script to fail when tasks fail. 23 March 2021: Wouter - Travis enable all tests again. Clang analyzer only a couple times, From 90e3b8d1a9841fc0c1cfdebbdb643580db348b37 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 15:34:26 +0100 Subject: [PATCH 35/37] - Travis, fix warning in ubsan compile. - Fix configure Targetconfiditionals.h header check, to use compile. --- .travis.yml | 2 +- configure | 3 ++- configure.ac | 2 +- doc/Changelog | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2fc6c19f..1f514b5d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -327,7 +327,7 @@ script: - | export MAKE_TEST="yes" if [ "$TEST_UBSAN" = "yes" ]; then - export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" + export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover=all" elif [ "$TEST_ASAN" = "yes" ]; then export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" fi diff --git a/configure b/configure index ab4be4f36..40a0d4e00 100755 --- a/configure +++ b/configure @@ -14793,7 +14793,8 @@ done # Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH for ac_header in TargetConditionals.h do : - ac_fn_c_check_header_mongrel "$LINENO" "TargetConditionals.h" "ac_cv_header_TargetConditionals_h" "$ac_includes_default" + ac_fn_c_check_header_compile "$LINENO" "TargetConditionals.h" "ac_cv_header_TargetConditionals_h" "$ac_includes_default +" if test "x$ac_cv_header_TargetConditionals_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TARGETCONDITIONALS_H 1 diff --git a/configure.ac b/configure.ac index f38f3a9fd..439f1876b 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,7 @@ AC_CHECK_HEADERS([net/if.h],,, [ ]) # Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH -AC_CHECK_HEADERS([TargetConditionals.h]) +AC_CHECK_HEADERS([TargetConditionals.h],,, [AC_INCLUDES_DEFAULT]) # check for types. # Using own tests for int64* because autoconf builtin only give 32bit. diff --git a/doc/Changelog b/doc/Changelog index a524c7f3a..af11e488b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,8 @@ - Fix deprecation test to work for iOS TVOS and WatchOS, it uses CFLAGS and CPPFLAGS and also checks if the item is unavailable. - Travis, fix script to fail when tasks fail. + - Travis, fix warning in ubsan compile. + - Fix configure Targetconfiditionals.h header check, to use compile. 23 March 2021: Wouter - Travis enable all tests again. Clang analyzer only a couple times, From f3dcb297d9307be108ce451dfc52ddba4f3f135a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 24 Mar 2021 16:28:18 +0100 Subject: [PATCH 36/37] - Fix that cachedb does not produce empty object files when disabled. --- Makefile.in | 8 ++++++-- configure | 6 ++++++ configure.ac | 2 ++ doc/Changelog | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3b040d359..69ce8e9b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -110,6 +110,8 @@ SUBNET_HEADER=@SUBNET_HEADER@ IPSECMOD_SRC=ipsecmod/ipsecmod.c ipsecmod/ipsecmod-whitelist.c IPSECMOD_OBJ=@IPSECMOD_OBJ@ IPSECMOD_HEADER=@IPSECMOD_HEADER@ +CACHEDB_SRC=@CACHEDB_SRC@ +CACHEDB_OBJ=@CACHEDB_OBJ@ COMMON_SRC=services/cache/dns.c services/cache/infra.c services/cache/rrset.c \ util/as112.c util/data/dname.c util/data/msgencode.c util/data/msgparse.c \ util/data/msgreply.c util/data/packed_rrset.c iterator/iterator.c \ @@ -133,7 +135,7 @@ validator/val_nsec3.c validator/val_nsec.c validator/val_secalgo.c \ validator/val_sigcrypt.c validator/val_utils.c dns64/dns64.c \ edns-subnet/edns-subnet.c edns-subnet/subnetmod.c \ edns-subnet/addrtree.c edns-subnet/subnet-whitelist.c \ -cachedb/cachedb.c cachedb/redis.c respip/respip.c $(CHECKLOCK_SRC) \ +$(CACHEDB_SRC) respip/respip.c $(CHECKLOCK_SRC) \ $(DNSTAP_SRC) $(DNSCRYPT_SRC) $(IPSECMOD_SRC) $(IPSET_SRC) COMMON_OBJ_WITHOUT_NETCALL=dns.lo infra.lo rrset.lo dname.lo msgencode.lo \ as112.lo msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \ @@ -145,7 +147,7 @@ random.lo rbtree.lo regional.lo rtt.lo dnstree.lo lookup3.lo lruhash.lo \ slabhash.lo tcp_conn_limit.lo timehist.lo tube.lo winsock_event.lo \ autotrust.lo val_anchor.lo rpz.lo \ validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \ -val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo cachedb.lo redis.lo authzone.lo \ +val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo $(CACHEDB_OBJ) authzone.lo \ $(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ) $(DNSCRYPT_OBJ) \ $(IPSECMOD_OBJ) $(IPSET_OBJ) $(DYNLIBMOD_OBJ) respip.lo COMMON_OBJ_WITHOUT_UB_EVENT=$(COMMON_OBJ_WITHOUT_NETCALL) netevent.lo listen_dnsport.lo \ @@ -431,6 +433,8 @@ dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dt dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h $(srcdir)/dnstap/dtstream.h dynlibmod.lo dynlibdmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h +cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h $(srcdir)/cachedb/cachedb.h +redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h $(srcdir)/cachedb/redis.h # dnscrypt dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h \ diff --git a/configure b/configure index 40a0d4e00..6099122b1 100755 --- a/configure +++ b/configure @@ -643,6 +643,8 @@ IPSET_OBJ IPSET_SRC IPSECMOD_HEADER IPSECMOD_OBJ +CACHEDB_OBJ +CACHEDB_SRC DNSCRYPT_OBJ DNSCRYPT_SRC ENABLE_DNSCRYPT @@ -21513,6 +21515,10 @@ case "$enable_cachedb" in $as_echo "#define USE_CACHEDB 1" >>confdefs.h + CACHEDB_SRC="cachedb/cachedb.c cachedb/redis.c" + + CACHEDB_OBJ="cachedb.lo redis.lo" + ;; no|*) # nothing diff --git a/configure.ac b/configure.ac index 439f1876b..efbdfe6aa 100644 --- a/configure.ac +++ b/configure.ac @@ -1780,6 +1780,8 @@ if test "$found_libhiredis" = "yes"; then enable_cachedb="yes"; fi case "$enable_cachedb" in yes) AC_DEFINE([USE_CACHEDB], [1], [Define to 1 to use cachedb support]) + AC_SUBST([CACHEDB_SRC], ["cachedb/cachedb.c cachedb/redis.c"]) + AC_SUBST([CACHEDB_OBJ], ["cachedb.lo redis.lo"]) ;; no|*) # nothing diff --git a/doc/Changelog b/doc/Changelog index af11e488b..ce51687dc 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,7 @@ - Travis, fix script to fail when tasks fail. - Travis, fix warning in ubsan compile. - Fix configure Targetconfiditionals.h header check, to use compile. + - Fix that cachedb does not produce empty object files when disabled. 23 March 2021: Wouter - Travis enable all tests again. Clang analyzer only a couple times, From ff0c5f863d02c29a0eb11f0130110b390656b558 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 25 Mar 2021 12:18:49 +0100 Subject: [PATCH 37/37] - Fix #429: Also fix end of transfer for http download of auth zones. --- doc/Changelog | 3 +++ util/netevent.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index ce51687dc..d5412a2a0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +25 March 2021: Wouter + - Fix #429: Also fix end of transfer for http download of auth zones. + 24 March 2021: Wouter - Fix deprecation test to work for iOS TVOS and WatchOS, it uses CFLAGS and CPPFLAGS and also checks if the item is unavailable. diff --git a/util/netevent.c b/util/netevent.c index aac717f8d..a5ea46229 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -2401,7 +2401,7 @@ http_process_chunk_header(struct comm_point* c) return 1; } -/** handle nonchunked data segment */ +/** handle nonchunked data segment, 0=fail, 1=wait */ static int http_nonchunk_segment(struct comm_point* c) { @@ -2410,7 +2410,7 @@ http_nonchunk_segment(struct comm_point* c) * we are looking to read tcp_byte_count more data * and then the transfer is done. */ size_t remainbufferlen; - size_t got_now = sldns_buffer_limit(c->buffer) - c->http_stored; + size_t got_now = sldns_buffer_limit(c->buffer); if(c->tcp_byte_count <= got_now) { /* done, this is the last data fragment */ c->http_stored = 0; @@ -2419,7 +2419,6 @@ http_nonchunk_segment(struct comm_point* c) (void)(*c->callback)(c, c->cb_arg, NETEVENT_DONE, NULL); return 1; } - c->tcp_byte_count -= got_now; /* if we have the buffer space, * read more data collected into the buffer */ remainbufferlen = sldns_buffer_capacity(c->buffer) - @@ -2435,6 +2434,7 @@ http_nonchunk_segment(struct comm_point* c) } /* call callback with this data amount, then * wait for more */ + c->tcp_byte_count -= got_now; c->http_stored = 0; sldns_buffer_set_position(c->buffer, 0); fptr_ok(fptr_whitelist_comm_point(c->callback));