Skip to content

Let cargo know more about host OS package managers. #1919

Open
@iddm

Description

I want cargo to know and install crate dependencies automatically without involving developer to do that. Let's start with an example: the openssl-sys crate. When we try to build it cargo gives error that it unable to link with openssl shared library because it is not installed in the system. Okay, so I have to install it manually. But why? Nowadays there are usual ways of dealing with such work - package managers. And most of package managers I think (but not sure) have libraries to work with it. Even if they don't, how some other distribution systems such as NPM do that? I think there must be a way anyway. Okay, so what I want to propose:

  1. Adding key into Cargo.toml for crate-libraries to specify which library they need to link to.
  2. When we call cargo build after that, cargo automatically determines environment and package managers, determines which package provides such library, says that (println!) and asks password for instaslling it, and then installs it.
  3. Continues normal building.

This may sound messy but I think this is a good idea, however, I think some people may say it does not worth to be made. So, I would try to do that by myself for aptitude (deb-based distros) and pacman (archlinux-based), after, perhaps, I may try to implement that for rpm-based distros. What do you guys think here?

P.S. I am not sure was I right to put such proposal in this repository or should I do that right in cargo's repo..
P.P.S. Of course, windows is an exception here but we must admit that there everything is not developer-friendly anyway :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    T-cargoRelevant to the Cargo team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions