ok/jj
1
0
Fork 0
forked from mirrors/jj

chore(rust): bump MSRV to 1.71.0

Summary: Let's be more aggressive about tracking the latest stable Rust release.
There's little benefit to being conservative so early on, especially when no
users seem to have faced any issue with upgrading, or strictly required an old
Rust version.

Right now, just lagging Rust by 1 major release probably seems fine. We're
targeting 1.71.0 to get ahead of the curve, since 1.72.0 will likely release
sometime before the next `jj` release.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: I4e691b6ba63b5b9023a75ae0a6917672
This commit is contained in:
Austin Seipp 2023-07-11 08:08:13 -05:00
parent 0402d87d19
commit 8cb429d065
6 changed files with 26 additions and 15 deletions

View file

@ -22,7 +22,7 @@ jobs:
cargo_flags: [""] cargo_flags: [""]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
rust_version: "1.64" rust_version: "1.71"
cargo_flags: "" cargo_flags: ""
- os: ubuntu-latest - os: ubuntu-latest
rust_version: stable rust_version: stable
@ -65,7 +65,7 @@ jobs:
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt components: rustfmt
- run: cargo fmt --all -- --check - run: cargo +nightly fmt --all -- --check
cargo-deny: cargo-deny:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -95,4 +95,4 @@ jobs:
with: with:
toolchain: stable toolchain: stable
components: clippy components: clippy
- run: cargo clippy --all-features --workspace --all-targets -- -D warnings - run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings

View file

@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Breaking changes ### Breaking changes
* The minimum supported Rust version (MSRV) is now 1.71.0.
### New features ### New features
### Fixed bugs ### Fixed bugs

View file

@ -3,7 +3,7 @@ name = "jj-cli"
version = "0.8.0" version = "0.8.0"
authors = ["Martin von Zweigbergk <martinvonz@google.com>"] authors = ["Martin von Zweigbergk <martinvonz@google.com>"]
edition = "2021" edition = "2021"
rust-version = "1.64" # Remember to update CI, contributing.md, and flake.nix rust-version = "1.71" # Remember to update CI, and contributing.md
license = "Apache-2.0" license = "Apache-2.0"
description = "Jujutsu (an experimental VCS)" description = "Jujutsu (an experimental VCS)"
homepage = "https://github.com/martinvonz/jj" homepage = "https://github.com/martinvonz/jj"

View file

@ -77,10 +77,12 @@ recommended steps.
### Summary ### Summary
If you already have `rustup` installed, then moving into the source code
directory will install the MSRV for you.
One-time setup: One-time setup:
rustup toolchain add nightly # If this is not your default rustup toolchain add nightly # wanted for 'rustfmt'
rustup toolchain add 1.64 # See note about MSRV & `rust-version` below
cargo install cargo-insta cargo install cargo-insta
cargo install cargo-watch cargo install cargo-watch
cargo install cargo-nextest cargo install cargo-nextest
@ -89,7 +91,7 @@ During development (adapt according to your preference):
cargo watch --ignore '.jj/**' -s \ cargo watch --ignore '.jj/**' -s \
'cargo clippy --workspace --all-targets \ 'cargo clippy --workspace --all-targets \
&& cargo +1.64 check --workspace --all-targets' && cargo check --workspace --all-targets'
cargo +nightly fmt # Occasionally cargo +nightly fmt # Occasionally
cargo nextest run --workspace # Occasionally cargo nextest run --workspace # Occasionally
cargo insta test --workspace # Occasionally cargo insta test --workspace # Occasionally
@ -116,9 +118,8 @@ These are listed roughly in order of decreasing importance.
toolchain and use `cargo +nightly fmt`. toolchain and use `cargo +nightly fmt`.
3. Your code will be rejected if it cannot be compiled with the minimal 3. Your code will be rejected if it cannot be compiled with the minimal
supported version of Rust ("MSRV"). This version is listed as supported version of Rust ("MSRV"). Currently, `jj` follows a rather
`rust-version` in [`Cargo.toml`](../Cargo.toml); it is 1.64 as of this casual MSRV policy: "The current `rustc` stable version, minus one."
writing.
4. Your code needs to pass `cargo clippy`. You can also 4. Your code needs to pass `cargo clippy`. You can also
use `cargo +nightly clippy` if you wish to see more warnings. use `cargo +nightly clippy` if you wish to see more warnings.

View file

@ -35,6 +35,13 @@
pkgs.lib.all (re: builtins.match re relPath == null) regexes; pkgs.lib.all (re: builtins.match re relPath == null) regexes;
}; };
rust-version = pkgs.rust-bin.stable."1.71.0".default;
ourRustPlatform = pkgs.makeRustPlatform {
rustc = rust-version;
cargo = rust-version;
};
# NOTE (aseipp): on Linux, go ahead and use mold by default to improve # NOTE (aseipp): on Linux, go ahead and use mold by default to improve
# link times a bit; mostly useful for debug build speed, but will help # link times a bit; mostly useful for debug build speed, but will help
# over time if we ever get more dependencies, too # over time if we ever get more dependencies, too
@ -42,7 +49,7 @@
in in
{ {
packages = { packages = {
jujutsu = pkgs.rustPlatform.buildRustPackage rec { jujutsu = ourRustPlatform.buildRustPackage rec {
pname = "jujutsu"; pname = "jujutsu";
version = "unstable-${self.shortRev or "dirty"}"; version = "unstable-${self.shortRev or "dirty"}";
buildNoDefaultFeatures = true; buildNoDefaultFeatures = true;
@ -64,8 +71,9 @@
makeWrapper makeWrapper
pkg-config pkg-config
]; ];
buildInputs = with pkgs; [ openssl zstd libgit2 libssh2 ] buildInputs = with pkgs; [
++ lib.optionals stdenv.isDarwin [ openssl zstd libgit2 libssh2
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration darwin.apple_sdk.frameworks.SystemConfiguration
libiconv libiconv
@ -102,7 +110,7 @@
buildInputs = with pkgs; [ buildInputs = with pkgs; [
# Using the minimal profile with explicit "clippy" extension to avoid # Using the minimal profile with explicit "clippy" extension to avoid
# two versions of rustfmt # two versions of rustfmt
(rust-bin.stable."1.64.0".minimal.override { (rust-version.override {
extensions = [ extensions = [
"rust-src" # for rust-analyzer "rust-src" # for rust-analyzer
"clippy" "clippy"

View file

@ -3,7 +3,7 @@ name = "jj-lib"
version = "0.8.0" version = "0.8.0"
authors = ["Martin von Zweigbergk <martinvonz@google.com>"] authors = ["Martin von Zweigbergk <martinvonz@google.com>"]
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.71"
license = "Apache-2.0" license = "Apache-2.0"
description = "Library for Jujutsu (an experimental VCS)" description = "Library for Jujutsu (an experimental VCS)"
homepage = "https://github.com/martinvonz/jj" homepage = "https://github.com/martinvonz/jj"