Closed Bug 1464952 Opened 7 years ago Closed 7 years ago

Build fails if mozconfig and there's an environment variable starting with a quote

Categories

(Firefox Build System :: General, defect)

3 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1455065

People

(Reporter: akkzilla, Unassigned)

Details

If you have an environment variable that starts with a single quote, e.g. export STARTSWITHQUOTE="'allo world" then mach build will work fine, until you also have a mozconfig file. Then mach build will fail with: Assertion failed in _parse_loader_output: Traceback (most recent call last): File "/home/akkana/outsrc/gecko-dev/python/mozbuild/mozbuild/mozconfig.py", line 260, in read_mozconfig parsed = self._parse_loader_output(output) File "/home/akkana/outsrc/gecko-dev/python/mozbuild/mozbuild/mozconfig.py", line 375, in _parse_loader_output assert not in_variable AssertionError Error loading mozconfig: /home/akkana/outsrc/gecko-dev/mozconfig The problem is the clause in line 449 in mozconfig.py: if has_quote and not value.endswith("'"): if I put a "False and" after the if to disable that test (and use the else instead), mach build works. I'm not sure what the right fix is because I can't figure out what that test is there for. The comment before the test says # Lines with a quote not ending in a quote are multi-line but the test doesn't seem to be for multiline environment variables: if you disable the test, if False and has_quote and not value.endswith("'"): and then set a multiline variable, export MULTILINE="hello world, this is a multiline env variable" then mach build still works, so the output it's parsing doesn't put single quotes around multiline environment variables. What is the test for, and could it be made smarter so env variables with quotes wouldn't break the build? I can try to make a patch if I know a test case for whatever that clause was for.
This sounds like a duplicate of bug 1455065.
Confirmed that it is.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.