The current status, as I understand it, is that the build is reproducible, but includes or at least downloads the proprietary Google Play Services library as a side effect of the build.
The current status, as I understand it, is that the build is reproducible, but includes or at least downloads the proprietary Google Play Services library as a side effect of the build.
The android changes are now merged into go-webrtc. We found a workaround for the Google Play services problem.
dcf: do you have a script/instructions somewhere on how to build the whole thing which we could then translate into our tor-browser-build process? If you plan to do that work yourself, you are more than welcome! :). We'll likely put that on our plate otherwise.
dcf: do you have a script/instructions somewhere on how to build the whole thing which we could then translate into our tor-browser-build process? If you plan to do that work yourself, you are more than welcome! :). We'll likely put that on our plate otherwise.
I didn't do anything beyond making sure that go-webrtc and snowflake would compile for Android, because I don't know how the pluggable transport integration works on Android. eighthave was showing us a gomobile bind setup that doesn't use separate executables (requires patching out package main) and I didn't know if that was how it was going to be done.
Append target_os = [ 'android' ] to .gclient. I think it's safe to do across all targets, as it only affects what gets downloaded.
In gclient sync, echo n to not agree to the proprietary Google Play services license (also prevents the Play libraries from downloading). You could alternately patch out this check, etc.
In gn gen, set symbol_level=0. This is needed to actually disable debugging symbols; otherwise the libwebrtc is like 100 MB.
Upstream we are using Google's prebuilt arm-linux-androideabi-ar, but it would be better to build your own.
In projects/snowflake/config:
Set GOOS=androidGOARCH=arm.
You may have to copy webrtc-android-armeabi-v7a.pc over webrtc-linux-arm.pc, as in eighthave's script.
dcf: do you have a script/instructions somewhere on how to build the whole thing which we could then translate into our tor-browser-build process? If you plan to do that work yourself, you are more than welcome! :). We'll likely put that on our plate otherwise.
I didn't do anything beyond making sure that go-webrtc and snowflake would compile for Android, because I don't know how the pluggable transport integration works on Android. eighthave was showing us a gomobile bind setup that doesn't use separate executables (requires patching out package main) and I didn't know if that was how it was going to be done.
Append target_os = [ 'android' ] to .gclient. I think it's safe to do across all targets, as it only affects what gets downloaded.
In gclient sync, echo n to not agree to the proprietary Google Play services license (also prevents the Play libraries from downloading). You could alternately patch out this check, etc.
In gn gen, set symbol_level=0. This is needed to actually disable debugging symbols; otherwise the libwebrtc is like 100 MB.
Upstream we are using Google's prebuilt arm-linux-androideabi-ar, but it would be better to build your own.
In projects/snowflake/config:
Set GOOS=androidGOARCH=arm.
You may have to copy webrtc-android-armeabi-v7a.pc over webrtc-linux-arm.pc, as in eighthave's script.
I did not check yet that the build is reproducible.
They are not but it seems we are close. Just libgojni.so differs for me with what seems to be mostly different tmp directories being used during build:
They are not but it seems we are close. Just libgojni.so differs for me with what seems to be mostly different tmp directories being used during build:
These are reminiscent of the mismatches in comment:4:ticket:22831. There, we dealt with it by running a sed command to clobber random paths of the form /tmp/go-buildXXXXXXXXX and /tmp/go-link-XXXXXXXXX. In this case, it looks like /tmp/gomobile-work-XXXXXXXXX is needed as well.
Not sure about the other one either, though. It doesn't look like a timestamp.
However there was still an issue with a /tmp/go-buildXXXXXXXXX. I tried fixing it with a sed -i -E -e 's#(/tmp/go-build|/tmp/go-link-)[None..None](../compare/None...None){9}/#\1XXXXXXXXX/#g' libgojni.so, but this did not fix the issue completely as there was still differences after that:
Thanks! It seems I got reproducible builds now, nice! Here come some review notes:
93b7f904ec931c56adf9f84b50756cf2f7776f38 -- okay
524f9d9b6cfc6418e237fcd6c5264bb301a2411f -- okay
093ab72ddc37be1f4932213c4a78ff1e55348500 -- not okay;
So, we need a particular OpenSSL version or is the one in Stretch just too old? Could you add a
comment here explaining what happens (and ideally pointing to the problematic
code)?
+ target_os = ["win", "android"] -- we don't target Windows right now and should leave that target out
What's the reason for moving the gclient config part outside of the if [ ! -d "src"] one, in particular as this affects non-Android platforms as well. And what does it mean? That it is
not run for Linux and macOS anymore?
We could change the GN_ARGS-adding parts to
[% IF c("var/linux") -%] GN_ARGS+=[% ELSIF c("var/osx") -%] GN_ARGS+=[% ELSIF c("var/android") -%] GN_ARGS+=[% END -%]
commit 082b4fd8759ef9e88317940d77d091291d0363df -- not okay; Just copying the .aar over does not mean it gets included into the final result. I think we'd need to update the android-dependencies.patch file for that as well. However, I am not exactly sure about the way forward here as the .aar approach seems to be in line with https://github.com/guardianproject/AndroidPluggableTransports but that's not how we currently utilize PTs on mobile which is having a binary like we do on desktop. I'll bring this as a topic for the meeting discussion up today.
Trac: Status: needs_review to needs_revision Keywords: TorBrowserTeam201906R deleted, TorBrowserTeam201907 added
What's the reason for moving the gclient config part outside of the if [ ! -d "src"] one, in particular as this affects non-Android platforms as well. And what does it mean? That it is
not run for Linux and macOS anymore?
If the gclient config is behind the if [ ! -d "src"], then changes to gclient config are not taken into account unless we remove the src directory. So moving it outside allows us to update this config without removing the src directory.
It seems we should have a patch moving that part outside of the if [ ! -d "src"] on the stable branch too, otherwise building master will update the gclient config, and then building stable will keep using the master version of the gclient config.
The target_os line means fetching dependencies specific for those platforms. It seems we don't need specific dependencies for the Linux and macOS builds as we had no target_os defined before.
With this change we will fetch Android dependencies (and Windows ones, but we can remove it for now), and will include it in the webrtc tarball used for every platforms. This means we include some dependencies not needed in the Linux and macOS builds, but this avoids generating one tarball for each platform.
What's the reason for moving the gclient config part outside of the if [ ! -d "src"] one, in particular as this affects non-Android platforms as well. And what does it mean? That it is
not run for Linux and macOS anymore?
If the gclient config is behind the if [ ! -d "src"], then changes to gclient config are not taken into account unless we remove the src directory. So moving it outside allows us to update this config without removing the src directory.
It seems we should have a patch moving that part outside of the if [ ! -d "src"] on the stable branch too, otherwise building master will update the gclient config, and then building stable will keep using the master version of the gclient config.
Okay, sounds reasonable. Yes, we should keep that in mind once we need this on stable (which we currently don't do).
The target_os line means fetching dependencies specific for those platforms. It seems we don't need specific dependencies for the Linux and macOS builds as we had no target_os defined before.
With this change we will fetch Android dependencies (and Windows ones, but we can remove it for now), and will include it in the webrtc tarball used for every platforms. This means we include some dependencies not needed in the Linux and macOS builds, but this avoids generating one tarball for each platform.
Yes, that seemed to be perfectly reasonable. Just the Windows part is not needed yet (maybe not even ever given the build issues), thus let's remove it for now.
Hmm okay it seems that this ticket is just for building snowflake and legacy/trac#30318 (moved) is for integrating with Tor Browser. I'll put this in needs_review then since reproducible builds are now working.
Okay here's an additional commit on the snowflake_android branch that bundles snowflake with tor browser for android. I followed the same procedure used for obfs4 to enable it only for alpha and nightlies in rbm.conf and bundle it with tor-onion-proxy-library.
Okay here's an additional commit on the snowflake_android branch that bundles snowflake with tor browser for android. I followed the same procedure used for obfs4 to enable it only for alpha and nightlies in rbm.conf and bundle it with tor-onion-proxy-library.
So, it turns out that Pluto is actually not bundling snowflake at all. I guess you could just copy snowflake-client over in the for loop already dealing with obfs4proxy. I am not sure why we actually copy things over to all the different arch dirs given that we build per arch, but that's up for a different bug.
Please squash the commits and rebase onto latest master, we are close with this ticket (modulo testing that things actually work) I think. Thanks.
So, it turns out that Pluto is actually not bundling snowflake at all. I guess you could just copy snowflake-client over in the for loop already dealing with obfs4proxy. I am not sure why we actually copy things over to all the different arch dirs given that we build per arch, but that's up for a different bug.
I was going to ask what Pluto is and how it knows about obfs4. Does it need to build snowflake?
Please squash the commits and rebase onto latest master, we are close with this ticket (modulo testing that things actually work) I think. Thanks.
So, it turns out that Pluto is actually not bundling snowflake at all. I guess you could just copy snowflake-client over in the for loop already dealing with obfs4proxy. I am not sure why we actually copy things over to all the different arch dirs given that we build per arch, but that's up for a different bug.
I was going to ask what Pluto is and how it knows about obfs4. Does it need to build snowflake?
Pluto is the Guardian Project's pluggable transport library which is deprecated. We should redo at some point the whole tor-android-service/tor-onion-proxy-library parts which use Pluto but for now we just play along. :)
Please squash the commits and rebase onto latest master, we are close with this ticket (modulo testing that things actually work) I think. Thanks.
Thanks. Let's just use one for loop maybe (see my previous comment), like so (untested):
# Extract obfs4proxy from TorBrowser/Tor/PluggableTransports/obfs4proxytar --strip-components=4 -xf $rootdir/[% c('input_files_by_name/obfs4') %]# Extract snowflake from TorBrowser/Tor/PluggableTransports/snowflaketar --strip-components=4 -xf $rootdir/[% c('input_files_by_name/snowflake') %]# Overwrite the obfs4proxy binary provided by Pluto and add snowflakefor d in external/pluto/bin/*; do cp obfs4proxy $d/ cp snowflake-client $d/donerm obfs4proxyrm snowflake-client
? I don't think we need two separate for loops for what we want to do.
I'll try to come up with some patches for legacy/trac#30318 (moved) over the weekend (I copy and pasted things for the browser part already I believe), so we can actually test on mobile.
Trac: Status: needs_review to needs_revision Keywords: TorBrowserTeam202005R deleted, TorBrowserTeam202005 added