Drop nightly requirement

This commit is contained in:
2023-08-08 22:30:49 +02:00
parent 941dd50868
commit e04f065d42
9 changed files with 14 additions and 48 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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,

View File

@@ -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.

View File

@@ -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
```

View File

@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly"
channel = "stable"
targets = ["x86_64-unknown-linux-musl"]

View File

@@ -1,4 +1,3 @@
#![feature(io_error_more)]
#![forbid(unsafe_code)]
use std::path::Path;

View File

@@ -128,8 +128,6 @@ pub fn find_repo_paths(path: &Path) -> Result<Vec<PathBuf>, 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()),
}