-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Suggested rust-analyzer config can't run rustfmt #107547
Comments
@rustbot claim |
Hi! Just to clarify, the idea is to change to code to match the docs? |
I think the idea is changing the docs to match the new behavior. |
For reference: rust-lang/rustc-dev-guide#1574 |
I'd prefer to change the code so that we don't force all contributors to update their config. |
I don't think we can put the binary back, or at least, that feels iffy - we'd be trying to overlap two different sysroots. rustfmt used to be statically linked to libstd and librustc_driver, but that's no longer the case. |
I suppose we could try to create a symlink from the old path to the new one? That might work, not sure. |
Maybe add a proxy? #!/usr/bin/sh
exec ../rustdoc $* #FIXME make this syntax correct |
A symlink seems like a good solution to me. |
Does the symlink still finds the correct so? |
✨ try it and see ✨ |
I'll experiment adding a symlink. |
On Windows, creating a symlink does not find the needed DLLs. |
Symlinking also works on macOS. |
Ok, this is pretty messy. How about doing both:
and from there we can work long-term to using the same toolchain for rustfmt and other tools, without having a time pressure. |
|
May I get some guidance and the creation of the symlink? Do I use rust to create the symlink in Thank you! |
@zephaniahong use Line 1593 in 99529b0
|
And just to confirm, I use that symlink function here? rust/src/bootstrap/download.rs Lines 332 to 333 in 11d96b5
|
yes |
I think it would be possible to move rustfmt back to the same sysroot as the bootstrap compiler by only taking libstd.so, librustc_middle.so and libLLVM.so from the nightly rustc component and not copying any other files like the rustc binary. Libstd.so and librustc_middle.so both contain a hash in their name unique for each rustc version. libLLVM.so should contain the rustc version, so that shouldn't conflict either. |
Doing the same with the DLLs on Windows could also work. |
related (different error with rustfmt, but caused by the same change): #107676 |
Hi @zephaniahong, any progress on the symlink? happy to help out if you're running into trouble :) |
Hey @jyn514 ! Thanks for reaching out! I'll be starting tomorrow and will reach out to you if/when I need help! |
#107297 broke the rust-analyzer config we suggest in the dev-guide: https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc
since now rustfmt is in
build/host/rustfmt/bin/rustfmt
instead ofbuild/host/stage0/bin/rustfmt
.Originally posted by @jyn514 in #107297 (comment)
The text was updated successfully, but these errors were encountered: