Open Bug 1508344 Opened 6 years ago Updated 2 years ago

Parsing `cargo --build-plan` output fails if cargo emits warnings

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: ted, Unassigned)

Details

bug 1454613 broke the tup build because it made cargo emit a warning:

warning: An explicit [[bin]] section is specified in Cargo.toml which currently
disables Cargo from automatically inferring other binary targets.
This inference behavior will change in the Rust 2018 edition and the following
files will be included as a binary target:
<...>

We use `run_process` to run cargo which winds up using mozprocess under the hood:
https://dxr.mozilla.org/mozilla-central/rev/d6ac0dc85306b753c1d1d5f3084f73f0d1286b86/python/mozbuild/mozbuild/backend/tup.py#1018
https://dxr.mozilla.org/mozilla-central/rev/d6ac0dc85306b753c1d1d5f3084f73f0d1286b86/python/mach/mach/mixin/process.py#134

We don't specify a `processErrorLine` though, and the mozprocess docs say that if you don't do that stderr lines get sent to the same handler as stdout:
https://firefox-source-docs.mozilla.org/mozbase/mozprocess.html#mozprocess.ProcessHandlerMixin

...so we wind up with the combination of stderr+stdout here which of course fails to parse as JSON.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.