Skip to content

Allow the check command to terminate without output #10756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Nov 12, 2021

Cargo will always output something on success:

$ cargo check --message-format=json
{"reason":"compiler-artifact", ... snipped ... }
{"reason":"build-finished","success":true}

However, rustc does not output anything on success:

$ rustc --error-format=json main.rs
$ echo $?
0

Restore the behaviour prior to #10517, where an exit code of 0 is
considered good even if nothing is written to stdout.

This enables custom overrideCommand values that use rustc rather than
cargo.

Cargo will always output something on success:

```
$ cargo check --message-format=json
{"reason":"compiler-artifact", ... snipped ... }
{"reason":"build-finished","success":true}
```

However, rustc does not output anything on success:

```
$ rustc --error-format=json main.rs
$ echo $?
0
```

Restore the behaviour prior to rust-lang#10517, where an exit code of 0 is
considered good even if nothing is written to stdout.

This enables custom overrideCommand values that use rustc rather than
cargo.
@Veykril
Copy link
Member

Veykril commented Nov 12, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 12, 2021

@bors bors bot merged commit d1e756e into rust-lang:master Nov 12, 2021
@Wilfred Wilfred deleted the allow_empty_stdout branch November 13, 2021 21:33
@lnicola
Copy link
Member

lnicola commented Nov 14, 2021

changelog fix (first contribution) allow the check command to terminate with no output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants