Skip to content
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

Copy built tools to stage sysroot #85496

Closed

Conversation

Bobo1239
Copy link
Contributor

Motivation for this is to enable tools usage when using rustup toolchain link.

Just copies the tool directly after it's been built like the Rustdoc step does it.

Fixes #81431.

Motivation for this is to enable tools usage when using `rustup toolchain link`.
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 May 20, 2021
@Bobo1239 Bobo1239 force-pushed the bootstrap_tools_to_sysroot_bin branch from 1ca6eb1 to 1cfec67 Compare May 20, 2021 01:59
@jyn514
Copy link
Member

jyn514 commented May 20, 2021

cc @vext01

@Bobo1239
Copy link
Contributor Author

Note: You will still need to add cargo-fmt/cargo-clippy to the config.toml for cargo fmt/cargo clippy:

[build]
extended = true
tools = ["cargo", "clippy", "rustfmt", "analysis", "src", "cargo-clippy", "cargo-fmt"]

And unfortunately it seems like cargo clippy doesn't actually work yet:

/home/bobo1239/Development/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/clippy-driver: error while loading shared libraries: librustc_driver-c056802ace4e7be8.so: cannot open shared object file: No such file or directory

Possibly related to #82208 (comment)? (last bullet point)

@jyn514
Copy link
Member

jyn514 commented May 20, 2021

@Bobo1239 no, this is unrelated - you're adding the tools yourself here. This is more likely #78778.

@Bobo1239 Bobo1239 marked this pull request as draft May 20, 2021 14:59
@Bobo1239
Copy link
Contributor Author

Hm, seems like I didn't properly understand the stageN directories. Seems they're actually used as the sysroot while building stage N (relevant page in the rustc guide) so tools produced as part of stage N shouldn't really be put there. The rustc already in that directory also links to a different librustc_driver-###.so than the newly produced clippy-driver which makes sense.

@bors
Copy link
Contributor

bors commented May 26, 2021

☔ The latest upstream changes (presumably #85711) made this pull request unmergeable. Please resolve the merge conflicts.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 29, 2021
builder.copy(&cargo_out, &bin);

// Don't create a stage0-sysroot/bin directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this for all tools is likely not a good idea, as it'll place things like tidy and other internal tools in the PATH (particularly on windows, that may be a problem). It should be possible to add this after the calls to ToolBuild, as we return the appropriate path already.

@Mark-Simulacrum
Copy link
Member

I'm going to go ahead and close this PR - but feel free to reopen or open a new one if you come back to finishing this work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo fmt and other tools don't work for a linked toolchain.
5 participants