Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): replace go-libtor with ./internal/libtor #1366

Merged
merged 13 commits into from
Oct 12, 2023
Merged

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Oct 12, 2023

This diff replaces go-libtor with ./internal/libtor.

Closes ooni/probe#2564

@bassosimone
Copy link
Contributor Author

Alright, enough hammering for the build to succeed. Obviously, a successful build does not imply we're also producing correct binaries, but a failed build is definitely not providing binaries, so this counts as progress 😅

bassosimone added a commit that referenced this pull request Oct 12, 2023
We currently have a string variable in `cBuildEnv` named
`OPENSSL_API_DEFINE` that we append to OpenSSL's `./Configure`
invocation to force using the proper Android API. However, for building
for iOS (a need documented by
ooni/probe#2564), we need a list of strings,
because there is more than a single scalar that we need to append to the
`./Configure` invocation (as shown by the MVP implementation at
#1366).

Hence, this diff, which introduces a string list named
`OPENSSL_POST_COMPILER_FLAGS` that contains strings to append to the
`./Configure` command line _after_ the OS/compiler flag. We specifically
named the variable "post compiler" because there is another variable in
the same `cBuildEnv` struct called `OPENSSL_COMPILER`.
bassosimone added a commit that referenced this pull request Oct 12, 2023
This diff modifies `./internal/cmd/buildtool` to (1) stop removing
OpenSSL's pkgconfig, (2) use such a pkgconfig during libevent's
`./configure` step, and (3) make sure libevent's install does not remove
OpenSSL's pkgconfig.

We're implementing changes (1) and (2) because libevent fails to
properly configure for iOS if you have a system with homebrew with
OpenSSL@3 installed. Unless we force the `PKG_CONFIG_PATH`, libevent's
`configure` uses the OpenSSL@3 headers and library installed with
homebrew rather than the ones we cross compiled.

Change (3) is there because otherwise we cannot recompile libevent
without recompiling OpenSSL, since the libevent build fails unless we
have a suitable OpenSSL pkgconfig, as explained before.

This diff was extracted and refined from
#1366.

The reference issue is: ooni/probe#2564.
bassosimone added a commit that referenced this pull request Oct 12, 2023
This diff extends buildtool to builds zlib, openssl, libevent, and tor
for iOS.

We're only targeting 64 bit architectures, which is what ooni/probe-ios
needs.

We're targeting iOS >= 12.0, which is what ooni/probe-ios needs.

A subsequent diff will introduce unit tests to make sure we don't break
the iOS build.

Reference issue: ooni/probe#2564.

This diff was extracted from
#1366.
@bassosimone bassosimone changed the title Iosbuild feat( Oct 12, 2023
@bassosimone bassosimone changed the title feat( feat(ios): replace go-libtor with ./internal/libtor Oct 12, 2023
@bassosimone bassosimone marked this pull request as ready for review October 12, 2023 17:24
@bassosimone bassosimone requested a review from hellais as a code owner October 12, 2023 17:24
@bassosimone bassosimone merged commit 6541ef1 into master Oct 12, 2023
9 checks passed
@bassosimone bassosimone deleted the iosbuild branch October 12, 2023 18:08
bassosimone added a commit that referenced this pull request Oct 12, 2023
This diff backports #1367 to the release/3.19 branch.

We currently have a string variable in `cBuildEnv` named
`OPENSSL_API_DEFINE` that we append to OpenSSL's `./Configure`
invocation to force using the proper Android API. However, for building
for iOS (a need documented by
ooni/probe#2564), we need a list of strings,
because there is more than a single scalar that we need to append to the
`./Configure` invocation (as shown by the MVP implementation at
#1366).

Hence, this diff, which introduces a string list named
`OPENSSL_POST_COMPILER_FLAGS` that contains strings to append to the
`./Configure` command line _after_ the OS/compiler flag. We specifically
named the variable "post compiler" because there is another variable in
the same `cBuildEnv` struct called `OPENSSL_COMPILER`.
bassosimone added a commit that referenced this pull request Oct 12, 2023
This diff backports #1369 to the release/3.19 branch.

This diff modifies `./internal/cmd/buildtool` to (1) stop removing
OpenSSL's pkgconfig, (2) use such a pkgconfig during libevent's
`./configure` step, and (3) make sure libevent's install does not remove
OpenSSL's pkgconfig.

We're implementing changes (1) and (2) because libevent fails to
properly configure for iOS if you have a system with homebrew with
OpenSSL@3 installed. Unless we force the `PKG_CONFIG_PATH`, libevent's
`configure` uses the OpenSSL@3 headers and library installed with
homebrew rather than the ones we cross compiled.

Change (3) is there because otherwise we cannot recompile libevent
without recompiling OpenSSL, since the libevent build fails unless we
have a suitable OpenSSL pkgconfig, as explained before.

This diff was extracted and refined from
#1366.

The reference issue is: ooni/probe#2564.
bassosimone added a commit that referenced this pull request Oct 12, 2023
…r iOS

This diff backports #1370 to the release/3.19 branch.

This diff extends buildtool to builds zlib, openssl, libevent, and tor
for iOS.

We're only targeting 64 bit architectures, which is what ooni/probe-ios
needs.

We're targeting iOS >= 12.0, which is what ooni/probe-ios needs.

A subsequent diff will introduce unit tests to make sure we don't break
the iOS build.

Reference issue: ooni/probe#2564.

This diff was extracted from
#1366.
bassosimone added a commit that referenced this pull request Oct 12, 2023
This diff backports #1366 to the release/3.19 branch.

This diff replaces go-libtor with ./internal/libtor.

Closes ooni/probe#2564
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
We currently have a string variable in `cBuildEnv` named
`OPENSSL_API_DEFINE` that we append to OpenSSL's `./Configure`
invocation to force using the proper Android API. However, for building
for iOS (a need documented by
ooni/probe#2564), we need a list of strings,
because there is more than a single scalar that we need to append to the
`./Configure` invocation (as shown by the MVP implementation at
ooni#1366).

Hence, this diff, which introduces a string list named
`OPENSSL_POST_COMPILER_FLAGS` that contains strings to append to the
`./Configure` command line _after_ the OS/compiler flag. We specifically
named the variable "post compiler" because there is another variable in
the same `cBuildEnv` struct called `OPENSSL_COMPILER`.
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
This diff modifies `./internal/cmd/buildtool` to (1) stop removing
OpenSSL's pkgconfig, (2) use such a pkgconfig during libevent's
`./configure` step, and (3) make sure libevent's install does not remove
OpenSSL's pkgconfig.

We're implementing changes (1) and (2) because libevent fails to
properly configure for iOS if you have a system with homebrew with
OpenSSL@3 installed. Unless we force the `PKG_CONFIG_PATH`, libevent's
`configure` uses the OpenSSL@3 headers and library installed with
homebrew rather than the ones we cross compiled.

Change (3) is there because otherwise we cannot recompile libevent
without recompiling OpenSSL, since the libevent build fails unless we
have a suitable OpenSSL pkgconfig, as explained before.

This diff was extracted and refined from
ooni#1366.

The reference issue is: ooni/probe#2564.
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
…#1370)

This diff extends buildtool to builds zlib, openssl, libevent, and tor
for iOS.

We're only targeting 64 bit architectures, which is what ooni/probe-ios
needs.

We're targeting iOS >= 12.0, which is what ooni/probe-ios needs.

A subsequent diff will introduce unit tests to make sure we don't break
the iOS build.

Reference issue: ooni/probe#2564.

This diff was extracted from
ooni#1366.
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
This diff replaces go-libtor with ./internal/libtor.

Closes ooni/probe#2564
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ios: replace ooni/go-libtor with scripts compiling tor
1 participant