Opened 2 months ago

Closed 2 months ago

#28752 closed defect (fixed)

Gradle sometimes downloads tor-android-binary resources during build (or the build is failing)

Reported by: gk Owned by: tbb-team
Priority: Very High Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, tbb-rbm, TorBrowserTeam201812R, TBA-a3
Cc: sisbell Actual Points:
Parent ID: Points:
Reviewer: Sponsor: Sponsor8

Description

I saw a failing builds in comment:42:ticket:27977 and later on complaining about missing tor-android-binary resources (*.pom and *.aar). Today I saw a build where Gradle is even downloading both files during build. I double-checked and they are available in gradle-dependecies-3 which we use during build, which is pretty concerning.

We should figure our what is going on here.

Child Tickets

Change History (14)

comment:1 Changed 2 months ago by gk

Cc: sisbell added

comment:2 Changed 2 months ago by sisbell

Gradle offline is flagged so it shouldn't download anything (although there can always be a bug in gradle). It could be that the files are not actually downloading even though the logs say it is attempting download. Did the build say it was downloading and then pass the build. Or did it say it was downloading and then fail the build?

Last edited 2 months ago by sisbell (previous) (diff)

comment:3 in reply to:  2 Changed 2 months ago by gk

Replying to sisbell:

Gradle offline is flagged so it shouldn't download anything (although there can always be a bug in gradle). It could be that the files are not actually downloading even though the logs say it is attempting download. Did the build say it was downloading and then pass the build. Or did it say it was downloading and then fail the build?

It says it was downloading

26:02.41 :geckoview:compileOfficialWithGeckoBinariesNoMinApiReleaseJavaWithJavac
26:02.43 Download https://raw.githubusercontent.com/guardianproject/gpmaven/master/org/torproject/tor-android-binary/0.3.4.9/tor-android-binary-0.3.4.9.pom
26:04.40 Download https://raw.githubusercontent.com/guardianproject/gpmaven/master/org/torproject/tor-android-binary/0.3.4.9/tor-android-binary-0.3.4.9.aar
26:04.91 :app:generateOfficialWithoutGeckoBinariesNoMinApiPhotonDebugAndroidTestResValues

and then the build passed. My guess is that in the rare cases I saw the build failures this resulted in the download failing for some reason. And later on the missing dependencies were not available.

The big question is why it is downloading those things and just those two even though we bundled everything.

comment:4 Changed 2 months ago by gk

Keywords: TBA-a3 added

Setting tag for third Tor Browser for Android alpha milestone.

comment:5 Changed 2 months ago by gk

Sponsor: Sponsor8

Adding Sponsor8 tag.

comment:6 Changed 2 months ago by sisbell

We don't see the tor-android-binary download during the orbot build but we see it in the firefox build. The reason is that orbot is moving the artifact to the correct gradle cache location during its build. Firefox build is not. I'll get in a fix shortly.

comment:7 Changed 2 months ago by sisbell

I've got the fix ready but the current build is giving me an error in the firefox-locale-bundle. It looks like a perl module isn't installed.

Can't locate JSON.pm in @INC (you may need to install the JSON module)
....
BEGIN failed--compilation aborted at /home/shane/github/tor-browser-4/projects/firefox-locale-bundle/get_hg_hash line 4.

comment:8 in reply to:  7 Changed 2 months ago by gk

Replying to sisbell:

I've got the fix ready but the current build is giving me an error in the firefox-locale-bundle. It looks like a perl module isn't installed.

Can't locate JSON.pm in @INC (you may need to install the JSON module)
....
BEGIN failed--compilation aborted at /home/shane/github/tor-browser-4/projects/firefox-locale-bundle/get_hg_hash line 4.

Yes, you need to install that perl module on your build machine, see the README and the commit message of commit 56ce89fe1a99c304b7292a7087ae8d0ad2412273.

comment:9 Changed 2 months ago by sisbell

Changes (android-1216)

  • Copy the tor-android-binary files to correct location in the gradle repo (firefox project). This fixes the download issue.

comment:10 Changed 2 months ago by sisbell

Status: newneeds_review

comment:11 Changed 2 months ago by gk

Status: needs_reviewneeds_revision

I've not tested it yet but some small nits while reading through the changes:

1) s/assumes artifact package/assumes the artifact package/
2) s/artifacts to correct location/artifacts to the correct location./

Last edited 2 months ago by gk (previous) (diff)

comment:12 Changed 2 months ago by gk

The fix looks good and works for me. Please address the nits in comment:11 and we can get this landed, thanks!

comment:13 Changed 2 months ago by sisbell

Status: needs_revisionneeds_review

Changes (android-1219)

  • Changes as suggested in comment:11

comment:14 Changed 2 months ago by gk

Keywords: TorBrowserTeam201812R added; TorBrowserTeam201812 removed
Resolution: fixed
Status: needs_reviewclosed

Cherry-picked to master (9b0b7b5159e670e04d5705350f33f8b2aa056634) (and I shortened the subject line of your commit message a bit).

Note: See TracTickets for help on using tickets.