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

Assorted dependency updates #3524

Merged
merged 9 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 126 additions & 121 deletions Cargo.lock

Large diffs are not rendered by default.

51 changes: 14 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
[package]
authors = [
"Daniel Silverstone <[email protected]>",
"Diggory Blake <[email protected]>",
]
build = "build.rs"
description = "Manage multiple rust installations with ease"
name = "rustup"
version = "1.26.0"
edition = "2021"
description = "Manage multiple rust installations with ease"
homepage = "https://github.com/rust-lang/rustup"
keywords = ["rustup", "multirust", "install", "proxy"]
license = "MIT OR Apache-2.0"
name = "rustup"
readme = "README.md"
repository = "https://github.com/rust-lang/rustup"
version = "1.26.0"
build = "build.rs"

[features]
curl-backend = ["download/curl-backend"]
Expand Down Expand Up @@ -42,7 +38,7 @@ otel = [
]

# Exports code dependent on private interfaces for the integration test suite
test = ["dep:once_cell", "dep:walkdir"]
test = ["dep:walkdir"]

# Sorted by alphabetic order
[dependencies]
Expand All @@ -60,16 +56,20 @@ flate2 = "1"
fs_at.workspace = true
git-testament = "0.2"
home = "0.5.4"
lazy_static.workspace = true
libc = "0.2"
once_cell = { workspace = true, optional = true }
once_cell.workspace = true
opener = "0.6.0"
# `openssl` is used by `curl` or `reqwest` backend although it isn't imported by rustup: this
# allows controlling the vendoring status without exposing the presence of the download crate.
openssl = { version = "0.10", optional = true }
opentelemetry = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
pulldown-cmark = { version = "0.9", default-features = false }
rand = "0.8"
regex = "1"
remove_dir_all = { version = "0.8.1", features = ["parallel"] }
retry = { version = "2", default-features = false, features = ["random"] }
rs_tracing = { version = "1.1", features = ["rs_tracing"] }
same-file = "1"
scopeguard = "1"
semver = "1.0"
Expand All @@ -85,32 +85,14 @@ threadpool = "1"
tokio = { workspace = true, optional = true }
toml = "0.8"
tracing-opentelemetry = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true, features = [
"env-filter",
] }
tracing-subscriber = { workspace = true, optional = true, features = ["env-filter"] }
tracing.workspace = true
url.workspace = true
wait-timeout = "0.2"
walkdir = { workspace = true, optional = true }
xz2 = "0.1.3"
zstd = "0.13"

[dependencies.openssl]
# Used by `curl` or `reqwest` backend although it isn't imported by our rustup :
# this allows controlling the vendoring status without exposing the presence of
# the download crate.
optional = true
version = "0.10"

[dependencies.retry]
default-features = false
features = ["random"]
version = "2.0.0"

[dependencies.rs_tracing]
features = ["rs_tracing"]
version = "1.1.0"

[target."cfg(windows)".dependencies]
cc = "1"
winreg = "0.51"
Expand Down Expand Up @@ -155,17 +137,15 @@ features = [
]
version = "0.48.0"


[dev-dependencies]
enum-map = "2.5.0"
once_cell.workspace = true
proptest.workspace = true
rustup-macros.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
trycmd = "0.14.13"

[build-dependencies]
lazy_static = "1"
once_cell.workspace = true
regex = "1"

