guardianproject / AndroidPluggableTransports

Android Pluggable Transports (aka PLUTO2)
https://www.pluggabletransports.info/
Other
28 stars 15 forks source link

Get Snowflake biuld via gomobile bind #9

Closed n8fr8 closed 3 years ago

n8fr8 commented 6 years ago

Another one: https://github.com/keroserene/snowflake

uumaro commented 5 years ago

Use https://git.torproject.org/pluggable-transports/snowflake.git rather than https://github.com/keroserene/snowflake please; the latter is now only a mirror.

n8fr8 commented 4 years ago

This is now where dev is happening... including pure go: https://github.com/cohosh/snowflake

eighthave commented 4 years ago

I was able to build an AAR from an old commit keroserene/snowflake@3bcd60ad106a6258048179c797089da79ab28214, donno if it is useful. The AAR is available here https://gitlab.com/eighthave/snowflake/-/jobs/622167415/artifacts/download

I'll try bisecting the project to find where it stopped building with gomobile.

eighthave commented 4 years ago

Figured it out: the build process was set up pre Go v1.11, which added the go.mod functionality. Adding go.mod to snowflake (keroserene/snowflake@920f6791f3ec8e7467c43ee0cefffe63200bed2b) broke the gomobile build. Setting GO111MODULE=off fixes the build: https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k

The build log and artifacts are here: https://gitlab.com/eighthave/snowflake/-/jobs/625228544

uumaro commented 4 years ago

In my opinion, you should use a more recent commit of snowflake. Anything 7043a055f or later will do. Not only does it remove the go-webrtc dependency which is no longer maintained, it has the Turbo Tunnel features that are encessary for a reasonable user experience. These are the features that enable a client to switch to a new temporary proxy when their old proxy goes away. (And, importantly, to get a working connection at all when the first polled proxy doesn't work, which for some types of NAT happens around 70% of the time.)

Tor Browser uses GO111MODULE=off so that's reasonable. It also sets CGO_ENABLED=1 for Android only; I'm not sure why, but a comment says the build breaks otherwise. 853e75e9 is the commit from #28672 that added Snowflake to Tor Browser 10.0a1.

uumaro commented 4 years ago

In my opinion, you should use a more recent commit of snowflake. Anything 7043a055f or later will do.

My bad; I just noticed from the build output that you are actually using a sufficiently new version of Snowflake. Never mind. I was confused by the earlier comment referring to https://github.com/keroserene/snowflake/commit/3bcd60ad106a6258048179c797089da79ab28214.

eighthave commented 4 years ago

Seems that this build process I just got working does not need CGO_ENABLED=, I never messed with it either way.

I'd like to submit my .gitlab-ci.yml in a merge request? Which git project is the place to do that these days?

uumaro commented 4 years ago

I'd like to submit my .gitlab-ci.yml in a merge request? Which git project is the place to do that these days?

https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake

eighthave commented 4 years ago

https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/4 has the build working without either CGO_ENABLED=1 or GO111MODULE=off

eighthave commented 3 years ago

@n8fr8 @tladesignz is this still relevant, given the new lib? I think its safe to close.

n8fr8 commented 3 years ago

Agreed, thanks. For anyone looking for Snowflake and our latest effort at a mobile friendly PT library, please check out: https://github.com/tladesignz/IPtProxy

eighthave commented 3 years ago

is it ready to have an official home in https://github.com/guardianproject?

tladesignz commented 3 years ago

Happy to move it, when you allow it!

eighthave commented 3 years ago

add me as an admin to your project, and I'll move it.