Skip to content

Commit

Permalink
Small fixups
Browse files Browse the repository at this point in the history
- use `path` instead of `paths`
- don't mark rust-analyzer as an optional tool
- print the cargo command that's run in the proc-macro-test build script

  this originally was part of a change to fix `test --stage 0 rust-analyzer`,
  but I'm going to leave that for a separate PR so it's easier to review.
  • Loading branch information
jyn514 authored and fasterthanlime committed Jul 24, 2022
1 parent e0add21 commit ee09dc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl Step for RustAnalyzer {
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.paths(&["src/tools/rust-analyzer"])
run.path("src/tools/rust-analyzer")
}

fn make_run(run: RunConfig<'_>) {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ impl Step for RustAnalyzer {
mode: Mode::ToolStd,
path: "src/tools/rust-analyzer",
extra_features: vec!["rust-analyzer/in-rust-tree".to_owned()],
is_optional_tool: true,
is_optional_tool: false,
source_type: SourceType::InTree,
})
}
Expand Down
10 changes: 6 additions & 4 deletions src/tools/rust-analyzer/crates/proc-macro-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,19 @@ fn main() {
Command::new(toolchain::cargo())
};

let output = cmd
cmd
.current_dir(&staging_dir)
.args(&["build", "-p", "proc-macro-test-impl", "--message-format", "json"])
// Explicit override the target directory to avoid using the same one which the parent
// cargo is using, or we'll deadlock.
// This can happen when `CARGO_TARGET_DIR` is set or global config forces all cargo
// instance to use the same target directory.
.arg("--target-dir")
.arg(&target_dir)
.output()
.unwrap();
.arg(&target_dir);

println!("Running {:?}", cmd);

let output = cmd.output().unwrap();
if !output.status.success() {
println!("proc-macro-test-impl failed to build");
println!("============ stdout ============");
Expand Down

0 comments on commit ee09dc5

Please sign in to comment.