Closed Bug 1455065 Opened 6 years ago Closed 6 years ago

Environment parsing fails in Fedora 28

Categories

(Firefox Build System :: General, defect)

3 Branch
defect
Not set
normal

Tracking

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

RESOLVED FIXED
mozilla61
Tracking Status
firefox-esr60 61+ fixed
firefox60 - wontfix
firefox61 --- fixed

People

(Reporter: eeejay, Assigned: glandium)

References

Details

Attachments

(3 files)

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.
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: nobody → mh+mozilla
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)
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
https://hg.mozilla.org/mozilla-central/rev/210ee7ebb398
Status: NEW → RESOLVED
Closed: 6 years 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)
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?
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.