Open Bug 2035575 Opened 4 months ago Updated 11 hours ago

Wire in-tree application-services through the fat AAR and artifact-build pipelines

Categories

(Firefox Build System :: Android Studio and Gradle Integration, task, P2)

task

Tracking

(Not tracked)

REOPENED

People

(Reporter: ahochheiden, Assigned: ahochheiden)

References

(Depends on 1 open bug)

Details

(Keywords: leave-open)

Attachments

(22 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

With --enable-appservices-in-tree, application-services builds locally but its outputs (the full-megazord AAR, component AARs, and the desktop libmegazord.so consumed by Android JVM unit tests via libsForTests) aren't yet wired through the fat AAR pipeline or downloadable in artifact builds. We need to package the megazord and its NSS runtime dependencies into the fat AAR alongside geckoview, publish all a-s AARs to local maven during fat AAR builds, generalize artifact downloads so that artifact builds pull in-tree a-s outputs, and add desktop architecture support so libsForTests consumes the in-tree desktop megazord.

Blocks: 2035579
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/770110e8ec2c https://hg.mozilla.org/integration/autoland/rev/fec3cd1adcbf Revert "Bug 2035575 - Replace `--maven-zip` with general-purpose `--artifact-filter` for artifact downloads r=nalexander,firefox-build-system-reviewers"

Backed out for causing Android multi-arch fat AAR Shippable bustages

Flags: needinfo?(ahochheiden)
Pushed by nfay@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/34156e006095 https://hg.mozilla.org/mozilla-central/rev/91d63a7b3380 Replace `--maven-zip` with general-purpose `--artifact-filter` for artifact downloads r=nalexander,firefox-build-system-reviewers
Flags: needinfo?(ahochheiden)
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/236a5b3aae03 https://hg.mozilla.org/integration/autoland/rev/10187cf63c32 Replace `--maven-zip` with general-purpose `--artifact-filter` for artifact downloads r=nalexander,firefox-build-system-reviewers
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---
Target Milestone: 152 Branch → ---
Attachment #9583584 - Attachment description: Bug 2035575 - Integrate megazord AAR into fat AAR pipeline alongside geckoview r?nalexander → Bug 2035575 - Extract Android and host native libraries from `target.maven.zip` for artifact builds r?#build,nalexander

The fat AAR build needs the full-megazord AAR alongside geckoview's. The
megazord output lands under appservices/, and artifact builds fetch
target.maven.zip so they pick up both AARs.

The geckoview archive build also publishes every app-services component
(via :publishAppServicesAndroid), not just the megazord, so the
standalone android-components and fenix builds can resolve them as Maven
AARs from target.maven.zip.

Attachment #9583589 - Attachment description: Bug 2035575 - Support artifact builds and JVM test native lib extraction for `libsForTests` r?nalexander → Bug 2035575 - Extract `libsForTests` native libraries for JVM unit tests r?nalexander
Attachment #9583590 - Attachment is obsolete: true
Attachment #9583590 - Attachment is obsolete: false
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8b524f6db8fd https://hg.mozilla.org/integration/autoland/rev/221becbf5090 Namespace fat-AAR output under geckoview r=nalexander,geckoview-reviewers https://github.com/mozilla-firefox/firefox/commit/663d2a7510ad https://hg.mozilla.org/integration/autoland/rev/0de553b56b80 Extract Android and host native libraries from `target.maven.zip` for artifact builds r=nalexander,geckoview-reviewers
Attachment #9583590 - Attachment description: Bug 2035575 - Enable `--appservices-in-tree` by default on all platforms r?#build,nalexander → WIP: Bug 2035575 - Enable `--appservices-in-tree` by default on all platforms r?#build,nalexander

The full megazord applies it via consumerProguardFiles, so excluding it from
vendoring breaks the build at mergeReleaseConsumerProguardFiles.

Attachment #9614046 - Attachment description: WIP: Bug 2035575 - Reuse the in-tree glean_parser venv for glean-build on Android → Bug 2035575 - Point the Android `glean-build` at the `glean_parser` venv r?#build,nalexander

Backed out for causing BR bustages

Attachment #9583588 - Attachment description: Bug 2035575 - Add desktop architecture support (Linux, macOS, Windows) to fat AAR pipeline for `libsForTests` r?#build,nalexander → WIP: Bug 2035575 - Add desktop architecture support (Linux, macOS, Windows) to fat AAR pipeline for `libsForTests` r?#build,nalexander
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/87a9fad7336c https://hg.mozilla.org/integration/autoland/rev/cc90095f1c0e Point the Android `glean-build` at the `glean_parser` venv r=nalexander,firefox-build-system-reviewers,geckoview-reviewers
Flags: needinfo?(ahochheiden)

Thanks.

Flags: needinfo?(ahochheiden)
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b4005d0833dd https://hg.mozilla.org/integration/autoland/rev/326d8f50bf72 Point the Android `glean-build` at the `glean_parser` venv r=nalexander,firefox-build-system-reviewers,geckoview-reviewers
Attachment #9583588 - Attachment description: WIP: Bug 2035575 - Add desktop architecture support (Linux, macOS, Windows) to fat AAR pipeline for `libsForTests` r?#build,nalexander → Bug 2035575 - Add desktop architecture support (Linux, macOS, Windows) to the fat AAR pipeline for `libsForTests` r?#build,nalexander

Manually duplicating every task definition produced by a kind lets the copy
drift as the source changes. Test variants already avoid this for individual
test tasks, but differences compiled into artifacts require varying the whole
kind so each configuration gets its own build.

This will be deleted once app-services in tree is enabled by default. The
duplicate tasks are set to tier 3 so that a regression in app-services does
not cause a backout, and a daily cron job schedules them to minimize the cost
of the duplicate set of tasks. We will monitor it for a while before committing
to app-services in tree being the CI default.

A module definition file needs literal symbol names, so the patterns a symbol
pattern file holds are resolved against the static library the shared library
is linked from.

A generated file that takes a Rust archive as input needs the Rust library
built first, but Cargo produces the archive as a side effect of the Rust
library target, so no rule names it and Make cannot order the two.

A library whose symbols are resolved by name at run time has nothing
referencing them at link time, so the linker keeps none of the archive members
that define them.

UniFFI symbols are resolved by name at run time, but the stub retained only one
archive member per crate and did not populate the Windows export table.
Non-Windows builds now link the Rust archive whole, while Windows generates a
.def from its selected symbols.

Linking the archive whole also pulls in mozpkix, so only Windows links it
separately. All platforms now export only the selected ABI.

libmegazord.so is loaded through JNA rather than linked into libxul.
Linking it against mozglue makes Rust's free resolve to mozjemalloc,
while bionic APIs such as realpath return allocations owned by libc,
causing Fenix to crash during startup. Depending on nss preserves the build
order, so Cargo still cannot run before libmozglue.so exists.

Folded NSS continues to use mozjemalloc. Rust never takes ownership of NSS
allocations and releases NSS objects through NSS APIs. The check_binary guard
runs only in automation and prevents a direct libmozglue.so dependency from
returning.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8d5e2d55eb2d https://hg.mozilla.org/integration/autoland/rev/f59460d18424 Package `libmegazord.so` as an extra archive for downstream consumers r=nalexander,firefox-build-system-reviewers https://github.com/mozilla-firefox/firefox/commit/cfefd2d06bc5 https://hg.mozilla.org/integration/autoland/rev/3bfae93a3f53 Stage `libmegazord.so` under appservices destdir for `libsForTests` gradle tasks r=nalexander,firefox-build-system-reviewers,geckoview-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/0a9b29deab78 https://hg.mozilla.org/integration/autoland/rev/2d8fa11ba9ed Integrate megazord AAR into fat AAR pipeline alongside geckoview r=nalexander,geckoview-reviewers https://github.com/mozilla-firefox/firefox/commit/cc9172f8ccfb https://hg.mozilla.org/integration/autoland/rev/6486c9763b40 Normalize app-services groupId and gate subproject inclusion on dependency-download context r=nalexander,android-reviewers https://github.com/mozilla-firefox/firefox/commit/2ee56ae7d616 https://hg.mozilla.org/integration/autoland/rev/2d5b8957876e Include NSS runtime dependencies in megazord extra archive for desktop `libsForTests` r=nalexander,firefox-build-system-reviewers https://github.com/mozilla-firefox/firefox/commit/88a848b4b851 https://hg.mozilla.org/integration/autoland/rev/4fafadaf5483 Extract `libsForTests` native libraries for JVM unit tests r=nalexander,geckoview-reviewers
Regressions: 2065509
Flags: needinfo?(ahochheiden)

This is also linked to failures for a version increase simulation pushed to Try today (firefox-main code, only some Firefox version numbers increased). See the failures for the last three platforms listed there. They are similar to the ones for a Try push for this bug.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a7fa9999fd9d https://hg.mozilla.org/integration/autoland/rev/c70faaf77543 Stop the Android megazord from freeing `bionic` memory with `mozjemalloc` r=firefox-build-system-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/bc856ca9c0ae https://hg.mozilla.org/integration/autoland/rev/e47ef1193b10 Package `libmegazord.so` as an extra archive for downstream consumers r=nalexander,firefox-build-system-reviewers https://github.com/mozilla-firefox/firefox/commit/b18ed3f1370a https://hg.mozilla.org/integration/autoland/rev/3c117c53449f Stage `libmegazord.so` under appservices destdir for `libsForTests` gradle tasks r=nalexander,firefox-build-system-reviewers,geckoview-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/0b3478add5d2 https://hg.mozilla.org/integration/autoland/rev/4be64d93d1b2 Integrate megazord AAR into fat AAR pipeline alongside geckoview r=nalexander,geckoview-reviewers https://github.com/mozilla-firefox/firefox/commit/9147aab02684 https://hg.mozilla.org/integration/autoland/rev/c62854db6762 Normalize app-services groupId and gate subproject inclusion on dependency-download context r=nalexander,android-reviewers https://github.com/mozilla-firefox/firefox/commit/e801d566be03 https://hg.mozilla.org/integration/autoland/rev/8c4d422c2b82 Include NSS runtime dependencies in megazord extra archive for desktop `libsForTests` r=nalexander,firefox-build-system-reviewers https://github.com/mozilla-firefox/firefox/commit/8de196ab6b58 https://hg.mozilla.org/integration/autoland/rev/693f59d5be8f Extract `libsForTests` native libraries for JVM unit tests r=nalexander,geckoview-reviewers
Attachment #9629005 - Attachment description: Bug 2035575 - Add a `variant_kind` transform to clone a kind's tasks with overrides r?ahal → Bug 2035575 - Add a `duplicate` transform to copy another kind's tasks with overrides r?ahal
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f0915e7abf67 https://hg.mozilla.org/integration/autoland/rev/18eec9ce96dc Let a generated file depend on a Rust library r=firefox-build-system-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/d5c733ee24bb https://hg.mozilla.org/integration/autoland/rev/77b132b5acfa Keep a confirm failure task from outranking the test it confirms r=ahal,taskgraph-reviewers
Attachment #9629007 - Attachment description: Bug 2035575 - Add an action to generate a module definition file from a COFF archive r?#build,nalexander → Bug 2035575 - Add an action to generate linker symbol inputs from a static archive r?#build,nalexander
Attachment #9629009 - Attachment is obsolete: true

The megazord stopped linking mozglue in D320332 so that a Rust free would
not reach bionic allocations. The vendored application-services no longer
calls std::fs::canonicalize on Android, so the megazord can use mozjemalloc
like every other Gecko library and the check_binary guard can assert the
dependency is present rather than absent.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/acc54bb6ef53 https://hg.mozilla.org/integration/autoland/rev/4838b6c7cabf Add an action to generate linker symbol inputs from a static archive r=firefox-build-system-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/d436c321ed7b https://hg.mozilla.org/integration/autoland/rev/a79ec6d1aadb Add desktop architecture support (Linux, macOS, Windows) to the fat AAR pipeline for `libsForTests` r=nalexander,firefox-build-system-reviewers,geckoview-reviewers https://github.com/mozilla-firefox/firefox/commit/5c2121970343 https://hg.mozilla.org/integration/autoland/rev/f77b2a48ba0e Export the megazord's UniFFI ABI without the symbol stub r=firefox-build-system-reviewers,sergesanspaille
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: