Make mozconfig errors print the path to the mozconfig in use

RESOLVED FIXED in mozilla35

Status

Firefox Build System
General
RESOLVED FIXED
4 years ago
2 months ago

People

(Reporter: jdm, Assigned: Six, Mentored)

Tracking

unspecified
mozilla35

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [lang=py])

Attachments

(1 attachment, 2 obsolete attachments)

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]
(Assignee)

Comment 2

4 years ago
Created attachment 8480856 [details] [diff] [review]
mach_print_mozconfig_file.patch

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?
(Assignee)

Comment 4

4 years ago
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.
(Assignee)

Updated

4 years ago
Attachment #8480856 - Flags: review?(josh) → review?(gps)
I would be tempted to use 'Evaluation of %s exited with an error' in this case.
(Assignee)

Comment 6

4 years ago
Created attachment 8481321 [details] [diff] [review]
mach_print_mozconfig_file.patch

New version taking car of josh comment
Attachment #8480856 - Attachment is obsolete: true
Attachment #8480856 - Flags: review?(gps)
Attachment #8481321 - Flags: review?(gps)

Comment 7

4 years ago
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)
(Assignee)

Comment 8

4 years ago
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
(Assignee)

Comment 9

4 years ago
Created attachment 8483687 [details] [diff] [review]
mach_print_mozconfig_file_v2.patch
Attachment #8481321 - Attachment is obsolete: true
Attachment #8483687 - Flags: review?(gps)
(Assignee)

Updated

4 years ago
OS: Mac OS X → All
Hardware: x86 → All

Updated

4 years ago
Attachment #8483687 - Flags: review?(gps) → review+
(Assignee)

Updated

4 years ago
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
(Assignee)

Comment 13

4 years ago
Thanks TYLin for pointing out my typo and Tomcat for fixing it :)
https://hg.mozilla.org/mozilla-central/rev/64300da7c9c4
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-

Updated

2 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.