Closed Bug 1053070 Opened 10 years ago Closed 10 years ago

Output a nicer error when reassigning a variable in moz.build

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

      No description provided.
Before:
mozbuild.frontend.reader.BuildReaderError: 
==============================
ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file:

    /home/glandium/mozilla-central/moz.build

The error was triggered on line 8 of this file:

    DIRS = ['bar']

An error was encountered as part of executing the file itself. The error appears to be the fault of the script.

The error as reported by Python is:

    ['Exception: Reassigning DIRS is forbidden\n']


After:
mozbuild.frontend.reader.BuildReaderError: 
==============================
ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file:

    /home/glandium/mozilla-central/moz.build

The error was triggered on line 8 of this file:

    DIRS = ['bar']

The underlying problem is an attempt to reassign a reserved UPPERCASE variable.

The reassigned variable causing the error is:

    DIRS

Maybe you meant "+=" instead of "="?


The message itself can probably be adjusted, but the main point was to make it a "structured" error handled at the same level as the others.
Attachment #8472161 - Flags: review?(gps)
Attachment #8472161 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/4b87bdfaf50e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla34
QA Whiteboard: [qa-]
DIST_SUBDIR is special, this "reassignment" shouldn't trigger an error. If it does, file a bug.
Flags: needinfo?(gps)
Blocks: 1071568
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: