-
Notifications
You must be signed in to change notification settings - Fork 893
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
Handling of rustc-sysroot .so files differs when sysroots do not come with their own cargo #1575
Comments
I can confirm now that it is about cargo; when I install the "cargo" component with rustup-toolchain-install-master, the created binaries work fine in rustup. |
This issue affects not only Linux but also Windows: installing a toolchain without cargo, and then with that toolchain building and running a program that uses |
I am unsure of how we ought to try and deal with this? What are you hoping we could do in |
It could set up whatever are the right environment variables to make the program it runs actually find shared libraries of the current toolchain. When I wrote this issue I was not aware that this setup is typically done by cargo, not rustup. But given the problems it causes to not do this (and given how hard they are to debug!), maybe that would be worth doing in rustup as well? An alternative might be to somehow warn that cargo-less toolchains are generate, and point to docs explaining more. |
Would setting up those variables cause |
I do not know. Maybe @ehuss can help? |
So just to summarize: When using a toolchain that is missing cargo, rustup has a fallback mechanism to use other toolchains. When this happens, the LD_LIBRARY_PATH points to the fallback toolchain, which is probably not what you want. Can you try changing this line to |
Yeah I can try that, though probably not before the weekend. |
Yes, that seems to work exactly as I hoped. :) Thanks a lot! I will prepare a PR. |
When I install miri (
cargo +nightly install --git https://github.com/solson/miri/ miri
) with thenightly
toolchain, I can later executecargo +nightly miri --help
just fine. However, when I do the same thing with a toolchain obtained viarustup toolchain link
(a locally-compiled stage 2 sysroot), that does not work: After replacing+nightly
by+stage2
, all I get isInterestingly, toolchains installed via https://github.com/kennytm/rustup-toolchain-install-master behave like linked ones: They also result in the above error.
What both of these toolchains (linked ones and rustup-toolchain-install-master) have in common is that they don't come with their own cargo.
I don't know how the responsibility of setting
LD_LIBRARY_PATH
(assuming that is what is missing here) is split betweenrustup
andcargo
, and I have no idea whichcargo
rustup
is even using when the toolchain does not have its own. But somewhere, something doesn't quite fit together.(Calling the
cargo-miri
binary directly shows such an error in both cases, but when I am using nightly, it seems thatLD_LIBRARY_PATH
is set properly when usingcargo miri
.)The text was updated successfully, but these errors were encountered: