Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Cannot install on stock macOS #57

Closed
lilyball opened this issue Feb 5, 2019 · 4 comments · Fixed by #86
Closed

Cannot install on stock macOS #57

lilyball opened this issue Feb 5, 2019 · 4 comments · Fixed by #86

Comments

@lilyball
Copy link

lilyball commented Feb 5, 2019

cargo-tree won't build on stock macOS due to a transitive dependency on openssl-sys which I believe comes from cargo. The issue is that macOS ships with a very old version of OpenSSL that openssl-sys does not support. I'm pretty sure this can be worked around with brew install openssl but I don't use Homebrew so that doesn't work for me.

A quick look at https://github.com/rust-lang/cargo/blob/master/Cargo.toml indicates that there's a vendored-openssl feature flag, it might be a good idea to opt into that feature flag when building cargo-tree on macOS (or at least to re-expose it so I can select it myself).

@sfackler
Copy link
Owner

sfackler commented Feb 5, 2019

Sure - seems reasonable to add a vendored-openssl Cargo feature here.

@dtolnay
Copy link

dtolnay commented Feb 5, 2019

It should be possible to select Cargo's vendored-openssl feature without cargo-tree specifically re-exposing it:

cargo install cargo-tree --features cargo/vendored-openssl

@lilyball
Copy link
Author

lilyball commented Feb 5, 2019

Huh, that's not documented very well.

Incidentally, I think cargo's openssl feature actually isn't the source of this after all. It's marked optional and I was really confused as to why it was being picked up. It's not. It's the git2 dependency, which by default includes openssl.

Incidentally, I don't see any way, as an end user, of being able to say "turn off default features for this dependency". cargo install cargo-tree --no-default-features is going to ensure cargo-tree itself doesn't have default features but I wouldn't expect that to turn off default features on its dependencies (though the documentation isn't explicit, so it certainly could - EDIT: it doesn't).

That said, --features cargo/vendored-openssl seems to work. I guess it turns on the feature for openssl overall even though the dependency is coming via git2 instead of cargo. I bet I could write --features openssl/vendored instead if I wanted to.

@lilyball
Copy link
Author

lilyball commented Feb 5, 2019

Ok so, short term: Update the README to specify that on macOS you can say --features openssl/vendored.

Long term: Figure out how to disable the default features on git2. I don't know if you can just re-declare the git2 dependency with features disabled, or what. Ideally cargo would have a feature that disables default features on git2, but I'm not sure if there's actually a way to specify that. I wish you could just write something like --features git2/-default to turn off the default feature.

sfackler added a commit that referenced this issue Dec 30, 2019
This both makes the crate compile way faster and avoids having to touch
tons of unstable, undocumented cargo internals. This requires Rust 1.41
(the current beta) for some cargo-metadata features.

There are some subtle differences in the new output (particularly in
handling dependencies between crates in workspaces), but they're pretty
minor.

Closes #73
Closes #69
Closes #66
Closes #65
Closes #63
Closes #61
Closes #57
Closes #20
sfackler added a commit that referenced this issue Dec 30, 2019
This both makes the crate compile way faster and avoids having to touch
tons of unstable, undocumented cargo internals. This requires Rust 1.41
(the current beta) for some cargo-metadata features.

There are some subtle differences in the new output (particularly in
handling dependencies between crates in workspaces), but they're pretty
minor.

Closes #73
Closes #69
Closes #66
Closes #65
Closes #63
Closes #61
Closes #57
Closes #20
sfackler added a commit that referenced this issue Dec 30, 2019
This both makes the crate compile way faster and avoids having to touch
tons of unstable, undocumented cargo internals. This requires Rust 1.41
(the current beta) for some cargo-metadata features.

There are some subtle differences in the new output (particularly in
handling dependencies between crates in workspaces), but they're pretty
minor.

Closes #73
Closes #69
Closes #66
Closes #65
Closes #63
Closes #61
Closes #57
Closes #20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants