rust-lang / rust-lang/cargo

Message caching does not allow switching --message-format between short and human

Open
#9,003 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-cache-messages C-bug S-needs-design
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

I ran this command:

cargo check --message-format short

On previous versions, this outputted one error per line.
Instead now, it outputs the same as --message-format human.

However, cargo build --message-format short outputs as expected.

EDIT
Seems like it's also an issue with cargo build. I played around with it, this is how to reproduce:

  • Save your main.rs file
  • try check or build with --message-format human - works as expected
  • try --message-format short - still displays human
  • re-save main.rs
  • try --message-format short - works as expected
  • try --message-format human - still displays short
Meta

rustc --version --verbose:

rustc 1.48.0 (7eac88abb 2020-11-16)
binary: rustc
commit-hash: 7eac88abb2e57e752f3302f02be5f3ce3d7adfb4
commit-date: 2020-11-16
host: x86_64-unknown-linux-gnu
release: 1.48.0
LLVM version: 11.0

cargo --version --verbose:

cargo 1.48.0 (65cbdd2dc 2020-10-14)
release: 1.48.0
commit-hash: 65cbdd2dc0b7e877577474b98b7d071308d0bb6f
commit-date: 2020-10-14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with cargo check or cargo build, alternating --message-format human and --message-format short after saving and re-saving main.rs. Trace the message-format handling from these Cargo entry points; done means switching formats takes effect immediately without requiring a source change.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.