-
Notifications
You must be signed in to change notification settings - Fork 402
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
Ask rust_toolchain for rustc_src in rust_analyzer.bzl #733
Conversation
CC @djmarcin |
04080c2
to
9b957cb
Compare
443894a
to
9d3902c
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.
Seems reasonable :)
9d3902c
to
221b641
Compare
@illicitonion only until you'll see I just added rustc srcs back after your PR :)) Now more seriously we'll need some way of including rustc sources for some targets on the CI. I can see how an env var could be used for that, what do you think? |
221b641
to
d4116da
Compare
Personally I'm fine with |
I would love to only fetch Rust srcs when needed (which is locally). I don't think there's a reason to fetch them in CI (of projects using |
25f034d
to
a95ffc5
Compare
Oh I'm glad to hear that, that simplifies a lot and makes a perfect sense to me.
If I understand you correctly you're saying that users of What this PR does is only downloading rustc sources for local development of So it seems to me we're in full synergy? :) |
What about local development of another project which uses |
That project has to write its own WORKSPACE file and in it specify which rust toolchains to use (and therefore whether and how to download rustc sources). WORKSPACE files are not used when the repository is an external repo, they are only used when the repository is the main one. |
Yeah, so the thing I'm saying is the new |
#541 is a good example of what I'm thinking. Where something settable in a |
a95ffc5
to
804a002
Compare
Ah I understand now. Yeah, having an environment variable to include sources that you set locally, or a variable to not include sources, that you set on the CI, sound like a standard solution for this problem. It's an issue a bit orthogonal to this PR, let's address it in a separate PR (do you want to give it a try? :). |
In this PR we remove hardcoded assumption about where rust-analyzer support code looks for rustc sources, and instead read that information from the
rust_toolchain.rustc_src
. We also handle the case when rustc sources are actually in the main repository, so there is no need to use the__EXEC_ROOT__/
prefix for its path.