Closed Bug 1959718 Opened 8 months ago Closed 7 months ago

Create a new build project for browser extensions

Categories

(Firefox Build System :: General, task, P2)

task

Tracking

(firefox140 fixed)

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We are coming up with a plan to build and ship system addons out of mozilla-central. This way teams won't need to sync their system addons over to the mozilla-extensions org in Github.

The details are still being worked out, for instance it's not clear if all system addons will need to live in mozilla-central, or if we'll support both mozilla-central and mozilla-extensions.

The thing that is clear is that we'll need tasks in mozilla-central that:

  1. Build the system addon
  2. Sign the system addon
  3. Push the system addon to archive.mozilla.org
  4. Create a release in balrog for the system addon

Basically, copy / share the release pipeline from mozilla-extensions. We'll also want to integrate this with Shipit after the automation is all in place.

Assignee: nobody → ahal
Status: NEW → ASSIGNED

(taking a best guess at priority/severity - feel free to adjust)

Severity: -- → S2
Priority: -- → P2

Hey glandium,

I'm standing up some tasks to build the system addon in CI. Locally I can run, e.g ./mach build browser/extensions/newtab but this runs configure, so the full set of build dependencies are required, where I think in reality we only need the text prepropcessor. Do you have any tips on how to set things up to avoid configure / unnecessary build dependencies in CI?

Flags: needinfo?(mh+mozilla)

This is what I wrote in https://phabricator.services.mozilla.com/D239386?id=999656#inline-1338507:

considering your use case, another option for you would be to create a completely separate "project" rather than build the xpi as a side effect of a full build.

So, like, you'd build with --enable-project=browser/extensions/newtab and after mach build/mach package, you'd only get the xpi out.

So, adding moz.configure and app.mozbuild in browser/extensions/newtab, as well as a few other things.

Flags: needinfo?(mh+mozilla)

Thanks, I'm not sure if this is what it was intended for, but I found building with:
https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/source

still builds the extensions without the rest of the build. So unless there's a reason not to, I'm planning to use that. (Creating a separate project sounds a bit more complicated than I was hoping)

Thanks, I'm not sure if this is what it was intended for, but I found building with:
https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/source

Oops, this isn't actually true. Using this mozconfig does result in packaged .xpi files, but they are missing a bunch of things (like manifest.json) so are not valid extensions.

Glandium, I made this WIP patch that tries to follow your suggestion:
https://phabricator.services.mozilla.com/D246947

It works, but it still requires the full set of toolchains as part of configure. I'm guessing I need to disable unnecessary pieces explicitly in the moz.configure file? Do you know of any examples, docs or tips that can help me with this?

Flags: needinfo?(mh+mozilla)

Ok, so shortly after I posted this, I happened to stumble across this comment:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/mach_commands.py#3406

I tried it out on a whim, and it actually seems to work? E.g, with phab revision above applied, and a mozconfig like:

ac_add_options --enable-project=browser/extensions
ac_add_options --disable-compile-environment
export BUILD_BACKENDS=FasterMake,RecursiveMake

This appears to build the extensions without requiring any toolchains during configure. I guess I could try setting --disable-compile-environment and BUILD_BACKENDS in the moz.configure so a special mozconfig isn't required (beyond --enable-project).

I'm going to leave your needinfo glandium just in case I'm missing something here, after all the comment does warn that you should know what you're doing, and I certainly don't ><.

But I think I have a path forward.

Attachment #9481542 - Attachment description: WIP: Bug 1959718 - WIP: Build 'browser/extensions' as a separate project → Bug 1959718 - Create a new build project + variant for browser/extensions, r?#firefox-build-system-reviewers,glandium

You should be able to add imply_option("--enable-compile-environment", False) in your browser/extensions/moz.configure. I don't know why you'd need to set BUILD_BACKENDS.

Flags: needinfo?(mh+mozilla)

(In reply to Mike Hommey [:glandium] from comment #8)

You should be able to add imply_option("--enable-compile-environment", False) in your browser/extensions/moz.configure. I don't know why you'd need to set BUILD_BACKENDS.

It lets you do fancy l10n things, if you know just what you're doing.

I don't know why you'd need to set BUILD_BACKENDS.

I'll have to re-test to make sure, but without BUILD_BACKENDS the generated .xpi files were missing lots of files. With BUILD_BACKENDS, they were generated correctly. It's possible that something else made the difference and I just thought it was BUILD_BACKENDS.

I'm going to rename this bug to focus on only the Firefox build system bits, and then use bug 1927754 to track the necessary changes to the release pipeline in xpi-manifest.

Blocks: 1927754
Component: Release Automation → General
Product: Release Engineering → Firefox Build System
See Also: 1927754
Summary: Ability to ship system-addons out of mozilla-central → Create a new build project for browser extensions
Blocks: 1965311
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/76e46748fabe Create a new build project + variant for browser/extensions, r=glandium,firefox-build-system-reviewers
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: