From 4f97b9f62de94c971e2cdcff11504b1d26ddda95 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 5 Jun 2023 12:07:15 +0000 Subject: [PATCH] Update to Rust 1.70 (#657) --- .github/workflows/ci.yml | 10 ++++----- .github/workflows/deploy.yml | 8 +++---- .github/workflows/periodic-cargo-update.yml | 2 +- Cargo.lock | 21 ------------------- Cargo.toml | 2 +- full-node/Cargo.toml | 1 - full-node/src/cli.rs | 4 ++-- full-node/src/run.rs | 2 +- .../requests_subscriptions/executor.rs | 4 ++-- wasm-node/javascript/prepare.mjs | 2 +- 10 files changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f75a2c2c80..e54ad46d46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: test-64bits: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -39,7 +39,7 @@ jobs: test-32bits: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - run: apt-get update && apt install -y libc6-dev-i386 - uses: actions/checkout@v3 @@ -50,7 +50,7 @@ jobs: wasm-node-check: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -65,7 +65,7 @@ jobs: check-features: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -109,7 +109,7 @@ jobs: check-rustdoc-links: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8c5ef4a3c9..229db82bd2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -56,7 +56,7 @@ jobs: build-js-doc: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 with: @@ -82,7 +82,7 @@ jobs: build-rust-doc: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 with: @@ -103,7 +103,7 @@ jobs: build-tests-coverage: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - run: apt update && apt install -y jq - run: rustup component add llvm-tools-preview @@ -173,7 +173,7 @@ jobs: npm-publish: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3.6.0 diff --git a/.github/workflows/periodic-cargo-update.yml b/.github/workflows/periodic-cargo-update.yml index 19a057ae8c..a48dcf67bc 100644 --- a/.github/workflows/periodic-cargo-update.yml +++ b/.github/workflows/periodic-cargo-update.yml @@ -9,7 +9,7 @@ jobs: cargo-update: runs-on: ubuntu-latest container: - image: rust:1.69 + image: rust:1.70 steps: - uses: actions/checkout@v3 - run: cargo update --workspace diff --git a/Cargo.lock b/Cargo.lock index 3767b6081b..4c44a65074 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,17 +331,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -1324,15 +1313,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.2.6" @@ -2455,7 +2435,6 @@ dependencies = [ name = "smoldot-full-node" version = "0.1.0" dependencies = [ - "atty", "blake2-rfc", "clap", "ctrlc", diff --git a/Cargo.toml b/Cargo.toml index 5dfe817927..458b35fb03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" repository = "https://github.com/smol-dot/smoldot" [profile.dev] -debug = 1 # Default value is `2`, which contains the full debug info. `1` is enough for stack traces. +debug = 1 # Default value is `2`, which contains the full debug info. `1` is enough for stack traces. # TODO: use the named version after Cargo v1.71 opt-level = 2 panic = "abort" [profile.dev.package."*"] diff --git a/full-node/Cargo.toml b/full-node/Cargo.toml index b5f30c2680..cea98eac5f 100644 --- a/full-node/Cargo.toml +++ b/full-node/Cargo.toml @@ -14,7 +14,6 @@ name = "full-node" path = "src/main.rs" [dependencies] -atty = "0.2.14" blake2-rfc = { version = "0.2.18", default-features = false } clap = { version = "4.3.1", default-features = false, features = ["color", "derive", "help", "std", "suggestions", "usage"] } # Note: enabling/disabling some features modifies the internal behavior of clap, be careful ctrlc = "3.4.0" diff --git a/full-node/src/cli.rs b/full-node/src/cli.rs index 30596ae0de..ed54220d39 100644 --- a/full-node/src/cli.rs +++ b/full-node/src/cli.rs @@ -36,7 +36,7 @@ use smoldot::{ PeerId, }, }; -use std::{net::SocketAddr, path::PathBuf}; +use std::{io, net::SocketAddr, path::PathBuf}; // Note: the doc-comments applied to this struct and its field are visible when the binary is // started with `--help`. @@ -140,7 +140,7 @@ impl core::str::FromStr for ColorChoice { if s == "always" { Ok(ColorChoice::Always) } else if s == "auto" { - if atty::is(atty::Stream::Stderr) { + if io::IsTerminal::is_terminal(&io::stderr()) { Ok(ColorChoice::Always) } else { Ok(ColorChoice::Never) diff --git a/full-node/src/run.rs b/full-node/src/run.rs index c18d0f8348..e41a797863 100644 --- a/full-node/src/run.rs +++ b/full-node/src/run.rs @@ -51,7 +51,7 @@ mod network_service; pub async fn run(cli_options: cli::CliOptionsRun) { // Determine the actual CLI output by replacing `Auto` with the actual value. let cli_output = if let cli::Output::Auto = cli_options.output { - if atty::is(atty::Stream::Stderr) && cli_options.log.is_empty() { + if io::IsTerminal::is_terminal(&io::stderr()) && cli_options.log.is_empty() { cli::Output::Informant } else { cli::Output::Logs diff --git a/lib/src/json_rpc/requests_subscriptions/executor.rs b/lib/src/json_rpc/requests_subscriptions/executor.rs index ee0c2e9027..a8f6d9983a 100644 --- a/lib/src/json_rpc/requests_subscriptions/executor.rs +++ b/lib/src/json_rpc/requests_subscriptions/executor.rs @@ -294,8 +294,8 @@ mod tests { } // Then drop the queue and make sure that there's no clone of `counter` remaining. - let _ = Arc::try_unwrap(queue).unwrap(); - let () = Arc::try_unwrap(counter).unwrap(); + let _ = Arc::into_inner(queue).unwrap(); + let () = Arc::into_inner(counter).unwrap(); }) } } diff --git a/wasm-node/javascript/prepare.mjs b/wasm-node/javascript/prepare.mjs index 4265cd6024..b053536c4c 100755 --- a/wasm-node/javascript/prepare.mjs +++ b/wasm-node/javascript/prepare.mjs @@ -38,7 +38,7 @@ if (buildProfile != 'debug' && buildProfile != 'min-size-release') // The Rust version is pinned because the wasi target is still unstable. Without pinning, it is // possible for the wasm-js bindings to change between two Rust versions. Feel free to update // this version pin whenever you like, provided it continues to build. -const rustVersion = '1.69.0'; +const rustVersion = '1.70.0'; // Assume that the user has `rustup` installed and make sure that `rust_version` is available. // Because `rustup install` requires an Internet connection, check whether the toolchain is