mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 22:22:44 +00:00
Auto merge of #44679 - oli-obk:clippy_ci, r=alexcrichton
Add clippy to `toolstate.toml` r? @alexcrichton cc @Manishearth I have no idea how to get clippy working... it needs proc macros, and I think I did everything right (I just did what the cargo step is doing), but it's not working: ``` error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory --> src/tools/clippy/clippy_lints/src/lib.rs:47:1 | 47 | extern crate serde_derive; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory --> src/tools/clippy/clippy_lints/src/lib.rs:47:1 | 47 | extern crate serde_derive; | ^ ``` It's especially weird since it used to work Anyway. Fixing it can be left for a future PR, this one adds it to CI, but marks it as "broken"
This commit is contained in:
commit
1b55d19479
@ -330,23 +330,11 @@ it can be found
|
|||||||
Currently building Rust will also build the following external projects:
|
Currently building Rust will also build the following external projects:
|
||||||
|
|
||||||
* [clippy](https://github.com/rust-lang-nursery/rust-clippy)
|
* [clippy](https://github.com/rust-lang-nursery/rust-clippy)
|
||||||
|
* [miri](https://github.com/solson/miri)
|
||||||
|
|
||||||
If your changes break one of these projects, you need to fix them by opening
|
If your changes break one of these projects, you need to fix them by opening
|
||||||
a pull request against the broken project. When you have opened a pull request,
|
a pull request against the broken project. When you have opened a pull request,
|
||||||
you can point the submodule at your pull request by calling
|
you can disable the tool via `src/tools/toolstate.toml`.
|
||||||
|
|
||||||
```
|
|
||||||
git fetch origin pull/$id_of_your_pr/head:my_pr
|
|
||||||
git checkout my_pr
|
|
||||||
```
|
|
||||||
|
|
||||||
within the submodule's directory. Don't forget to also add your changes with
|
|
||||||
|
|
||||||
```
|
|
||||||
git add path/to/submodule
|
|
||||||
```
|
|
||||||
|
|
||||||
outside the submodule.
|
|
||||||
|
|
||||||
It can also be more convenient during development to set `submodules = false`
|
It can also be more convenient during development to set `submodules = false`
|
||||||
in the `config.toml` to prevent `x.py` from resetting to the original branch.
|
in the `config.toml` to prevent `x.py` from resetting to the original branch.
|
||||||
|
@ -254,7 +254,7 @@ impl<'a> Builder<'a> {
|
|||||||
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
|
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
|
||||||
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc,
|
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc,
|
||||||
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs,
|
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs,
|
||||||
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri),
|
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri, check::Clippy),
|
||||||
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
|
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
|
||||||
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
|
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
|
||||||
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,
|
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,
|
||||||
|
@ -348,6 +348,50 @@ impl Step for Miri {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
|
pub struct Clippy {
|
||||||
|
host: Interned<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Step for Clippy {
|
||||||
|
type Output = ();
|
||||||
|
const ONLY_HOSTS: bool = true;
|
||||||
|
const DEFAULT: bool = false;
|
||||||
|
|
||||||
|
fn should_run(run: ShouldRun) -> ShouldRun {
|
||||||
|
run.path("src/tools/clippy")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn make_run(run: RunConfig) {
|
||||||
|
run.builder.ensure(Clippy {
|
||||||
|
host: run.target,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Runs `cargo test` for clippy.
|
||||||
|
fn run(self, builder: &Builder) {
|
||||||
|
let build = builder.build;
|
||||||
|
let host = self.host;
|
||||||
|
let compiler = builder.compiler(1, host);
|
||||||
|
|
||||||
|
let _clippy = builder.ensure(tool::Clippy { compiler, target: self.host });
|
||||||
|
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
|
||||||
|
cargo.arg("--manifest-path").arg(build.src.join("src/tools/clippy/Cargo.toml"));
|
||||||
|
|
||||||
|
// Don't build tests dynamically, just a pain to work with
|
||||||
|
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
||||||
|
// clippy tests need to know about the stage sysroot
|
||||||
|
cargo.env("SYSROOT", builder.sysroot(compiler));
|
||||||
|
|
||||||
|
builder.add_rustc_lib_path(compiler, &mut cargo);
|
||||||
|
|
||||||
|
try_run_expecting(
|
||||||
|
build,
|
||||||
|
&mut cargo,
|
||||||
|
builder.build.config.toolstate.clippy.passes(ToolState::Testing),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
|
fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
|
||||||
// Configure PATH to find the right rustc. NB. we have to use PATH
|
// Configure PATH to find the right rustc. NB. we have to use PATH
|
||||||
|
@ -405,7 +405,7 @@ impl Step for Clippy {
|
|||||||
tool: "clippy",
|
tool: "clippy",
|
||||||
mode: Mode::Librustc,
|
mode: Mode::Librustc,
|
||||||
path: "src/tools/clippy",
|
path: "src/tools/clippy",
|
||||||
expectation: BuildExpectation::None,
|
expectation: builder.build.config.toolstate.clippy.passes(ToolState::Compiling),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,4 +45,5 @@ impl Default for ToolState {
|
|||||||
/// This is created from `toolstate.toml`.
|
/// This is created from `toolstate.toml`.
|
||||||
pub struct ToolStates {
|
pub struct ToolStates {
|
||||||
pub miri: ToolState,
|
pub miri: ToolState,
|
||||||
|
pub clippy: ToolState,
|
||||||
}
|
}
|
||||||
|
@ -10,15 +10,20 @@
|
|||||||
# configures whether the tool is included in the Rust distribution.
|
# configures whether the tool is included in the Rust distribution.
|
||||||
#
|
#
|
||||||
# If a tool was working before your PR but is broken now, consider
|
# If a tool was working before your PR but is broken now, consider
|
||||||
# updating the tool within your PR. How to do that is described in
|
# opening a PR against the tool so that it works with your changes.
|
||||||
|
# If the tool stops compiling, change its state to `Broken`. If it
|
||||||
|
# still builds, change it to `Compiling`.
|
||||||
|
# How to do that is described in
|
||||||
# "CONTRIBUTING.md#External Dependencies". If the effort required is not
|
# "CONTRIBUTING.md#External Dependencies". If the effort required is not
|
||||||
# warranted (e.g. due to the tool abusing some API that you changed, and
|
# warranted (e.g. due to the tool abusing some API that you changed, and
|
||||||
# fixing the tool would mean a significant refactoring), you can disable
|
# fixing the tool would mean a significant refactoring) remember to ping
|
||||||
# the tool here, by changing its state to `Broken`. Remember to ping
|
# the tool authors, so they can fix it, instead of being surprised by the
|
||||||
# the tool authors if you do not fix their tool, so they can proactively
|
# breakage.
|
||||||
# fix it, instead of being surprised by the breakage.
|
|
||||||
#
|
#
|
||||||
# Each tool has a list of people to ping
|
# Each tool has a list of people to ping
|
||||||
|
|
||||||
# ping @oli-obk @RalfJung @eddyb
|
# ping @oli-obk @RalfJung @eddyb
|
||||||
miri = "Testing"
|
miri = "Testing"
|
||||||
|
|
||||||
|
# ping @Manishearth @llogiq @mcarton @oli-obk
|
||||||
|
clippy = "Broken"
|
||||||
|
Loading…
Reference in New Issue
Block a user