Closed Bug 1874208 Opened 2 years ago Closed 2 years ago

`mach environment --format=json` can output status messages to stdout

Categories

(Firefox Build System :: Mach Core, defect, P3)

defect

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: jcristau, Assigned: ahochheiden)

References

Details

Attachments

(1 external file, 1 obsolete file)

mach environment --format=json sometimes outputs things like Site not up-to-date reason: [...] on stdout instead of just the json output, which makes it unparseable. Those log messages should probably be on stderr instead so they can be cleanly separated from the command's output.

Seems reasonable. Ideally it'd be debug level output in the log, but the mach logging handling isn't available that early on startup, so stderr will have to do.

Assignee: nobody → ahochheiden
Severity: -- → S3
Priority: -- → P3

It's not technically an error, but we can't make it debug level output
since the mach logging isn't available this early on startup. There's
precedent for using stderr output elsewhere in site.py, though it
usually precedes an exception being raised.

Pushed by ahochheiden@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/120bb0115412 Only output the `Site not up-to-date reason` to `stderr` r=firefox-build-system-reviewers,glandium
Attachment #9372324 - Attachment is obsolete: true

Looks like we can't use stderr since mozharness treats any output there as a full error. Trying to add a workaround there will potentially open up a can of worms that's not worth the effort, so I'll just remove the always printed Site up-to-date reason (even if it does help troubleshooting user issues sometimes).

While this message was sometimes useful to help troubleshoot for end
users, it's causing issues parsing stdout (since it can't use the mach
logging infrastructure due to being too early in the startup). We also
can't use stderr since some mozharness scripts treat any stderr
output as a full error.

Flags: needinfo?(ahochheiden)
See Also: → 1772453
Pushed by ahochheiden@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36a67f12029f Remove the always printed `Site not up-to-date reason` r=firefox-build-system-reviewers,glandium
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: