Closed Bug 1057871 Opened 10 years ago Closed 10 years ago

Make mozconfig errors print the path to the mozconfig in use

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla35

People

(Reporter: jdm, Assigned: Six, Mentored)

Details

(Whiteboard: [lang=py])

Attachments

(1 file, 2 obsolete files)

When mach tells me that my mozconfig didn't execute correctly, it would be really useful to print out the full path to the file being executed.
Relevant code: the MozconfigLoadException in read_mozconfig in http://mxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/mozconfig.py
Whiteboard: [lang=py]
Attached patch mach_print_mozconfig_file.patch (obsolete) — Splinter Review
Hello,

Is this the behaviour you want?
It only prints the full path of the mozconfig file used if there is an error in it.
Assignee: nobody → six.dsn
Status: NEW → ASSIGNED
Attachment #8480856 - Flags: review?(josh)
That looks good to me, but gps should probably review the change. Could you give an example of the output when there's a mozconfig error?
Hi,

ok i will change the reviewer.
Here is the output:

MozconfigLoadException: Using /home/six/mozilla-central/.mozconfig: Evaluation of your mozconfig exited with an error. This could be triggered
by a command inside your mozconfig failing. Please change your mozconfig
to not error and/or to catch errors in executed commands.

Maybe we could change how it's displayed to highlight the file used.
Attachment #8480856 - Flags: review?(josh) → review?(gps)
I would be tempted to use 'Evaluation of %s exited with an error' in this case.
Attached patch mach_print_mozconfig_file.patch (obsolete) — Splinter Review
New version taking car of josh comment
Attachment #8480856 - Attachment is obsolete: true
Attachment #8480856 - Flags: review?(gps)
Attachment #8481321 - Flags: review?(gps)
Comment on attachment 8481321 [details] [diff] [review]
mach_print_mozconfig_file.patch

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

We already pass the mozconfig path to the created MozconfigLoadException. I'd prefer to fix this bug by ensuring that whatever is printing the MozconfigLoadException is printing the path name, similar to what's happening at https://hg.mozilla.org/mozilla-central/file/5e9826980be5/python/mozbuild/mozbuild/base.py#l590.

What mach command isn't print the mozconfig path?
Attachment #8481321 - Flags: review?(gps)
Hi,

This happens using './mach configure' if there is an error in the mozconfig used.
actually the error is here:
https://hg.mozilla.org/mozilla-central/file/5e9826980be5/python/mozbuild/mozbuild/base.py#l560

it comes from the fact that this "try" block doesn't catch MozconfigLoadException's
Attachment #8481321 - Attachment is obsolete: true
Attachment #8483687 - Flags: review?(gps)
OS: Mac OS X → All
Hardware: x86 → All
Attachment #8483687 - Flags: review?(gps) → review+
Keywords: checkin-needed
I found that the bug number in the commit message is incorrect. It's 105871 instead of 1057871.
(In reply to Ting-Yu Lin [:TYLin] (UTC+8) from comment #11)
> I found that the bug number in the commit message is incorrect. It's 105871
> instead of 1057871.

no problem, backedout the comment with the wrong bugnumber and re-checked in the correct commit message in https://hg.mozilla.org/integration/mozilla-inbound/rev/64300da7c9c4
Thanks TYLin for pointing out my typo and Tomcat for fixing it :)
https://hg.mozilla.org/mozilla-central/rev/64300da7c9c4
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-
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: