Closed Bug 1820125 Opened 2 years ago Closed 2 years ago

firefox-android: `.buildconfig.yml` doesn't contain transitive dependencies

Categories

(Release Engineering :: General, defect)

defect

Tracking

(firefox112 fixed)

RESOLVED FIXED
Tracking Status
firefox112 --- fixed

People

(Reporter: jlorenzo, Assigned: jlorenzo)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

What happened then?

In bug 1788606, we output the internal upstream dependencies of each Android-Component and browser app in .buildconfig.yml. This enables the decision task to run faster. Before then, the decision task used the gradle parser wrote in [1], 3 years ago.

In bug 1807237, we split the external-gradle-dependencies task into multiple ones (one per Android-Component or browser app). This reduced the overall time to get gradle upstream dependencies cached on Taskcluster.

What's going on today?

The combination of these 2 optimizations unveiled a 3-year-old bug in the said gradle parser. This PR[2] is busted because the gradle cache for compose-engine doesn't contain a transitive dependency (com.google.android.material) declared in support-ktx:

[task 2023-03-02T09:50:02.211Z] FAILURE: Build completed with 2 failures.
[task 2023-03-02T09:50:02.211Z] 
[task 2023-03-02T09:50:02.211Z] 1: Task failed with an exception.
[task 2023-03-02T09:50:02.211Z] -----------
[task 2023-03-02T09:50:02.211Z] * What went wrong:
[task 2023-03-02T09:50:02.211Z] Execution failed for task ':compose-engine:mapReleaseSourceSetPaths'.
[task 2023-03-02T09:50:02.211Z] > Could not resolve all files for configuration ':compose-engine:releaseRuntimeClasspath'.
[task 2023-03-02T09:50:02.211Z]    > Could not find com.google.android.material:material:1.2.1.
[task 2023-03-02T09:50:02.211Z]      Required by:
[task 2023-03-02T09:50:02.211Z]          project :compose-engine > project :browser-state > project :support-utils
[task 2023-03-02T09:50:02.211Z]          project :compose-engine > project :browser-state > project :support-ktx

The thing is: support-ktx is not declared as an upstream dependency of compose-engine[4]. The reason is: it was never explicitly declared as such in the corresponding build.gradle file. Tom White worked around the problem by making support-ktx explicit.

How can we improve the situation?

We must make the gradle parser smarter. It must detect every internal upstream dependencies including transitive ones.

While today's bug is the result of 2 successive optimizations, we've been definitely prone to this class of bugs since the introduction of this parser, 3 years ago. This means, we've been lucky that no one introduced a bug that was discovered after the PR got merged to main.

[1] https://github.com/mozilla-mobile/android-components/pull/7617
[2] https://github.com/mozilla-mobile/firefox-android/pull/948
[3] https://github.com/mozilla-mobile/firefox-android/pull/948/checks?check_run_id=11710964658
[4] https://github.com/mozilla-mobile/firefox-android/blob/0281b2c8b919888ca181410510b184f085fdbc6e/android-components/.buildconfig.yml#L185-L193

Bug 1795152 is about making the parser better. This current bug won't change the output of gradle, though. It will just be better at finding the local dependencies.

Blocks: 1795152
Assignee: nobody → jlorenzo
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: qe-verify+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: