Skip to content
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

Support installing with linking to non-system libraries #69865

Open
Evpok opened this issue Mar 9, 2020 · 4 comments
Open

Support installing with linking to non-system libraries #69865

Evpok opened this issue Mar 9, 2020 · 4 comments

Comments

@Evpok
Copy link

@Evpok Evpok commented Mar 9, 2020

Currently, toolchains installed with rustup use system library path and the system dynamic linker.

In some environment it makes installing and using rust overly complicated. My specific use case is a shared environment where the system libs are quite old so users manage their own installations with linuxbrew in their respective homes.

It would be nice to have a way to tell rustup to use other linkers and other library path. Maybe with a flag like --custom-linker …

@rbtcollins

This comment has been minimized.

Copy link
Contributor

@rbtcollins rbtcollins commented Mar 9, 2020

rustup doesn't actually build rust libstd or rustc - they are built on build machines and rustup merely downloads and unpacks for use.

You can build your own rust and then link a custom toolchain, though this is not without compromises, but it would allow you to have rust binaries that are built against your linuxbrew libraries.

I think though, since rustc etc aren't segfaulting or behaving really badly, that this is more a configuration issue with rustc, rather than an issue with the install - so I'm going to move this issue to the rust repository, rather than rustup: rustup's job is to install a rust toolchain (rustc, cargo, etc); whereas your feature request is about what the compiler should do.

@pietroalbini pietroalbini transferred this issue from rust-lang/rustup Mar 9, 2020
@Evpok

This comment has been minimized.

Copy link
Author

@Evpok Evpok commented Mar 9, 2020

Fair enough. I was thinking about something like rustup setting rpath in the toolchain binaries to the custom location, but maybe that's not the right way to go about it.

@the8472

This comment has been minimized.

Copy link

@the8472 the8472 commented Mar 9, 2020

Wouldn't it be sufficient to prepend something to PATH and LD_LIBRARY_PATH?

@Evpok

This comment has been minimized.

Copy link
Author

@Evpok Evpok commented Mar 10, 2020

@the8472 Maybe in wrappers around toolchain executables? That's one reason why I was thinking of doing it at rustup level since there are already wrappers defined there. Doing that in the parent shell environment is not a good idea as you still have to rely on some system executables and that might break them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.