Skip to content

Rustup update warning printed to stdout with --message-format=json breaks json parsing #1721

@evanmoses-okta

Description

@evanmoses-okta

Checklist

Describe your issue

When I'm building with the --message-format=json flag, and cross detects that it needs to update the Rust version for the target, it prints a message to stdout in a human-readable format, and this breaks json parsing of the output. I'd expect the warning to be printed to stderr instead so I could still parse the json from stdout.

What target(s) are you cross-compiling for?

x86_64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5 (49cd054 2025-09-26)

Example

$ cross build --profile=dev --target=x86_64-unknown-linux-gnu --message-format=json
using newer rustc `1.91.0 (f8297e351 2025-10-28)` for the target. Current active rustc on the host is `rustc 1.89.0 (29483883e 2025-08-04)`.
 > Update with `rustup update`
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.103","manifest_path":", ... <all the normal JSON emitted by cargo build> 

Additional information / notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions