Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 750455 - www-client/firefox - consider setting MOZILLA_OFFICIAL for builds
Summary: www-client/firefox - consider setting MOZILLA_OFFICIAL for builds
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-20 18:07 UTC by Daniel Harding
Modified: 2020-11-07 12:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Harding 2020-10-20 18:07:53 UTC
For Firefox, MOZILLA_OFFICIAL is used to differentiate between development builds and release builds.  The fact that Gentoo produces development builds is evidenced by the "Restart (Developer)" menu item in the File menu.

MOZILLA_OFFICIAL is set when building Firefox for at least the following distributions:

Debian:
https://salsa.debian.org/mozilla-team/firefox/-/blob/0fe05fac43746b77af7d62cf8b43ec46bd95bb35/debian/rules#L40

Fedora:
https://src.fedoraproject.org/rpms/firefox/blob/85160fd5ada4c253df27ca0a6136ec6b53200135/f/firefox-mozconfig#_20

Arch:
https://github.com/archlinux/svntogit-packages/blob/ff41f1b148dfce83720638ea4eed4e7e0a852887/trunk/PKGBUILD#L85

OpenSUSE:
https://build.opensuse.org/package/view_file/openSUSE:Factory/MozillaFirefox/MozillaFirefox.spec?rev=d6073d840d211e44cd4800793c36c393

It would be nice for Gentoo to be able to produce release builds as well, or at least to provide an "official" USE flag for www-client/firefox (as was recently added for www-client/chromium) that would enable MOZILLA_OFFICIAL during the build.

Regardless, a huge thank you to Thomas for your tireless work to keep current versions of Firefox available to us within Gentoo!
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2020-10-20 20:43:34 UTC
I am not sure if I understand this bug report.

May I ask what you believe 'MOZILLA_OFFICIAL' is doing?

And may I ask what are you missing in Gentoo's ebuilds? We do set official branding and enable release configuration (https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firefox-82.0.ebuild?id=e6e716a02fc0665e6f88ea775c28de72499057f0#n649) already. So what are you really missing?

Or let me rephrase: How do you (believe you) noticed that firefox was built without MOZILLA_OFFICIAL in Gentoo?
Comment 2 Daniel Harding 2020-10-21 10:41:06 UTC
As I mentioned in my initial comment, the primary indication that MOZILLA_OFFICIAL is not set is the presence of the "Restart (Developer)" menu item item in the File menu.

The creation of this menu being gated by MOZILLA_OFFICIAL can be seen in the code here:
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/browser/base/content/browser.js#2038
and here:
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/browser/base/content/browser-development-helpers.js#10

I can confirm that if I patch my build of Firefox to set MOZILLA_OFFICIAL, that menu item goes away.

A full search of where MOZILLA_OFFICIAL is used can be found here:
https://searchfox.org/mozilla-central/search?q=MOZILLA_OFFICIAL&path=&case=false&regexp=false

There are several comments in the codebase indicating that MOZILLA_OFFICIAL distinguishes between builds made locally by Firefox developers and builds made for distribution:
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/toolkit/modules/AppConstants.jsm#54
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/devtools/client/framework/browser-toolbox/Launcher.jsm#280
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/toolkit/components/telemetry/app/TelemetryControllerParent.jsm#1225

Among other things, enabling MOZILLA_OFFICIAL disables the DevTools Fission preferences:
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/devtools/client/definitions.js#518
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/browser/app/profile/firefox.js#2107

It also disables loading of the 'browser-development-helpers.js' script:
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/browser/base/content/browser.xhtml#96
https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/browser/app/profile/firefox.js#2107

As best as I can understand, builds made by Firefox developers on their local systems are intended to be built without MOZILLA_OFFICIAL, while builds to be distributed to users should be built with MOZILLA_OFFICIAL.

I suggested this change because I thought it might be helpful for the wider Gentoo community.  If not, that's fine too - I'm happy to simply patch my local builds if that is better.
Comment 3 Larry the Git Cow gentoo-dev 2020-10-21 17:11:28 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5053e8cd50c31d0f775b97db6f12c2a1c7e9846

commit d5053e8cd50c31d0f775b97db6f12c2a1c7e9846
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-10-21 16:44:55 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-10-21 17:11:10 +0000

    www-client/firefox: Set MOZILLA_OFFICIAL=1
    
    Closes: https://bugs.gentoo.org/750455
    Package-Manager: Portage-3.0.8, Repoman-3.0.2
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 www-client/firefox/firefox-78.4.0.ebuild | 2 ++
 www-client/firefox/firefox-82.0.ebuild   | 2 ++
 2 files changed, 4 insertions(+)
Comment 4 Daniel Harding 2020-10-22 10:28:53 UTC
Confirmed the fix - thanks for the quick response!
Comment 5 Jon Feldman 2020-11-07 12:05:34 UTC
Can this be turned into a USE flag like originally requested?

I personally rely on my builds having MOZILLA_OFFICIAL disabled - I regularly use the 'Restart (Developer)' option. Seeing it go missing after the latest update with no warning was not a pleasant surprise to me.