-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
internal: Add RA_UNSTABLE_SYSROOT_HACK #14599
Conversation
The reason that layout of |
Dependencies of std require weird workarounds due to them not being allowed to depend on the std lib directly themselves, wouldn't surprise me if r-a fails to understand those workarounds somehow |
Yes that was it. I thought it should work out of the box and the fact that go to definition worked from hashbrown to core misled me that it is working. I manually replaced Should I continue this path and add the symlink code? |
Given cargo was made its own workspace in the rust-lang/rust repo now, I'd like to poke whether its feasible to pursue making library its own workspace once more in rust-lang/rust. (I am not too happy with the alternative approaches we have really, they feel too hacky and brittle) |
Fair. Is it possible to merge this under a config flag, so that I can use it on my system? I want to work on the interpreting mir for unit tests, and my process is very "not-working driven development" :). That is, I see for example |
0b9e2dd
to
ab3f01b
Compare
I'll take a look at this later today or tomorrow (only skimmed it very briefly just now but from a rough look the changes seem quite invasive for a temporary hack), adding this as a temporary hack for you to continue developing sounds fine to me otherwise. |
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.
That's a lot less invasive 👍 thanks for changing it
Thanks for accepting it. I still think it would be good enough to consider as a plan B if making std a cargo workspace didn't progressed. Specially after I used it and found its potential problems. @bors r+ |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
It seems this doesn't see the module files in |
cc #7637
It is currently in a proof of concept stage, and it doesn't generates a copy. You need to provide your own sysroot copy in
/tmp/ra-sysroot-hack
in a way that/tmp/ra-sysroot-hack/library/std/lib.rs
exists and/tmp/ra-sysroot-hack/Cargo.toml
is the one from this comment. I will add the symlink code if we decide that this approach is not a dead end.It seems to somehow work on my system. Go to definition into std dependencies works, type checking can look through fields if I make them public and
cfg_if
appears to work (I tested it by hovering both sides and seeing that the correct one is enabled). Though finding layout ofHashMap
didn't work.Please try it and let me know if I should go forward in this direction or not.