moz.build processing doesn't yield nice errors

RESOLVED FIXED in mozilla33

Status

()

Core
Build Config
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

(Blocks: 1 bug)

Trunk
mozilla33
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
For pure sandbox errors, we have the nice BuildReaderError that adds interesting info about the context of a given exception. There is no such thing for any of the exceptions raised in e.g. emit_from_sandbox or consume_object.
(Assignee)

Updated

4 years ago
Duplicate of this bug: 951369
(Assignee)

Comment 2

4 years ago
Created attachment 8452936 [details] [diff] [review]
Display nicer errors when failing to validate moz.build sandboxes
Attachment #8452936 - Flags: review?(gps)
(Assignee)

Comment 3

4 years ago
Created attachment 8452939 [details] [diff] [review]
Display nicer errors when failing to validate moz.build sandboxes

This only addresses the emit_from_sandbox part, because I think consume_object should not do the validations it does at all, and will file a separate bug about that.

Note this doesn't affect BuildReaderErrors since they are using the SandboxValidationError's message, not its str()

Also note I'm not sure how sandbox['SRCDIR'] is normalized on Windows, so we may need os.path.join for the moz.build path instead of using /.


Example error before the patch:

Reticulating splines...
Traceback (most recent call last):
  File "./config.status", line 981, in <module>
    config_status(**args)
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/config_status.py", line 148, in config_status
    summary = the_backend.consume(definitions)
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/backend/base.py", line 186, in consume
    for obj in objs:
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/frontend/emitter.py", line 113, in emit
    objs = list(self.emit_from_sandbox(out))
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/frontend/emitter.py", line 434, in emit_from_sandbox
    raise SandboxValidationError('While JAR_MANIFESTS is a list, '
mozbuild.frontend.reader.SandboxValidationError: While JAR_MANIFESTS is a list, it is currently limited to one value.


With the patch:

Reticulating splines...
Traceback (most recent call last):
  File "./config.status", line 981, in <module>
    config_status(**args)
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/config_status.py", line 148, in config_status
    summary = the_backend.consume(definitions)
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/backend/base.py", line 186, in consume
    for obj in objs:
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/frontend/emitter.py", line 113, in emit
    objs = list(self.emit_from_sandbox(out))
  File "/home/glandium/mozilla-central/python/mozbuild/mozbuild/frontend/emitter.py", line 439, in emit_from_sandbox
    'it is currently limited to one value.', sandbox)
mozbuild.frontend.reader.SandboxValidationError: 
==============================
ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file or one of the files it includes:

    /home/glandium/mozilla-central/toolkit/components/passwordmgr/moz.build

The error occurred when validating the result of the execution. The reported error is:

    While JAR_MANIFESTS is a list, it is currently limited to one value.
Attachment #8452939 - Flags: review?(gps)
(Assignee)

Updated

4 years ago
Attachment #8452936 - Attachment is obsolete: true
Attachment #8452936 - Flags: review?(gps)
(Assignee)

Updated

4 years ago
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
(Assignee)

Comment 4

4 years ago
Created attachment 8452943 [details] [diff] [review]
Display nicer errors when failing to validate moz.build sandboxes

Rebased on top of bug 1000994.
Attachment #8452943 - Flags: review?(gps)
(Assignee)

Updated

4 years ago
Attachment #8452939 - Attachment is obsolete: true
Attachment #8452939 - Flags: review?(gps)

Comment 5

4 years ago
Comment on attachment 8452943 [details] [diff] [review]
Display nicer errors when failing to validate moz.build sandboxes

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

LGTM.

We have Python unit test coverage over error display. I'm a bit surprised this didn't regress any tests. I trust you'll spot check before landing.
Attachment #8452943 - Flags: review?(gps) → review+
(Assignee)

Updated

4 years ago
Blocks: 1036797
https://hg.mozilla.org/mozilla-central/rev/72b71b739c1e
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.