[workspace]
Expand All @@ -176,7 +156,6 @@ anyhow = "1.0.69"
derivative = "2.2.0"
enum_dispatch = "0.3.11"
fs_at = "0.1.6"
lazy_static = "1"
once_cell = "1.18.0"
opentelemetry = { version = "0.20.0", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.13.0" }
Expand All @@ -185,9 +164,7 @@ rustup-macros = { path = "rustup-macros" }
tempfile = "3.8"
termcolor = "1.2"
thiserror = "1.0"
tokio = { version = "1.26.0", default-features = false, features = [
"rt-multi-thread",
] }
tokio = { version = "1.26.0", default-features = false, features = ["rt-multi-thread"] }
tracing = "0.1"
tracing-opentelemetry = { version = "0.21.0" }
tracing-subscriber = "0.3.16"
Expand Down
21 changes: 6 additions & 15 deletions download/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
[package]

authors = ["Brian Anderson <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
name = "download"
version = "1.26.0"
edition = "2021"
license = "MIT OR Apache-2.0"

[features]

default = ["reqwest-backend", "reqwest-rustls-tls", "reqwest-default-tls"]

curl-backend = ["curl"]
reqwest-backend = ["reqwest", "env_proxy", "lazy_static"]
reqwest-backend = ["reqwest", "env_proxy"]
reqwest-default-tls = ["reqwest/default-tls"]
reqwest-rustls-tls = ["reqwest/rustls-tls-native-roots"]

[dependencies]
anyhow.workspace = true
curl = { version = "0.4.44", optional = true }
env_proxy = { version = "0.4.1", optional = true }
lazy_static = { workspace = true, optional = true }
reqwest = { version = "0.11", default-features = false, features = [
"blocking",
"gzip",
"socks",
], optional = true }
once_cell.workspace = true
reqwest = { version = "0.11", default-features = false, features = ["blocking", "gzip", "socks"], optional = true }
thiserror.workspace = true
url.workspace = true

[dev-dependencies]
hyper = { version = "0.14", default-features = false, features = [
"tcp",
"server",
] }
hyper = { version = "0.14", default-features = false, features = ["tcp", "server"] }
tempfile.workspace = true
tokio = { workspace = true, default-features = false, features = ["sync"] }
54 changes: 23 additions & 31 deletions download/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ pub mod reqwest_be {

use anyhow::{anyhow, Context, Result};
#[cfg(any(feature = "reqwest-rustls-tls", feature = "reqwest-default-tls"))]
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use reqwest::blocking::{Client, ClientBuilder, Response};
use reqwest::{header, Proxy};
use url::Url;
Expand Down Expand Up @@ -324,40 +324,32 @@ pub mod reqwest_be {
.proxy(Proxy::custom(env_proxy))
.timeout(Duration::from_secs(30))
}

#[cfg(feature = "reqwest-rustls-tls")]
lazy_static! {
static ref CLIENT_RUSTLS_TLS: Client = {
let catcher = || {
client_generic().use_rustls_tls()
.build()
};
static CLIENT_RUSTLS_TLS: Lazy<Client> = Lazy::new(|| {
let catcher = || client_generic().use_rustls_tls().build();

// woah, an unwrap?!
// It's OK. This is the same as what is happening in curl.
//
// The curl::Easy::new() internally assert!s that the initialized
// Easy is not null. Inside reqwest, the errors here would be from
// the TLS library returning a null pointer as well.
catcher().unwrap()
});

// woah, an unwrap?!
// It's OK. This is the same as what is happening in curl.
//
// The curl::Easy::new() internally assert!s that the initialized
// Easy is not null. Inside reqwest, the errors here would be from
// the TLS library returning a null pointer as well.
catcher().unwrap()
};
}
#[cfg(feature = "reqwest-default-tls")]
lazy_static! {
static ref CLIENT_DEFAULT_TLS: Client = {
let catcher = || {
client_generic()
.build()
};
static CLIENT_DEFAULT_TLS: Lazy<Client> = Lazy::new(|| {
let catcher = || client_generic().build();

// woah, an unwrap?!
// It's OK. This is the same as what is happening in curl.
//
// The curl::Easy::new() internally assert!s that the initialized
// Easy is not null. Inside reqwest, the errors here would be from
// the TLS library returning a null pointer as well.
catcher().unwrap()
};
}
// woah, an unwrap?!
// It's OK. This is the same as what is happening in curl.
//
// The curl::Easy::new() internally assert!s that the initialized
// Easy is not null. Inside reqwest, the errors here would be from
// the TLS library returning a null pointer as well.
catcher().unwrap()
});

fn env_proxy(url: &Url) -> Option<Url> {
env_proxy::for_url(url).to_url()
Expand Down
6 changes: 2 additions & 4 deletions rustup-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[package]
edition = "2021"
name = "rustup-macros"
publish = false
version = "0.1.0"
edition = "2021"
publish = false

[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0.63"
quote = "1.0.23"
regex = "1.10.0"
sha2 = "0.10.6"
syn = { version = "2.0.13", features = ["full"] }
5 changes: 4 additions & 1 deletion src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

use anyhow::{anyhow, Result};
use cfg_if::cfg_if;
use rs_tracing::*;
// Public macros require availability of the internal symbols
use rs_tracing::{
close_trace_file, close_trace_file_internal, open_trace_file, trace_to_file_internal,
};

use rustup::cli::common;
use rustup::cli::proxy_mode;
Expand Down
12 changes: 5 additions & 7 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{cmp, env};

use anyhow::{anyhow, Context, Result};
use git_testament::{git_testament, render_testament};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;

use super::self_update;
use crate::cli::download_tracker::DownloadTracker;
Expand Down Expand Up @@ -566,12 +566,10 @@ pub(crate) fn list_overrides(cfg: &Cfg) -> Result<utils::ExitCode> {
git_testament!(TESTAMENT);

pub(crate) fn version() -> &'static str {
lazy_static! {
// Because we trust our `stable` branch given the careful release
// process, we mark it trusted here so that our version numbers look
// right when built from CI before the tag is pushed
static ref RENDERED: String = render_testament!(TESTAMENT, "stable");
}
// Because we trust our `stable` branch given the careful release
// process, we mark it trusted here so that our version numbers look
// right when built from CI before the tag is pushed
static RENDERED: Lazy<String> = Lazy::new(|| render_testament!(TESTAMENT, "stable"));
&RENDERED
}

Expand Down
7 changes: 2 additions & 5 deletions src/cli/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::io;
use std::path::PathBuf;

use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use regex::Regex;
use strsim::damerau_levenshtein;
use thiserror::Error as ThisError;
Expand All @@ -24,10 +24,7 @@ pub enum CLIError {
fn maybe_suggest_toolchain(bad_name: &str) -> String {
let bad_name = &bad_name.to_ascii_lowercase();
static VALID_CHANNELS: &[&str] = &["stable", "beta", "nightly"];
lazy_static! {
static ref NUMBERED: Regex = Regex::new(r"^\d+\.\d+$").unwrap();
}

static NUMBERED: Lazy<Regex> = Lazy::new(|| Regex::new(r"^\d+\.\d+$").unwrap());
if NUMBERED.is_match(bad_name) {
return format!(". Toolchain numbers tend to have three parts, e.g. {bad_name}.0");
}
Expand Down
6 changes: 2 additions & 4 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,12 +1139,10 @@ fn get_new_rustup_version(path: &Path) -> Option<String> {
}

fn parse_new_rustup_version(version: String) -> String {
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use regex::Regex;

lazy_static! {
static ref RE: Regex = Regex::new(r"\d+.\d+.\d+[0-9a-zA-Z-]*").unwrap();
}
static RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"\d+.\d+.\d+[0-9a-zA-Z-]*").unwrap());

let capture = RE.captures(&version);
let matched_version = match capture {
Expand Down
Loading