Skip to content

Conversation

mati865
Copy link
Member

@mati865 mati865 commented Aug 21, 2019

Removed in #62766

Replacing it with --json=diagnostic-rendered-ansi fails:

error: using `--json` requires also using `--error-format=json`

Running ./x.py clippy src/libstd locally works fine (with colors) on Linux so I don't know if there is something to fix.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2019
@mati865
Copy link
Member Author

mati865 commented Aug 21, 2019

r? @oli-obk

@Mark-Simulacrum
Copy link
Member

cc @ehuss/@alexcrichton

@oli-obk
Copy link
Contributor

oli-obk commented Aug 21, 2019

Please keep colors by adding both --json=diagnostic-rendered-ansi and --error-format=json

@mati865
Copy link
Member Author

mati865 commented Aug 21, 2019

@oli-obk I tried it before and it didn't work:

$ ./x.py clippy src/libstd                    
Updating only changed submodules
Submodules updated in 0.02 seconds
   Compiling bootstrap v0.0.0 (/home/mateusz/Projects/rust/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 6.40s
Checking std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking core v0.0.0 (/home/mateusz/Projects/rust/rust/src/libcore)
   Compiling compiler_builtins v0.1.18
   Compiling libc v0.2.60
error: Option 'error-format' given more than once

error: Could not compile `core`.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/mateusz/Projects/rust/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "clippy" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/home/mateusz/Projects/rust/rust/src/libstd/Cargo.toml" "--message-format" "json-render-diagnostics" "--" "--cap-lints" "warn"
expected success, got: exit code: 101
failed to run: /home/mateusz/Projects/rust/rust/build/bootstrap/debug/bootstrap clippy src/libstd
diff
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 4e49aaa16ea..3a5901156b4 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -875,7 +875,8 @@ impl<'a> Builder<'a> {
         }
 
         if cmd == "clippy" {
-            extra_args.push_str("-Zforce-unstable-if-unmarked");
+            extra_args.push_str("-Zforce-unstable-if-unmarked \
+            --json=diagnostic-rendered-ansi --error-format=json");
         }
 
         if !extra_args.is_empty() {

@oli-obk
Copy link
Contributor

oli-obk commented Aug 21, 2019

Huh I thought we had a setup to allow error-format to be passed multiple times, because cargo also sets it twice sometimes. Maybe the bootstrap cargo is too old?

@mati865
Copy link
Member Author

mati865 commented Aug 21, 2019

Using cargo 1.39.0-nightly (3f700ec43 2019-08-19) fails with the same error.

@ehuss
Copy link
Contributor

ehuss commented Aug 21, 2019

Please keep colors by adding both --json=diagnostic-rendered-ansi and --error-format=json

I'm not sure I understand this (colors should work fine). cargo clippy is just a wrapper around cargo check. The --message-format flag (set in stream_cargo) tells cargo how to set these now, so this PR should be good.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 21, 2019

Ah, wonderful

@bors r=oli-obk,ehuss

@bors
Copy link
Collaborator

bors commented Aug 21, 2019

📌 Commit 5cf43bd has been approved by oli-obk,ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 21, 2019
Run Clippy without json-rendered flag

Removed in rust-lang#62766

Replacing it with `--json=diagnostic-rendered-ansi` fails:
```
error: using `--json` requires also using `--error-format=json`
```
Running `./x.py clippy src/libstd` locally works fine (with colors) on Linux so I don't know if there is something to fix.
bors added a commit that referenced this pull request Aug 21, 2019
Rollup of 6 pull requests

Successful merges:

 - #61236 (take into account the system theme)
 - #63717 (Fix nested eager expansions in arguments of `format_args`)
 - #63747 (update Miri)
 - #63772 (ci: move libc mirrors to the rust-lang-ci-mirrors bucket)
 - #63780 (Improve diagnostics: break/continue in wrong context)
 - #63781 (Run Clippy without json-rendered flag)

Failed merges:

r? @ghost
@bors bors merged commit 5cf43bd into rust-lang:master Aug 21, 2019
@mati865 mati865 deleted the clippy branch August 21, 2019 21:00
@mati865 mati865 mentioned this pull request Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants