Closed
Bug 1937701
Opened 11 months ago
Closed 11 months ago
Update python/mozbuild/mozbuild/repackaging/msix.py to support comments inside AppConstants.sys.mjs
Categories
(Firefox Build System :: General, task)
Firefox Build System
General
Tracking
(firefox135 fixed)
RESOLVED
FIXED
135 Branch
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
bug 1936088 is going to resurrect the line annotation in AppConstants module (AppConstants.jsm had the line annotation I think, and the migration to AppConstants.sys.mjs had lost it)
mozbuild.repackaging.msix::get_appconstants_sys_mjs_values logic doesn't expect any comment in between the property key and value, and that results in build bustage with the bug 1936088 patch.
def get_appconstants_sys_mjs_values(finder, *args):
r"""Extract values, such as the display version like `MOZ_APP_VERSION_DISPLAY:
"...";`, from the omnijar. This allows to determine the beta number, like
`X.YbW`, where the regular beta version is only `X.Y`. Takes a list of
names and returns an iterator of the unique such value found for each name.
Raises an exception if a name is not found or if multiple values are found.
"""
lines = defaultdict(list)
for _, f in finder.find("**/modules/AppConstants.sys.mjs"):
# MOZ_OFFICIAL_BRANDING is split across two lines, so remove line breaks
# immediately following ":"s so those values can be read.
data = f.open().read().decode("utf-8").replace(":\n", ":")
for line in data.splitlines():
for arg in args:
if arg in line:
lines[arg].append(line)
for arg in args:
(value,) = lines[arg] # We expect exactly one definition.
_, _, value = value.partition(":")
value = value.strip().strip('",;')
yield value
| Assignee | ||
Comment 1•11 months ago
|
||
After the patch Part 1 in bug 1936088, the processed AppConstants.sys.mjs looks like the following:
export var AppConstants = Object.freeze({
// See this wiki page for more details about channel specific build
// defines: https://wiki.mozilla.org/Platform/Channel-specific_build_defines
NIGHTLY_BUILD:
//@line 17 "$SRCDIR/toolkit/modules/AppConstants.sys.mjs"
true,
//@line 21 "$SRCDIR/toolkit/modules/AppConstants.sys.mjs"
...
MOZ_OFFICIAL_BRANDING:
//@line 71 "$SRCDIR/toolkit/modules/AppConstants.sys.mjs"
false,
//@line 73 "$SRCDIR/toolkit/modules/AppConstants.sys.mjs"
Just to make sure, is this expected?
Is the line annotation supposed to be a part of distributed files?
Flags: needinfo?(mh+mozilla)
| Assignee | ||
Comment 3•11 months ago
|
||
Updated•11 months ago
|
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/9ea2e33d2c81
Update python/mozbuild/mozbuild/repackaging/msix.py to support comments inside AppConstants.sys.mjs. r=firefox-build-system-reviewers,nalexander
Comment 5•11 months ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
status-firefox135:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•