-
Notifications
You must be signed in to change notification settings - Fork 21
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
Drive system-deps
as a standard for managing system dependencies
#97
Comments
Hi @weihanglo I'd be really happy to see Your plan looks great to me, but unfortunately I don't have much time to actively work on
So far I've valued ease to maintain the code over MSRV. I wouldn't mind reducing the MSRV if that doesn't greatly increase the amount of code to maintain.
That was the point of the internal build API but, AFAIK, it has never been really used so they are probably loads of rooms for improvements here. |
IIRC |
Nice! I missed the important part 😆. To make it more realistic, we may want to expose a TOML config interface for people to set the default mode Anyway, thanks for your replies people. I'd love to start from potential ways to lower MSRV. Will post update when I have a concrete design. |
I had similar thoughts about this, would love to see this adopted by Cargo giving us more flexibility and remove build scripts. One interesting situation that'd be nice to support is having a vendored library that renames symbols to not collide with other builds. We do this in |
Thank you for maintaining this awesome package!
The value of a declarative interface for system dependencies is something the community already knew but never thought deeply about. It benefits everyone without writing imperative build scripts. I really love the idea, and wish it becomes more mainstream, or even built-in in Cargo.
The elephant(s) in the room
I see some issues that the community currently has around system dependencies:
system-deps
, an imperative build script cannot be easily updated, so the logic is typically more error-prone.vendored
Cargo feature for building from source. However, Cargo features are unified and additive. Once some crate in a dependency tree activatesvendored
, they can never use the library from the system.A practical(?) plan
As the first step, we tried to make our own system-deps, and then came across this repository. I believe there is room for us to collaborate to push this as a de facto way to declare system dependencies, and then become official (i.e., rust-lang/cargo#12432).
There are some tasks waiting for us to make the adoption rate better:
*-sys
crates tend to have a relatively low MSRV, like 1.52 or something.system-deps
currently has a high MSRV of 1.65 because of its dependencytoml
. If we could lower the MSRV to some extent, it would be easier to convince those*-sys
crate authors to buy into the idea.*-sys
crates usepkg-config
andvcpkg
lovesegfault/buildkit#7.*-sys
crate maintainers.*-sys
is vendored or not. To support this, we need to model vendoring. One idea is that we isolate vendoring logic in a callback through thesystem-deps
API, so that we have control over its execution. For example, providing aSYSTEM_DEPS_MODE=probe|mode
environment for developers to make their own choice.*-sys
crates vendor sources lovesegfault/buildkit#13.system-deps
to prosper.Thanks for reading this lengthy issue. This is a long-term fight, and I believe by tackling the top 10s, we can make the adoption of
system-deps
more widespread.The text was updated successfully, but these errors were encountered: