Skip to content

Commit

Permalink
cargo: use features to determine how we build curl
Browse files Browse the repository at this point in the history
Alpine Linux builds will fail for a `static-ssl`. Instead we must link
against system openssl. We now introduce a feature set that allows to
link against system ssl using `--no-default-features --features system-ssl`.

For a musl system, you also must specify
RUSTFLAGS="-C target-feature=-crt-static".

The alternative approach is to use using a
`[target.'cfg(target_env="musl")'.dependencies]` specification, that
selects features based on the `target_env`. However since we
are currently using the Cargo resolver 1, this does not work. We would
need to switch to resolver 2. In general the feature selection is more
versatile since we ask users to select the appropriate set for their
platform.
  • Loading branch information
dsp committed Mar 5, 2024
1 parent 953a5c6 commit dcd4df4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rye/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clap = { version = "4.3.5", default-features = false, features = [
] }
clap_complete = "4.2.1"
console = "0.15.7"
curl = { version = "0.4.44", features = ["ssl", "static-curl", "static-ssl"] }
curl = { version = "0.4.44", features = ["ssl", "static-curl"] }
decompress = { version = "0.6.0", default-features = false, features = [
"tarzst",
"targz",
Expand Down Expand Up @@ -75,3 +75,7 @@ static_vcruntime = "2.0.0"
fslock = "0.2.1"
insta = { version = "1.35.1", features = ["filters"] }
insta-cmd = "0.5.0"

[features]
default = ["curl/static-ssl"]
system-ssl = []

0 comments on commit dcd4df4

Please sign in to comment.