Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
S
Snowflake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 41
    • Issues 41
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • The Tor Project
    • A
      Anti-censorship
  • Pluggable Transports
  • Snowflake
  • Issues
  • #40004

Closed
Open
Opened Jul 21, 2020 by eighthave@eighthave

exporting Go functions make the Android build 4x larger

I just noticed that the snowflakeclient.aar that I've been building has ballooned in size from ~5mb to ~25mb by exporting a single function. Perhaps gomobile bind stops stripping the binary then? This is the diff that made it happen:

diff --git a/client/snowflake.go b/client/snowflake.go
index 02bbf1e..c024cd2 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -93,14 +93,14 @@ func parseIceServers(s string) []webrtc.ICEServer {
        return servers
 }
 
-func main() {
-       iceServersCommas := flag.String("ice", "", "comma-separated list of ICE servers")
-       brokerURL := flag.String("url", "", "URL of signaling broker")
-       frontDomain := flag.String("front", "", "front domain")
-       logFilename := flag.String("log", "", "name of log file")
-       logToStateDir := flag.Bool("log-to-state-dir", false, "resolve the log file relative to tor's pt state dir")
+func Load() {
+       iceServersCommas := flag.String("ice", "stun:stun.l.google.com:19302", "comma-separated list of ICE servers")
+       brokerURL := flag.String("url", "https://snowflake-broker.azureedge.net/", "URL of signaling broker")
+       frontDomain := flag.String("front", "ajax.aspnetcdn.com", "front domain")
+       logFilename := flag.String("log", "snowflakeclient.log", "name of log file")
+       logToStateDir := flag.Bool("log-to-state-dir", true, "resolve the log file relative to tor's pt state dir")
        keepLocalAddresses := flag.Bool("keep-local-addresses", false, "keep local LAN address ICE candidates")
-       unsafeLogging := flag.Bool("unsafe-logging", false, "prevent logs from being scrubbed")
+       unsafeLogging := flag.Bool("unsafe-logging", true, "prevent logs from being scrubbed")
        max := flag.Int("max", DefaultSnowflakeCapacity,
                "capacity for number of multiplexed WebRTC peers")

Here are two builds with binary artifacts to compare:

  • https://gitlab.torproject.org/eighthave/snowflake/-/jobs/659
  • https://gitlab.torproject.org/eighthave/snowflake/-/jobs/721

@n8fr8

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: tpo/anti-censorship/pluggable-transports/snowflake#40004