From e04f065d42a246e85fedd8f5a6e1efd95bb5e805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 8 Aug 2023 22:30:49 +0200 Subject: [PATCH] Drop nightly requirement --- Cargo.toml | 2 +- Justfile | 2 +- depcheck/update-cargo-dependencies.py | 20 ++------------------ docs/src/developing.md | 17 +---------------- docs/src/installation.md | 14 +++++++------- e2e_tests/test_repos_sync.py | 2 +- rust-toolchain.toml | 2 +- src/lib.rs | 1 - src/tree.rs | 2 -- 9 files changed, 14 insertions(+), 48 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3d4b813..33b8454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ repository = "https://github.com/hakoerber/git-repo-manager" readme = "README.md" # Required for `std::path::Path::is_symlink()`. Will be released with 1.57. -rust-version = "1.57" +rust-version = "1.58" license = "GPL-3.0-only" diff --git a/Justfile b/Justfile index 4e906f4..5eb9107 100644 --- a/Justfile +++ b/Justfile @@ -4,7 +4,7 @@ set shell := ["/bin/bash", "-c"] static_target := "x86_64-unknown-linux-musl" -cargo := "cargo +nightly" +cargo := "cargo" check: fmt-check lint test {{cargo}} check diff --git a/depcheck/update-cargo-dependencies.py b/depcheck/update-cargo-dependencies.py index 7b5145f..abd813b 100755 --- a/depcheck/update-cargo-dependencies.py +++ b/depcheck/update-cargo-dependencies.py @@ -93,15 +93,7 @@ for tier in ["dependencies", "dev-dependencies"]: try: cmd = subprocess.run( - [ - "cargo", - "update", - "-Z", - "no-index-update", - "--aggressive", - "--package", - name, - ], + ["cargo", "update", "--offline", "--aggressive", "--package", name], check=True, capture_output=True, text=True, @@ -135,15 +127,7 @@ while True: spec = f"{package['name']}:{package['version']}" try: cmd = subprocess.run( - [ - "cargo", - "update", - "-Z", - "no-index-update", - "--aggressive", - "--package", - spec, - ], + ["cargo", "update", "--offline", "--aggressive", "--package", spec], check=True, capture_output=True, text=True, diff --git a/docs/src/developing.md b/docs/src/developing.md index df32a6f..094330b 100644 --- a/docs/src/developing.md +++ b/docs/src/developing.md @@ -28,7 +28,7 @@ Feature branches are not required, there are also changes happening directly on You will need the following tools: -* Rust (obviously) (easiest via `rustup`), with the nightly toolchain +* Rust (obviously) (easiest via `rustup`) * Python3 * [`just`](https://github.com/casey/just), a command runner like `make`. See [here](https://github.com/casey/just#installation) for installation @@ -52,18 +52,3 @@ mvdan.cc/sh/v3/cmd/shfmt@latest`, depending on your go build environment. For details about rustup and the toolchains, see [the installation section](./installation.md). - -## FAQ - -### Why nightly? - -For now, GRM requires the nightly toolchain for two reasons: - -* [`io_error_more`](https://github.com/rust-lang/rust/issues/86442) to get - better error messages on IO errors -* [`const_option_ext`](https://github.com/rust-lang/rust/issues/91930) to have - static variables read from the environment that fall back to hard coded - defaults - -Honestly, both of those are not really necessary or can be handled without -nightly. It's just that I'm using nightly anyway. diff --git a/docs/src/installation.md b/docs/src/installation.md index 84290ff..73d0db8 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -2,14 +2,14 @@ ## Installation -Building GRM currently requires the nightly Rust toolchain. The easiest way is +Building GRM requires the Rust toolchain to be installed. The easiest way is using [`rustup`](https://rustup.rs/). Make sure that rustup is properly installed. -Make sure that the nightly toolchain is installed: +Make sure that the stable toolchain is installed: ``` -$ rustup toolchain install nightly +$ rustup toolchain install stable ``` Then, install the build dependencies: @@ -22,13 +22,13 @@ Then, install the build dependencies: Then, it's a simple command to install the latest stable version: ```bash -$ cargo +nightly install git-repo-manager +$ cargo install git-repo-manager ``` If you're brave, you can also run the development build: ```bash -$ cargo +nightly install --git https://github.com/hakoerber/git-repo-manager.git --branch develop +$ cargo install --git https://github.com/hakoerber/git-repo-manager.git --branch develop ``` ## Static build @@ -47,11 +47,11 @@ need `musl` and a few other build dependencies installed installed: The, add the musl target via `rustup`: ``` -$ rustup +nightly target add x86_64-unknown-linux-musl +$ rustup target add x86_64-unknown-linux-musl ``` Then, use a modified build command to get a statically linked binary: ``` -$ cargo +nightly install git-repo-manager --target x86_64-unknown-linux-musl --features=static-build +$ cargo install git-repo-manager --target x86_64-unknown-linux-musl --features=static-build ``` diff --git a/e2e_tests/test_repos_sync.py b/e2e_tests/test_repos_sync.py index 8833aee..7a4f5a0 100644 --- a/e2e_tests/test_repos_sync.py +++ b/e2e_tests/test_repos_sync.py @@ -312,7 +312,7 @@ def test_repos_sync_root_is_file(configtype): cmd = grm(["repos", "sync", "config", "--config", config.name]) assert cmd.returncode != 0 - assert "not a directory" in cmd.stderr.lower() + assert "notadirectory" in cmd.stderr.lower() @pytest.mark.parametrize("configtype", ["toml", "yaml"]) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 124501d..55317ef 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly" +channel = "stable" targets = ["x86_64-unknown-linux-musl"] diff --git a/src/lib.rs b/src/lib.rs index 14e4346..5029cbf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(io_error_more)] #![forbid(unsafe_code)] use std::path::Path; diff --git a/src/tree.rs b/src/tree.rs index c53882f..7ae9503 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -128,8 +128,6 @@ pub fn find_repo_paths(path: &Path) -> Result, String> { "Failed to open \"{}\": {}", &path.display(), match e.kind() { - std::io::ErrorKind::NotADirectory => - String::from("directory expected, but path is not a directory"), std::io::ErrorKind::NotFound => String::from("not found"), _ => format!("{:?}", e.kind()), }