From 82664e3c82492ddfde41533a829859dd129125d6 Mon Sep 17 00:00:00 2001 From: mataha Date: Mon, 28 Aug 2023 16:25:30 +0200 Subject: [PATCH] Bump MSRV to 1.70.0 The intention is to take advantage of `std::io::IsTerminal` that landed in 1.70.0, both in `bat` and its dependencies (`clap`, `grep-cli`). This will fix #2570 as well - `grep-cli` 0.1.9 has a patch for that. Signed-off-by: mataha --- CHANGELOG.md | 3 ++ Cargo.lock | 110 ++++++++------------------------------------- Cargo.toml | 10 ++--- README.md | 2 +- doc/README-ja.md | 2 +- doc/README-ko.md | 2 +- doc/README-ru.md | 2 +- doc/README-zh.md | 2 +- src/bin/bat/app.rs | 3 +- 9 files changed, 31 insertions(+), 105 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0915d8..51f27b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,12 @@ ## Bugfixes +- Fix `more` not being found on Windows when provided via `BAT_PAGER`, see #2570, #2580, and #2651 (@mataha) + ## Other - Output directory for generated assets (completion, manual) can be customized, see #2515 (@tranzystorek-io) +- Bump MSRV to 1.70, see #2651 (@mataha) ## Syntaxes diff --git a/Cargo.lock b/Cargo.lock index c506b811..ee318ab6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,16 +37,15 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle 1.0.0", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] @@ -82,9 +81,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle 1.0.0", "windows-sys 0.48.0", @@ -105,17 +104,6 @@ dependencies = [ "wait-timeout", ] -[[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" @@ -148,7 +136,6 @@ dependencies = [ "git2", "globset", "grep-cli", - "is-terminal", "nix", "nu-ansi-term", "once_cell", @@ -202,12 +189,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bstr" -version = "1.1.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", "regex-automata", "serde", ] @@ -252,22 +238,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" dependencies = [ "anstream", "anstyle 1.0.0", - "bitflags", "clap_lex", "once_cell", "strsim", @@ -456,17 +441,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.0" @@ -618,11 +592,10 @@ dependencies = [ [[package]] name = "grep-cli" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19fc6687bc64b6719a839cd24f2c700bcb05ffeb684d19da6a637c2455a7ba1" +checksum = "8fe4bdbf4300c8b039f5d7eec7fbc6760d2c85bb15ac7499c4d235667f6d747a" dependencies = [ - "atty", "bstr", "globset", "lazy_static", @@ -639,21 +612,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[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.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - [[package]] name = "idna" version = "0.3.0" @@ -693,18 +651,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "is-terminal" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix 0.36.8", - "windows-sys 0.45.0", -] - [[package]] name = "itertools" version = "0.10.5" @@ -780,12 +726,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.3.1" @@ -1063,9 +1003,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" [[package]] name = "regex-syntax" @@ -1088,20 +1028,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "rustix" -version = "0.36.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" -dependencies = [ - "bitflags", - "errno 0.2.8", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.37.3" @@ -1109,10 +1035,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" dependencies = [ "bitflags", - "errno 0.3.0", + "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.1", + "linux-raw-sys", "windows-sys 0.45.0", ] @@ -1316,7 +1242,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.3", + "rustix", "windows-sys 0.45.0", ] @@ -1335,7 +1261,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix 0.37.3", + "rustix", "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 9a6692d5..bf3060a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ version = "0.23.0" exclude = ["assets/syntaxes/*", "assets/themes/*"] build = "build.rs" edition = '2018' -rust-version = "1.64" +rust-version = "1.70" [features] default = ["application"] @@ -25,7 +25,6 @@ application = [ # Mainly for developers that want to iterate quickly # Be aware that the included features might change in the future minimal-application = [ - "is-terminal", "clap", "dirs", "paging", @@ -41,7 +40,6 @@ regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine [dependencies] -is-terminal = { version = "0.4.4", optional = true } nu-ansi-term = "0.47.0" ansi_colours = "^1.2" bincode = "1.0" @@ -62,7 +60,7 @@ path_abs = { version = "0.5", default-features = false } clircle = "0.4" bugreport = { version = "0.5.0", optional = true } dirs = { version = "5.0.0", optional = true } -grep-cli = { version = "0.1.7", optional = true } +grep-cli = { version = "0.1.9", optional = true } regex = { version = "1.8.3", optional = true } walkdir = { version = "2.3", optional = true } bytesize = { version = "1.2.0" } @@ -78,7 +76,7 @@ default-features = false features = ["parsing"] [dependencies.clap] -version = "4.3.0" +version = "4.4.0" optional = true features = ["wrap_help", "cargo"] @@ -98,7 +96,7 @@ tempfile = "3.5.0" nix = { version = "0.26.2", default-features = false, features = ["term"] } [build-dependencies.clap] -version = "4.1.8" +version = "4.4.0" optional = true features = ["wrap_help", "cargo"] diff --git a/README.md b/README.md index 7ec80627..9183f9f4 100644 --- a/README.md +++ b/README.md @@ -418,7 +418,7 @@ binaries are also available: look for archives with `musl` in the file name. ### From source -If you want to build `bat` from source, you need Rust 1.64.0 or +If you want to build `bat` from source, you need Rust 1.70.0 or higher. You can then use `cargo` to build everything: ```bash diff --git a/doc/README-ja.md b/doc/README-ja.md index 35a4e469..74ee7585 100644 --- a/doc/README-ja.md +++ b/doc/README-ja.md @@ -366,7 +366,7 @@ ansible-galaxy install aeimer.install_bat ### From source -`bat` をソースからビルドしたいならば、Rust 1.64.0 以上の環境が必要です。 +`bat` をソースからビルドしたいならば、Rust 1.70.0 以上の環境が必要です。 `cargo` を使用してビルドすることができます: ```bash diff --git a/doc/README-ko.md b/doc/README-ko.md index 50f1ae04..eeb9725c 100644 --- a/doc/README-ko.md +++ b/doc/README-ko.md @@ -416,7 +416,7 @@ scoop install bat ### 소스에서 -`bat`의 소스를 빌드하기 위해서는, Rust 1.64.0 이상이 필요합니다. +`bat`의 소스를 빌드하기 위해서는, Rust 1.70.0 이상이 필요합니다. `cargo`를 이용해 전부 빌드할 수 있습니다: ```bash diff --git a/doc/README-ru.md b/doc/README-ru.md index 4adb73b3..9536887e 100644 --- a/doc/README-ru.md +++ b/doc/README-ru.md @@ -344,7 +344,7 @@ ansible-galaxy install aeimer.install_bat ### Из исходников -Если вы желаете установить `bat` из исходников, вам понадобится Rust 1.64.0 или выше. После этого используйте `cargo`, чтобы все скомпилировать: +Если вы желаете установить `bat` из исходников, вам понадобится Rust 1.70.0 или выше. После этого используйте `cargo`, чтобы все скомпилировать: ```bash cargo install --locked bat diff --git a/doc/README-zh.md b/doc/README-zh.md index e37d115d..06d2570c 100644 --- a/doc/README-zh.md +++ b/doc/README-zh.md @@ -372,7 +372,7 @@ scoop install bat ### 从源码编译 -如果你想要自己构建`bat`,那么你需要安装有高于1.64.0版本的 Rust。 +如果你想要自己构建`bat`,那么你需要安装有高于1.70.0版本的 Rust。 使用以下命令编译。 diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index fc84e2a3..c208b14f 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -1,9 +1,8 @@ use std::collections::HashSet; use std::env; +use std::io::IsTerminal; use std::path::{Path, PathBuf}; -use is_terminal::IsTerminal; - use crate::{ clap_app, config::{get_args_from_config_file, get_args_from_env_opts_var, get_args_from_env_vars},