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

Compile crate based on target platform instead of exposing features? #208

Open
thomaseizinger opened this issue Dec 10, 2019 · 0 comments
Open

Comments

@thomaseizinger
Copy link
Contributor

We are using shiplift in a crate that we ship on three major platforms: windows, macos and linux.

Unfortunately, it is not possible to use different features of the same crate depending on the platform with cargo: rust-lang/cargo#2524

Because of that and the way the crate is currently laid out makes it a bit painful to compile because we have to define two non-default features windows and unix and pass the desired feature upon compilation.

I saw that there has already been an attempt to make using this crate on Windows easier: #197

Looking at the dependencies and with rust-lang/cargo#2524 in mind, I think there is a solution we could go for that makes consuming this crate among several platforms easier:

  • We only really need openssl on Windows.
  • On Windows, we probably always want to vendor openssl to make compilation easier.
  • We only need hyperlocal on unix systems.

Given that, I feel like we could define these dependencies based on the target platform instead of defining features.

The downside of the above approach would be that one could not use the crate on Unix with SSL but I am not sure what that would be useful for anyway.
If we still wanted to support that, I believe we could always define an optional feature that adds the openssl crate.

Opinions?

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

No branches or pull requests

1 participant