Skip to content

Commit

Permalink
chore: update C deps (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone authored Dec 13, 2023
1 parent b3ddedf commit e5c1f6a
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 53 deletions.
10 changes: 5 additions & 5 deletions CDEPS/openssl/000.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index b819337..e479bd6 100644
index 0fbab8f014..0dc8ff53d4 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -34,6 +34,10 @@ static COMP_METHOD zlib_method_nozlib = {

@@ -26,6 +26,10 @@ COMP_METHOD *COMP_zlib(void);
# include <zlib.h>

+#ifndef ZLIB_OONI
+# error "We're not including the correct zlib.h file"
+#endif
+
static int zlib_stateful_init(COMP_CTX *ctx);
static void zlib_stateful_finish(COMP_CTX *ctx);
static int zlib_stateful_compress_block(COMP_CTX *ctx, unsigned char *out,
static ossl_ssize_t zlib_stateful_compress_block(COMP_CTX *ctx, unsigned char *out,
10 changes: 5 additions & 5 deletions CDEPS/openssl/001.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/include/openssl/opensslv.h.in b/include/openssl/opensslv.h.in
index 3f47a2a..af1db51 100644
index 3f47a2ac08..b413461ca7 100644
--- a/include/openssl/opensslv.h.in
+++ b/include/openssl/opensslv.h.in
@@ -101,6 +101,10 @@ extern "C" {
|(OPENSSL_VERSION_PATCH<<4) \
|_OPENSSL_VERSION_PRE_RELEASE )
@@ -13,6 +13,10 @@
# define OPENSSL_OPENSSLV_H
# pragma once

+/* OPENSSL_OONI is used by dependencies to ensure they are using the
+ correct OpenSSL headers and not some other headers. */
+#define OPENSSL_OONI 1
+
# ifdef __cplusplus
}
extern "C" {
# endif
2 changes: 1 addition & 1 deletion MOBILE/ios/check-xcode-version
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

EXPECTED_XCODE_VERSION=${EXPECTED_XCODE_VERSION:-15.0}
EXPECTED_XCODE_VERSION=${EXPECTED_XCODE_VERSION:-15.1}

printf "checking for xcodebuild... "
command -v xcodebuild || {
Expand Down
32 changes: 16 additions & 16 deletions internal/cmd/buildtool/android_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ func TestAndroidBuildCdepsOpenSSL(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -757,12 +757,12 @@ func TestAndroidBuildCdepsOpenSSL(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -812,12 +812,12 @@ func TestAndroidBuildCdepsOpenSSL(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -867,12 +867,12 @@ func TestAndroidBuildCdepsOpenSSL(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1738,12 +1738,12 @@ func TestAndroidBuildCdepsTor(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1815,12 +1815,12 @@ func TestAndroidBuildCdepsTor(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1892,12 +1892,12 @@ func TestAndroidBuildCdepsTor(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1969,12 +1969,12 @@ func TestAndroidBuildCdepsTor(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down
10 changes: 5 additions & 5 deletions internal/cmd/buildtool/cdepsopenssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func cdepsOpenSSLBuildMain(globalEnv *cBuildEnv, deps buildtoolmodel.Dependencie
defer restore()

// See https://github.com/Homebrew/homebrew-core/blob/master/Formula/o/[email protected]
cdepsMustFetch("https://www.openssl.org/source/openssl-3.1.3.tar.gz")
cdepsMustFetch("https://www.openssl.org/source/openssl-3.2.0.tar.gz")
deps.VerifySHA256( // must be mockable
"f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6",
"openssl-3.1.3.tar.gz",
"14c826f07c7e433706fb5c69fa9e25dab95684844b4c962a2cf1bf183eb4690e",
"openssl-3.2.0.tar.gz",
)
must.Run(log.Log, "tar", "-xf", "openssl-3.1.3.tar.gz")
_ = deps.MustChdir("openssl-3.1.3") // must be mockable
must.Run(log.Log, "tar", "-xf", "openssl-3.2.0.tar.gz")
_ = deps.MustChdir("openssl-3.2.0") // must be mockable

mydir := filepath.Join(topdir, "CDEPS", "openssl")
for _, patch := range cdepsMustListPatches(mydir) {
Expand Down
10 changes: 5 additions & 5 deletions internal/cmd/buildtool/cdepstor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func cdepsTorBuildMain(globalEnv *cBuildEnv, deps buildtoolmodel.Dependencies) {
defer restore()

// See https://github.com/Homebrew/homebrew-core/blob/master/Formula/t/tor.rb
cdepsMustFetch("https://www.torproject.org/dist/tor-0.4.8.7.tar.gz")
cdepsMustFetch("https://www.torproject.org/dist/tor-0.4.8.10.tar.gz")
deps.VerifySHA256( // must be mockable
"b20d2b9c74db28a00c07f090ee5b0241b2b684f3afdecccc6b8008931c557491",
"tor-0.4.8.7.tar.gz",
"e628b4fab70edb4727715b23cf2931375a9f7685ac08f2c59ea498a178463a86",
"tor-0.4.8.10.tar.gz",
)
must.Run(log.Log, "tar", "-xf", "tor-0.4.8.7.tar.gz")
_ = deps.MustChdir("tor-0.4.8.7") // must be mockable
must.Run(log.Log, "tar", "-xf", "tor-0.4.8.10.tar.gz")
_ = deps.MustChdir("tor-0.4.8.10") // must be mockable

mydir := filepath.Join(topdir, "CDEPS", "tor")
for _, patch := range cdepsMustListPatches(mydir) {
Expand Down
24 changes: 12 additions & 12 deletions internal/cmd/buildtool/ios_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ func TestIOSBuildCdepsOpenSSL(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -399,12 +399,12 @@ func TestIOSBuildCdepsOpenSSL(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -449,12 +449,12 @@ func TestIOSBuildCdepsOpenSSL(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1142,12 +1142,12 @@ func TestIOSBuildCdepsTor(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1220,12 +1220,12 @@ func TestIOSBuildCdepsTor(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -1298,12 +1298,12 @@ func TestIOSBuildCdepsTor(t *testing.T) {
}, {
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/buildtool/linuxcdeps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ func TestLinuxCdepsBuildMain(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.1.3.tar.gz",
"curl", "-fsSLO", "https://www.openssl.org/source/openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "openssl-3.1.3.tar.gz",
"tar", "-xf", "openssl-3.2.0.tar.gz",
},
}, {
Env: []string{},
Expand Down Expand Up @@ -322,12 +322,12 @@ func TestLinuxCdepsBuildMain(t *testing.T) {
expect: []buildtooltest.ExecExpectations{{
Env: []string{},
Argv: []string{
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.7.tar.gz",
"curl", "-fsSLO", "https://www.torproject.org/dist/tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Argv: []string{
"tar", "-xf", "tor-0.4.8.7.tar.gz",
"tar", "-xf", "tor-0.4.8.10.tar.gz",
},
}, {
Env: []string{},
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/buildtool/linuxstatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func linuxStaticBuildPackage(
envp.Append("CGO_ENABLED", "1")
envp.Append("GOOS", "linux")
envp.Append("GOARCH", goarch)
envp.Append("CGO_CFLAGS", "-D_LARGEFILE64_SOURCE") // See https://github.com/ooni/probe-cli/pull/1434
if goarm > 0 {
envp.Append("GOARM", strconv.FormatInt(goarm, 10))
}
Expand Down
Loading

0 comments on commit e5c1f6a

Please sign in to comment.