Environment parsing fails in Fedora 28

RESOLVED FIXED in Firefox -esr60

Status

defect
RESOLVED FIXED
a year ago
5 months ago

People

(Reporter: eeejay, Assigned: glandium)

Tracking

3 Branch
mozilla61

Firefox Tracking Flags

(firefox-esr6061+ fixed, firefox60- wontfix, firefox61 fixed)

Details

Attachments

(3 attachments)

Reporter

Description

a year ago
All mach commands fail because the environment variables are incorrectly parsed. I attached the output of dump_env.py, it includes multi-line bash functions that the parser attempts to consume.

Locally, I get caught up in this line:
IFS=' ';
.. which is part of BASH_FUNC__moduleraw%%

I'm not sure why one python script needs to parse the brittle output of another python script, seems like we can use environ directly in mozconfig.py. Or maybe use a more robust serializer like json.

In the meantime, we could probably strip out the bash functions.
Assignee

Updated

a year ago
Duplicate of this bug: 1454339
Assignee

Comment 3

a year ago
Comment on attachment 8969009 [details] [diff] [review]
Strip out bash functions from environment in dump_env.py

Review of attachment 8969009 [details] [diff] [review]:
-----------------------------------------------------------------

This unfortunately only papers over the problem. Let's actually fix it.
Attachment #8969009 - Flags: review?(mh+mozilla)
Assignee

Updated

a year ago
Assignee: nobody → mh+mozilla
Comment hidden (mozreview-request)

Comment 5

a year ago
mozreview-review
Comment on attachment 8969107 [details]
Bug 1455065 - Shell quote environment variable values when dumping them in dump_env.py.

https://reviewboard.mozilla.org/r/237802/#review243998
Attachment #8969107 - Flags: review+
Attachment #8969107 - Flags: review?(core-build-config-reviews)

Comment 6

a year ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/210ee7ebb398
Shell quote environment variable values when dumping them in dump_env.py. r=mshal

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/210ee7ebb398
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
[Tracking Requested - why for this release]:

I'm running into problems running mach configure on Fedora 28.  I think this bug has the fix, and it would be good to backport it to Firefox 60 for the esr-60 release.

Steps to reproduce:
(1) unified-mozilla repository, hg up release
(2) cat browser/config/version.txt # returns 60.0.1
(3) export MOZCONFIG=~/mozconfigs/fx-blank.mozconfig # a zero-byte file
(4) ./mach configure

Assertion failed in _parse_loader_output:
Traceback (most recent call last):
  File "/home/ajvincent/compiled/unified/mozilla/python/mozbuild/mozbuild/mozconfig.py", line 260, in read_mozconfig
    parsed = self._parse_loader_output(output)
  File "/home/ajvincent/compiled/unified/mozilla/python/mozbuild/mozbuild/mozconfig.py", line 375, in _parse_loader_output
    assert not in_variable
AssertionError
Error loading mozconfig: /home/ajvincent/mozconfigs/fx-blank.mozconfig

This bug does NOT happen when I use |hg up beta|, where version.txt is 61.0.
Doesn't feel like this needs tracking but if Mike wants to nominate this patch for ESR60 we can consider it.
For what it's worth, I have confirmed that this patch does fix esr-60 for Fedora Linux 28.
Mind requesting esr60 uplift?
Flags: needinfo?(mh+mozilla)
Assignee

Comment 12

a year ago
Comment on attachment 8969107 [details]
Bug 1455065 - Shell quote environment variable values when dumping them in dump_env.py.

[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration:
User impact if declined: Build failure due to some environment variable in the build environment on Fedora.
Fix Landed on Version: 61
Risk to taking this patch (and alternatives if risky): This only affects how the build takes values from the environment to feed build options to configure. This has no consequence on Firefox itself.
String or UUID changes made by this patch: N/A
Flags: needinfo?(mh+mozilla)
Attachment #8969107 - Flags: approval-mozilla-esr60?
Assignee

Updated

a year ago
Duplicate of this bug: 1464952
Comment on attachment 8969107 [details]
Bug 1455065 - Shell quote environment variable values when dumping them in dump_env.py.

approved for 60.1esr
Attachment #8969107 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.