-
Notifications
You must be signed in to change notification settings - Fork 483
rustc_src is optional #703
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
rustc_src is optional #703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps rust_analyzer
should have it's own toolchain which goes and fetches the rustc sources? That might make configuring it a bit clunky but might be warranted and provide a good way to separate the rust_analyzer
functionality from core builds. Maybe there's a path forward where rust analyzer is enabled by a bazelrc
flag and we'd always define the toolchains in repositories.bzl
knowing they'd otherwise never be used without the aspect enabled.
I do feel the amount of time spent fetching dependencies is quite painful though so this is a good direction.
22ca12a
to
93e8cd9
Compare
I finally got around to addressing these comments - PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the user story for having this work with rust-analyzer
? I think if we expect users to set some flag to True
in their workspace that we should also update documentation for that here at the very least.
93e8cd9
to
b5051bf
Compare
I added a note to the |
b5051bf
to
3c2fb53
Compare
I was actually thinking something should be added to docs/rust_analyzer.vm. If I'm going to setup rust_analyzer in my existing rules_rust project, I may not see the updated note about |
Sigh, I edited exactly what you wanted, but I edited the .md file rather than the .vm file so it got reverted by the re-generation. I am looking forward to not putting generated docs in the repo. Updated the right file this time :) |
65abe1d
to
18c2f75
Compare
This is a tar containing a huge number of files (hundreds of thousands) which can take double-digit seconds to extract. It's only used for rust analyzer support, so hide this behind a flag people can opt in to if they want.
18c2f75
to
b1fd6a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
Having thought about this a bit more. Could this also be gated by an Or perhaps do something for the inverse where a |
I put together an alternate patch where a repo env determines whether to do the fetching, and we set the repo env, but it has the down-side that the repository rule is re-run whenever you switch between rust analyzer and non-rust-analyzer bazel usage, which is a pretty bad experience. I guess a reasonable alternative would be a WORKSPACE file opt-in (as this PR does), and then an env var to specify "No really, I'm never going to want to use rust analyzer" that you could set on CI... But that's starting to feel like a somewhat confusing state-space to need to consider, as a user... I think @hlopko was talking about looking into why we unconditionally re-fetch toolchain stuff quite so often, which would maybe make my alternate patch more viable. In the mean time, I'm going to merge this (as discussed offline), we can re-visit when we have a better plan :) |
This is a tar containing a huge number of files (hundreds of thousands)
which can take double-digit seconds to extract.
It's only used for rust analyzer support, so hide this behind a flag
people can opt in to if they want.