Use #ifdef for mozilla::IsDevelopmentBuild?
Categories
(Core :: XPCOM, task)
Tracking
()
People
(Reporter: saschanaz, Unassigned)
Details
mozilla::IsDevelopmentBuild is enabled for all channel and checks the existence of Omnijar, but can we instead implement it with #ifdef instead to make it affect only dev builds? It is only for dev builds, so doing so makes sense. 🤔
Updated•4 years ago
|
| Reporter | ||
Comment 1•4 years ago
|
||
There's no macro for dev build but there is NIGHTLY_BUILD. Reusing it is probably the easiest way to reduce the number of affected installations significantly.
Comment 2•4 years ago
|
||
There is developer_options in moz.build, but it depends on the use case.
| Reporter | ||
Comment 3•4 years ago
|
||
{Build|Do not build} with more conservative, release engineering-oriented options.
Totally makes sense, thanks! So that would be #ifdef DEVELOPER_OPTIONS.
Comment 4•4 years ago
|
||
It's not an ifdef, you'd need to set_define("MOZ_DEVELOPER_OPTIONS", developer_options) or so.
Comment 5•4 years ago
|
||
The name IsDevelopmentBuild doesn't not actually reflect what it's after. What it's after is actually IsPackagedBuild. And that's not something that should be ifdef'ed.
| Reporter | ||
Comment 6•4 years ago
|
||
Does it mean this should be at least be renamed for the renaming? Hmm.
Comment 7•4 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #5)
The name IsDevelopmentBuild doesn't not actually reflect what it's after. What it's after is actually IsPackagedBuild. And that's not something that should be ifdef'ed.
While this is true (I also mentioned whether the function should be renamed in my review comment that triggered this), it is I believe always used as a proxy for a development build.
These might contain symlinks back to the developer repo and it is used to deal with the implications of that.
So, maybe those should be #ifdefed? ... but if everything that calls it is, then perhaps it should be as well?
Comment 8•4 years ago
|
||
With a #ifdef on MOZ_DEVELOPER_OPTIONS, e.g. locally building beta, release or esr will yield a version that doesn't work (because it doesn't define MOZ_DEVELOPER_OPTIONS unless you also --disable-release).
Comment 9•4 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #8)
With a
#ifdefonMOZ_DEVELOPER_OPTIONS, e.g. locally building beta, release or esr will yield a version that doesn't work (because it doesn't defineMOZ_DEVELOPER_OPTIONSunless you also--disable-release).
So perhaps MOZ_DEVELOPER_OPTIONS is the wrong thing to use, but is the principle that it should be #ifed correct?
Comment 10•4 years ago
|
||
The problem is that the build in dist/bin is always with symlinks, and the build in dist/firefox/dist/Firefox.app is always without. The former is what you get from ./mach build, the latter is what you get from ./mach package (and is derived from the former). So there really is nothing you can #if that could apply to both, since they use the same binaries.
Description
•