git.delta.rocks / jrsonnet / refs/commits / 80f6128c09ce

difftreelog

feat(jrb) use native-tls on apple/windows-mingw

pkwxmtqpYaroslav Bolyukin2026-05-07parent: #de9f0cb.patch.diff
in: master
Otherwise it is has some quirks. Also allows downstreams to have
different features for rustls if not building with jrb.

5 files changed

modifiedCargo.lockdiffbeforeafterboth
830source = "registry+https://github.com/rust-lang/crates.io-index"830source = "registry+https://github.com/rust-lang/crates.io-index"
831checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"831checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
832
833[[package]]
834name = "foreign-types"
835version = "0.3.2"
836source = "registry+https://github.com/rust-lang/crates.io-index"
837checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
838dependencies = [
839 "foreign-types-shared",
840]
841
842[[package]]
843name = "foreign-types-shared"
844version = "0.1.1"
845source = "registry+https://github.com/rust-lang/crates.io-index"
846checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
832847
833[[package]]848[[package]]
834name = "form_urlencoded"849name = "form_urlencoded"
1356checksum = "39eb0623e15e4cb83c02ce6a959e48fadd1ae3b715b36b5acc01816e01388c82"1371checksum = "39eb0623e15e4cb83c02ce6a959e48fadd1ae3b715b36b5acc01816e01388c82"
1357dependencies = [1372dependencies = [
1358 "bstr",1373 "bstr",
1359 "hashbrown 0.16.1",1374 "hashbrown 0.15.5",
1360]1375]
13611376
1362[[package]]1377[[package]]
2124 "tower-service",2139 "tower-service",
2125]2140]
2141
2142[[package]]
2143name = "hyper-tls"
2144version = "0.6.0"
2145source = "registry+https://github.com/rust-lang/crates.io-index"
2146checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
2147dependencies = [
2148 "bytes",
2149 "http-body-util",
2150 "hyper",
2151 "hyper-util",
2152 "native-tls",
2153 "tokio",
2154 "tokio-native-tls",
2155 "tower-service",
2156]
21262157
2127[[package]]2158[[package]]
2128name = "hyper-util"2159name = "hyper-util"
2933 "windows-sys 0.61.2",2964 "windows-sys 0.61.2",
2934]2965]
2966
2967[[package]]
2968name = "native-tls"
2969version = "0.2.18"
2970source = "registry+https://github.com/rust-lang/crates.io-index"
2971checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2"
2972dependencies = [
2973 "libc",
2974 "log",
2975 "openssl",
2976 "openssl-probe",
2977 "openssl-sys",
2978 "schannel",
2979 "security-framework",
2980 "security-framework-sys",
2981 "tempfile",
2982]
29352983
2936[[package]]2984[[package]]
2937name = "nix"2985name = "nix"
3016source = "registry+https://github.com/rust-lang/crates.io-index"3064source = "registry+https://github.com/rust-lang/crates.io-index"
3017checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"3065checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
3066
3067[[package]]
3068name = "openssl"
3069version = "0.10.78"
3070source = "registry+https://github.com/rust-lang/crates.io-index"
3071checksum = "f38c4372413cdaaf3cc79dd92d29d7d9f5ab09b51b10dded508fb90bb70b9222"
3072dependencies = [
3073 "bitflags",
3074 "cfg-if",
3075 "foreign-types",
3076 "libc",
3077 "once_cell",
3078 "openssl-macros",
3079 "openssl-sys",
3080]
3081
3082[[package]]
3083name = "openssl-macros"
3084version = "0.1.1"
3085source = "registry+https://github.com/rust-lang/crates.io-index"
3086checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
3087dependencies = [
3088 "proc-macro2",
3089 "quote",
3090 "syn",
3091]
30183092
3019[[package]]3093[[package]]
3020name = "openssl-probe"3094name = "openssl-probe"
3021version = "0.2.1"3095version = "0.2.1"
3022source = "registry+https://github.com/rust-lang/crates.io-index"3096source = "registry+https://github.com/rust-lang/crates.io-index"
3023checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"3097checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
3098
3099[[package]]
3100name = "openssl-sys"
3101version = "0.9.114"
3102source = "registry+https://github.com/rust-lang/crates.io-index"
3103checksum = "13ce1245cd07fcc4cfdb438f7507b0c7e4f3849a69fd84d52374c66d83741bb6"
3104dependencies = [
3105 "cc",
3106 "libc",
3107 "pkg-config",
3108 "vcpkg",
3109]
30243110
3025[[package]]3111[[package]]
3026name = "option-ext"3112name = "option-ext"
3130source = "registry+https://github.com/rust-lang/crates.io-index"3216source = "registry+https://github.com/rust-lang/crates.io-index"
3131checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"3217checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
3218
3219[[package]]
3220name = "pkg-config"
3221version = "0.3.33"
3222source = "registry+https://github.com/rust-lang/crates.io-index"
3223checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
31323224
3133[[package]]3225[[package]]
3134name = "plain"3226name = "plain"
3470 "http-body-util",3562 "http-body-util",
3471 "hyper",3563 "hyper",
3472 "hyper-rustls",3564 "hyper-rustls",
3565 "hyper-tls",
3473 "hyper-util",3566 "hyper-util",
3474 "js-sys",3567 "js-sys",
3475 "log",3568 "log",
3476 "mime",3569 "mime",
3570 "native-tls",
3477 "percent-encoding",3571 "percent-encoding",
3478 "pin-project-lite",3572 "pin-project-lite",
3479 "quinn",3573 "quinn",
3482 "rustls-platform-verifier",3576 "rustls-platform-verifier",
3483 "sync_wrapper",3577 "sync_wrapper",
3484 "tokio",3578 "tokio",
3579 "tokio-native-tls",
3485 "tokio-rustls",3580 "tokio-rustls",
3486 "tower",3581 "tower",
3487 "tower-http",3582 "tower-http",
4095 "windows-sys 0.61.2",4190 "windows-sys 0.61.2",
4096]4191]
4192
4193[[package]]
4194name = "tokio-native-tls"
4195version = "0.3.1"
4196source = "registry+https://github.com/rust-lang/crates.io-index"
4197checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
4198dependencies = [
4199 "native-tls",
4200 "tokio",
4201]
40974202
4098[[package]]4203[[package]]
4099name = "tokio-rustls"4204name = "tokio-rustls"
4332source = "registry+https://github.com/rust-lang/crates.io-index"4437source = "registry+https://github.com/rust-lang/crates.io-index"
4333checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"4438checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
4439
4440[[package]]
4441name = "vcpkg"
4442version = "0.2.15"
4443source = "registry+https://github.com/rust-lang/crates.io-index"
4444checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
43344445
4335[[package]]4446[[package]]
4336name = "version_check"4447name = "version_check"
modifiedCargo.tomldiffbeforeafterboth
125# Bundler125# Bundler
126tracing = "0.1.44"126tracing = "0.1.44"
127tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }127tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
128reqwest = { version = "0.13", features = [128reqwest = { version = "0.13", default-features = false, features = [
129 "blocking",129 "blocking",
130 "rustls",
131], default-features = false }130] }
132zip = { version = "8", default-features = false, features = ["deflate"] }131zip = { version = "8", default-features = false, features = ["deflate"] }
133directories = "6.0.0"132directories = "6.0.0"
134gix = { version = "0.83.0", features = [133gix = { version = "0.83.0", features = ["blocking-network-client"] }
135 "blocking-network-client",
136 "blocking-http-transport-reqwest-rust-tls",
137] }
138camino = { version = "1.2.2", features = ["serde1"] }134camino = { version = "1.2.2", features = ["serde1"] }
139135
modifiedcrates/jrsonnet-pkg/Cargo.tomldiffbeforeafterboth
20peg.workspace = true20peg.workspace = true
2121
22# Gix for git repos, reqwest + zip for github22# Gix for git repos, reqwest + zip for github
23gix.workspace = true
24reqwest.workspace = true
25zip.workspace = true23zip.workspace = true
26url.workspace = true24url.workspace = true
27camino.workspace = true25camino.workspace = true
2826
29# Global cache dir27# Global cache dir
30directories.workspace = true28directories.workspace = true
29
30[target.'cfg(not(any(all(target_os = "windows", target_env = "gnu"), target_vendor = "apple")))'.dependencies]
31gix = { workspace = true, features = [
32 "blocking-http-transport-reqwest-rust-tls",
33] }
34reqwest = { workspace = true, features = ["rustls"] }
35
36[target.'cfg(any(all(target_os = "windows", target_env = "gnu"), target_vendor = "apple"))'.dependencies]
37gix = { workspace = true, features = [
38 "blocking-http-transport-reqwest-native-tls",
39] }
40reqwest = { workspace = true, features = ["native-tls"] }
3141
modifiedcrates/jrsonnet-pkg/src/install/github.rsdiffbeforeafterboth
14use super::{14use super::{
15 Error, LocalExtraction, ResolveResult, Result, VendorSource,15 Error, LocalExtraction, ResolveResult, Result, VendorSource,
16 accessor::{AccessorEntry, ZipFileAccessor},16 accessor::{AccessorEntry, ZipFileAccessor},
17 make_symlink,
17};18};
18use crate::{19use crate::{
19 install::{PKG_USER_AGENT, cache_dir},20 install::{PKG_USER_AGENT, cache_dir},
86 )?)87 )?)
87}88}
88
89#[cfg(unix)]
90fn make_symlink(target: &str, link: &Path) -> std::io::Result<()> {
91 std::os::unix::fs::symlink(target, link)
92}
93
94#[cfg(windows)]
95fn make_symlink(target: &str, link: &Path) -> std::io::Result<()> {
96 std::os::windows::fs::symlink_file(target, link)
97}
98
99#[cfg(not(any(unix, windows)))]
100fn make_symlink(_target: &str, _link: &Path) -> std::io::Result<()> {
101 Err(std::io::Error::new(
102 std::io::ErrorKind::Unsupported,
103 "symlinks are not supported on this platform",
104 ))
105}
10689
107fn extract_subdir(archive: &ZipFileAccessor, subdir: &SubDir, dest: &Path) -> Result<()> {90fn extract_subdir(archive: &ZipFileAccessor, subdir: &SubDir, dest: &Path) -> Result<()> {
108 archive.iter(subdir, &mut |name, entry| {91 archive.iter(subdir, &mut |name, entry| {
modifiedcrates/jrsonnet-pkg/src/install/mod.rsdiffbeforeafterboth
120 Ok(plan)120 Ok(plan)
121}121}
122
123#[cfg(unix)]
124fn make_symlink(target: &str, link: &Path) -> std::io::Result<()> {
125 std::os::unix::fs::symlink(target, link)
126}
127
128#[cfg(windows)]
129fn make_symlink(target: &str, link: &Path) -> std::io::Result<()> {
130 std::os::windows::fs::symlink_dir(target, link)
131}
132
133#[cfg(not(any(unix, windows)))]
134fn make_symlink(_target: &str, _link: &Path) -> std::io::Result<()> {
135 Err(std::io::Error::new(
136 std::io::ErrorKind::Unsupported,
137 "symlinks are not supported on this platform",
138 ))
139}
122140
123fn is_up_to_date(dest: &Path, version: &str) -> bool {141fn is_up_to_date(dest: &Path, version: &str) -> bool {
124 fs::read_to_string(dest.join(VERSION_FILE)).is_ok_and(|v| v.trim() == version)142 fs::read_to_string(dest.join(VERSION_FILE)).is_ok_and(|v| v.trim() == version)
182 fs::remove_file(&dest).map_err(|e| Error::Io(dest.clone(), e))?;200 fs::remove_file(&dest).map_err(|e| Error::Io(dest.clone(), e))?;
183 }201 }
184 info!("symlink {path} -> {target}");202 info!("symlink {path} -> {target}");
185 std::os::unix::fs::symlink(target.as_std_path(), &dest)203 make_symlink(target.as_str(), &dest).map_err(|e| Error::Io(dest.clone(), e))?;
186 .map_err(|e| Error::Io(dest.clone(), e))?;
187 }204 }
188 }205 }