diff --git a/Cargo.toml b/Cargo.toml index 7c114c4b9..4e7dab1cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,26 +23,26 @@ tag-prefix = "" lto = true [workspace.dependencies] -anyhow = "1.0.82" +anyhow = "1.0.92" archspec = "0.1.3" assert_matches = "1.5.0" -async-compression = { version = "0.4.8", features = [ +async-compression = { version = "0.4.17", features = [ "gzip", "tokio", "bzip2", "zstd", ] } async-fd-lock = "0.2.0" -fs4 = "0.9.1" -async-trait = "0.1.80" -axum = { version = "0.7.5", default-features = false, features = [ +fs4 = "0.10.0" +async-trait = "0.1.83" +axum = { version = "0.7.7", default-features = false, features = [ "tokio", "http1", ] } -base64 = "0.22.0" -bindgen = "0.69.4" +base64 = "0.22.1" +bindgen = "0.69.5" blake2 = "0.10.6" -bytes = "1.6.0" +bytes = "1.8.0" bzip2 = "0.4.4" cache_control = "0.2.0" cfg-if = "1.0" @@ -51,80 +51,82 @@ chrono = { version = "0.4.38", default-features = false, features = [ "serde", "alloc", ] } -clap = { version = "4.5.4", features = ["derive"] } -cmake = "0.1.50" +clap = { version = "4.5.20", features = ["derive"] } +cmake = "0.1.51" console = { version = "0.15.8", features = ["windows-console-colors"] } criterion = "0.5" -dashmap = "6.0.1" +dashmap = "6.1.0" difference = "2.0.0" digest = "0.10.7" dirs = "5.0.1" -dunce = "1.0.4" +dunce = "1.0.5" enum_dispatch = "0.3.13" -fs-err = { version = "2.11.0", features = ["tokio"] } +fs-err = { version = "3.0.0", features = ["tokio"] } fslock = "0.2.1" -futures = "0.3.30" -futures-util = "0.3.30" +futures = "0.3.31" +futures-util = "0.3.31" fxhash = "0.2.1" -generic-array = "0.14.4" -getrandom = { version = "0.2.14", default-features = false } +# lots of other crates are still stuck on older version +generic-array = "0.14.7" +getrandom = { version = "0.2.15", default-features = false } glob = "0.3.1" -google-cloud-auth = { version = "0.13.2", default-features = false } +google-cloud-auth = { version = "0.17.1", default-features = false } +google-cloud-token = "0.1.2" hex = "0.4.3" hex-literal = "0.4.1" http = "1.1" http-cache-semantics = "2.1.0" humansize = "2.1.3" humantime = "2.1.0" -indexmap = "2.2.6" +indexmap = "2.6.0" indicatif = "0.17.8" -insta = { version = "1.38.0" } +insta = { version = "1.41.1" } itertools = "0.13.0" -json-patch = "2.0.0" -keyring = "3.1.0" -lazy-regex = "3.1.0" -lazy_static = "1.4.0" +json-patch = "3.0.1" +keyring = "3.6.1" +lazy-regex = "3.3.0" +lazy_static = "1.5.0" libc = { version = "0.2" } -libloading = "0.8.3" -libz-sys = { version = "1.1.16", default-features = false } +libloading = "0.8.5" +libz-sys = { version = "1.1.20", default-features = false } md-5 = "0.10.6" -memchr = "2.7.2" -memmap2 = "0.9.4" +memchr = "2.7.4" +memmap2 = "0.9.5" netrc-rs = "0.1.2" nom = "7.1.3" num_cpus = "1.16.0" -once_cell = "1.19.0" -ouroboros = "0.18.3" -parking_lot = "0.12.1" -pathdiff = "0.2.1" -pep440_rs = { version = "0.6.0" } -pep508_rs = { version = "0.6.0" } +once_cell = "1.20.2" +ouroboros = "0.18.4" +parking_lot = "0.12.3" +pathdiff = "0.2.2" +pep440_rs = { version = "0.6.6" } +pep508_rs = { version = "0.6.1" } percent-encoding = "2.3.1" -pin-project-lite = "0.2.14" +pin-project-lite = "0.2.15" plist = "1" -purl = { version = "0.1.2", features = ["serde"] } -quote = "1.0.36" +purl = { version = "0.1.3", features = ["serde"] } +quote = "1.0.37" rand = "0.8.5" -reflink-copy = "0.1.16" -regex = "1.10.4" -reqwest = { version = "0.12.3", default-features = false } -reqwest-middleware = "0.3.0" -reqwest-retry = "0.6.0" +reflink-copy = "0.1.19" +regex = "1.11.1" +reqwest = { version = "0.12.9", default-features = false } +reqwest-middleware = "0.3.3" +reqwest-retry = "0.6.1" resolvo = { version = "0.8.2" } retry-policies = { version = "0.4.0", default-features = false } -rmp-serde = { version = "1.2.0" } -rstest = { version = "0.21.0" } +rmp-serde = { version = "1.3.0" } +rstest = { version = "0.23.0" } rstest_reuse = "0.7.0" -simd-json = { version = "0.14.0", features = ["serde_impl"] } -serde = { version = "1.0.198" } -serde_json = { version = "1.0.116" } +simd-json = { version = "0.14.2", features = ["serde_impl"] } +serde = { version = "1.0.214" } +serde_json = { version = "1.0.132" } serde_repr = "0.1" -serde_with = "3.7.0" +serde_with = "3.11.0" serde_yaml = "0.9.34" serde-untagged = "0.1.6" sha2 = "0.10.8" shlex = "1.3.0" -similar-asserts = "1.5.0" +similar-asserts = "1.6.0" smallvec = { version = "1.13.2", features = [ "serde", "const_new", @@ -133,27 +135,27 @@ smallvec = { version = "1.13.2", features = [ ] } strum = { version = "0.26.3", features = ["derive"] } superslice = "1.0.0" -syn = "2.0.59" -sysinfo = "0.30.10" -tar = "0.4.40" +syn = "2.0.86" +sysinfo = "0.32.0" +tar = "0.4.42" tempdir = "0.3.7" -tempfile = "3.10.1" +tempfile = "3.13.0" temp-env = "0.3.6" -test-log = "0.2.15" +test-log = "0.2.16" thiserror = "1.0" -tokio = { version = "1.37.0", default-features = false } -tokio-stream = "0.1.15" -tokio-util = "0.7.10" -tower = { version = "0.4.13", default-features = false } -tower-http = { version = "0.5.2", default-features = false } +tokio = { version = "1.41.0", default-features = false } +tokio-stream = "0.1.16" +tokio-util = "0.7.12" +tower = { version = "0.5.1", default-features = false } +tower-http = { version = "0.6.1", default-features = false } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", default-features = false } -tracing-test = { version = "0.2.4" } -trybuild = { version = "1.0.91" } -typed-path = { version = "0.9.2" } -url = { version = "2.5.0" } -uuid = { version = "1.8.0", default-features = false } +tracing-test = { version = "0.2.5" } +trybuild = { version = "1.0.101" } +typed-path = { version = "0.9.3" } +url = { version = "2.5.2" } +uuid = { version = "1.11.0", default-features = false } walkdir = "2.5.0" -windows-sys = { version = "0.52.0", default-features = false } -zip = { version = "2.1.3", default-features = false } -zstd = { version = "0.13.1", default-features = false } +windows-sys = { version = "0.59.0", default-features = false } +zip = { version = "2.2.0", default-features = false } +zstd = { version = "0.13.2", default-features = false } diff --git a/crates/file_url/Cargo.toml b/crates/file_url/Cargo.toml index d26ac8b15..423fb018c 100644 --- a/crates/file_url/Cargo.toml +++ b/crates/file_url/Cargo.toml @@ -13,7 +13,7 @@ url = { workspace = true } percent-encoding = { workspace = true } itertools = { workspace = true } typed-path = { workspace = true } -thiserror = "1.0.61" +thiserror = "1.0.66" [dev-dependencies] rstest = { workspace = true } diff --git a/crates/rattler-bin/Cargo.toml b/crates/rattler-bin/Cargo.toml index e6fd1d004..d3645b9b2 100644 --- a/crates/rattler-bin/Cargo.toml +++ b/crates/rattler-bin/Cargo.toml @@ -29,7 +29,7 @@ indicatif = { workspace = true } once_cell = { workspace = true } rattler = { path="../rattler", version = "0.27.16", default-features = false, features = ["indicatif"] } rattler_conda_types = { path="../rattler_conda_types", version = "0.28.3", default-features = false } -rattler_networking = { path="../rattler_networking", version = "0.21.4", default-features = false, features = ["google-cloud-auth"] } +rattler_networking = { path="../rattler_networking", version = "0.21.4", default-features = false, features = ["gcs"] } rattler_repodata_gateway = { path="../rattler_repodata_gateway", version = "0.21.18", default-features = false, features = ["gateway"] } rattler_solve = { path="../rattler_solve", version = "1.1.0", default-features = false, features = ["resolvo", "libsolv_c"] } rattler_virtual_packages = { path="../rattler_virtual_packages", version = "1.1.7", default-features = false } diff --git a/crates/rattler_libsolv_c/Cargo.toml b/crates/rattler_libsolv_c/Cargo.toml index fc1fec425..ea322f64c 100644 --- a/crates/rattler_libsolv_c/Cargo.toml +++ b/crates/rattler_libsolv_c/Cargo.toml @@ -19,7 +19,7 @@ libz-sys = { workspace = true, features = ["static"] } anyhow = { workspace = true } # 1.0.84 would fail to compile this library specifically on macOS. # For now we just pin an older version. -cc = "1.0.106" +cc = "1.1.31" cmake = { workspace = true } [package.metadata.cargo-udeps.ignore] diff --git a/crates/rattler_networking/Cargo.toml b/crates/rattler_networking/Cargo.toml index 69625a666..0b43b5958 100644 --- a/crates/rattler_networking/Cargo.toml +++ b/crates/rattler_networking/Cargo.toml @@ -12,8 +12,9 @@ readme.workspace = true [features] default = ["native-tls"] -native-tls = ['reqwest/native-tls', "google-cloud-auth?/default-tls"] -rustls-tls = ['reqwest/rustls-tls', "google-cloud-auth?/rustls-tls"] +native-tls = ["reqwest/native-tls", "google-cloud-auth?/default-tls"] +rustls-tls = ["reqwest/rustls-tls", "google-cloud-auth?/rustls-tls"] +gcs = ["google-cloud-auth", "google-cloud-token"] [dependencies] anyhow = { workspace = true } @@ -23,6 +24,7 @@ chrono = { workspace = true } dirs = { workspace = true } fslock = { workspace = true } google-cloud-auth = { workspace = true, optional = true } +google-cloud-token = { workspace = true, optional = true } http = { workspace = true } itertools = { workspace = true } keyring = { workspace = true, features = ["apple-native", "windows-native", "async-secret-service", "async-io", "crypto-rust"] } diff --git a/crates/rattler_networking/src/gcs_middleware.rs b/crates/rattler_networking/src/gcs_middleware.rs index 46c20d177..89b027ed0 100644 --- a/crates/rattler_networking/src/gcs_middleware.rs +++ b/crates/rattler_networking/src/gcs_middleware.rs @@ -1,6 +1,7 @@ //! Middleware to handle `gcs://` URLs to pull artifacts from an GCS use async_trait::async_trait; -use google_cloud_auth::project::{create_token_source, Config}; +use google_cloud_auth::{project::Config, token::DefaultTokenSourceProvider}; +use google_cloud_token::TokenSourceProvider; use reqwest::{Request, Response}; use reqwest_middleware::{Middleware, Next, Result as MiddlewareResult}; use url::Url; @@ -40,23 +41,24 @@ async fn authenticate_with_google_cloud(mut req: Request) -> MiddlewareResult match ts.token().await { + let config = Config::default() + .with_audience(audience) + .with_scopes(&scopes); + + match DefaultTokenSourceProvider::new(config).await { + Ok(provider) => match provider.token_source().token().await { Ok(token) => { - let bearer_auth = format!("Bearer {}", token.access_token); + let bearer_auth = format!("Bearer {}", token); let header_value = reqwest::header::HeaderValue::from_str(&bearer_auth) .map_err(reqwest_middleware::Error::middleware)?; req.headers_mut() .insert(reqwest::header::AUTHORIZATION, header_value); Ok(req) } - Err(e) => Err(reqwest_middleware::Error::Middleware(anyhow::Error::new(e))), + Err(e) => Err(reqwest_middleware::Error::Middleware(anyhow::anyhow!( + "Failed to get GCS token: {:?}", + e + ))), }, Err(e) => Err(reqwest_middleware::Error::Middleware(anyhow::Error::new(e))), } diff --git a/crates/rattler_networking/src/lib.rs b/crates/rattler_networking/src/lib.rs index a25ce697e..c8ba7ff18 100644 --- a/crates/rattler_networking/src/lib.rs +++ b/crates/rattler_networking/src/lib.rs @@ -6,9 +6,9 @@ pub use authentication_storage::{authentication::Authentication, storage::Authen pub use mirror_middleware::MirrorMiddleware; pub use oci_middleware::OciMiddleware; -#[cfg(feature = "google-cloud-auth")] +#[cfg(feature = "gcs")] pub mod gcs_middleware; -#[cfg(feature = "google-cloud-auth")] +#[cfg(feature = "gcs")] pub use gcs_middleware::GCSMiddleware; pub mod authentication_middleware; diff --git a/crates/rattler_shell/Cargo.toml b/crates/rattler_shell/Cargo.toml index bd4f59e89..2c99a4b83 100644 --- a/crates/rattler_shell/Cargo.toml +++ b/crates/rattler_shell/Cargo.toml @@ -17,7 +17,7 @@ itertools = { workspace = true } rattler_conda_types = { path="../rattler_conda_types", version = "0.28.3", default-features = false } serde_json = { workspace = true, features = ["preserve_order"] } shlex = { workspace = true } -sysinfo = { workspace = true, optional = true } +sysinfo = { workspace = true , optional = true } tempfile = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } diff --git a/crates/rattler_shell/src/shell/mod.rs b/crates/rattler_shell/src/shell/mod.rs index 4d5e13580..99c316a83 100644 --- a/crates/rattler_shell/src/shell/mod.rs +++ b/crates/rattler_shell/src/shell/mod.rs @@ -662,16 +662,21 @@ impl ShellEnum { // Get current process information let mut current_pid = get_current_pid().ok()?; - system_info.refresh_process(current_pid); + system_info.refresh_processes(sysinfo::ProcessesToUpdate::Some(&[current_pid]), true); while let Some(parent_process_id) = system_info .process(current_pid) .and_then(sysinfo::Process::parent) { // Get the name of the parent process - system_info.refresh_process(parent_process_id); + system_info + .refresh_processes(sysinfo::ProcessesToUpdate::Some(&[parent_process_id]), true); let parent_process = system_info.process(parent_process_id)?; - let parent_process_name = parent_process.name().to_lowercase(); + let parent_process_name = parent_process + .name() + .to_string_lossy() + .to_lowercase() + .to_string(); let shell: Option = if parent_process_name.contains("bash") { Some(Bash.into()) @@ -683,7 +688,7 @@ impl ShellEnum { || (parent_process_name.contains("python") && parent_process .cmd().iter() - .any(|arg| arg.contains("xonsh"))) + .any(|arg| arg.to_string_lossy().contains("xonsh"))) { Some(Xonsh.into()) } else if parent_process_name.contains("fish") { @@ -695,7 +700,7 @@ impl ShellEnum { { Some( PowerShell { - executable_path: parent_process_name.clone(), + executable_path: parent_process_name.to_string(), } .into(), )