Closed Bug 818554 Opened 12 years ago Closed 12 years ago

./mach build (mozconfig python module) dies on set but undefined environment variables like 'DISTCC_LOG='

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla20

People

(Reporter: keeler, Assigned: gps)

References

Details

Attachments

(1 file)

For whatever reason, my environment has a few variables that look like this:

DISTCC_LOG=

where the variable is set, but it has no value. mozconfig.py doesn't like this, particularly at line 319, where it reads past the end of the line because it's expecting something to come after the "=".
Relatively straightforward fix with test.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #688866 - Flags: review?(mh+mozilla)
Comment on attachment 688866 [details] [diff] [review]
Handle empty variables, v1

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

::: python/mozbuild/mozbuild/mozconfig.py
@@ +319,2 @@
>  
> +                    if len(line) == equal_pos + 1:

it would probably be easier to follow if you'd set line[equal_pos + 1:] to some intermediate variable and use that variable.
Attachment #688866 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/c93e85a125db

I rewrote the logic to make it easier to read, per review feedback. I have faith in the unit tests.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Awesome - thanks for fixing this so quickly.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: