Closed Bug 1464953 Opened 7 years ago Closed 7 years ago

Built-in addons don't work on unpacked firefox

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: glandium, Unassigned)

References

Details

STR: - Download a nightly, beta, release, whichever. - Unpack it. - From a mozilla-central checkout, run ./mach python toolkit/mozapps/installer/unpack.py /path/to/firefox/directory - Run Firefox from there. Expected result: - A full featured Firefox. Actual result: - None of the built-in addons is found/enabled, so e.g. about:newtab is busted. There are multiple messages in the browser console like the following: addons.xpi-utils WARN addMetadata: Add-on activity-stream@mozilla.org is invalid: [Exception... "Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIFile.isFile]" nsresult: "0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: get :: line 228" data: no] Stack trace: get()@resource://gre/modules/addons/XPIInstall.jsm:228 loadManifestFromFile()@resource://gre/modules/addons/XPIInstall.jsm:857 The problem stems from code added in bug 1348981, specifically, this part: https://dxr.mozilla.org/mozilla-central/rev/a466172aed4bc2afc21169b749b8068a4b98c93f/toolkit/mozapps/extensions/internal/XPIProvider.jsm#966-972 (which explains why it's not reproducible when running Firefox from a local build's dist/bin, where the directory structure is similar)
We only support unpacked system add-ons when running unofficial builds. Supporting them in local builds requires an extra stat for each one, which isn't acceptable for production builds. So the best solution is probably for unpack.py to not unpack system add-ons in branded builds.
It doesn't require a stat on the non-xpi file if the xpi file exists. I don't see why that would be a problem for production builds. If the concern is about multiple stats on the xpi file, well, that's already happening. I'm seeing 8 stats of activity-stream@mozilla.org/xpi on the main process.
When we're running in a branded build, we don't stat the XPI at all, we just assume the extension is a packed XPI. In unbranded builds, we stat to check whether the XPI exists before falling back to the directory. There are stats in some other parts of the codebase, I'm sure, but those mostly happen after we've determined the location of the XPI, and in general, we're moving towards reducing the number, not adding to it.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.