Skip to content

Commit

Permalink
Downgrade MSRV to 1.48
Browse files Browse the repository at this point in the history
This is the version currently available in Debian oldstable and should be a
reasonable choice.

Also check in the CI that everything still compiles with that version
and fixed Cargo.lock files that use older dependency versions than what
cargo would select by itself.

fixup
  • Loading branch information
sdroege committed Nov 8, 2023
1 parent fa533bd commit 4597e11
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 46 deletions.
90 changes: 48 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,36 +211,39 @@ jobs:
- name: cd lib/macro && cargo +stable semver-checks check-release
run: cargo +stable semver-checks check-release
working-directory: lib/macro
- run: rustup install 1.70
- name: cd lib && cargo +1.70 build
run: cargo +1.70 build
- run: rustup install 1.48
- run: mv lib/Cargo.lock.msrv lib/Cargo.lock
- run: mv lib/macro/internal/Cargo.lock.msrv lib/macro/internal/Cargo.lock
- run: mv lib/macro/Cargo.lock.msrv lib/macro/Cargo.lock
- name: cd lib && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib
- name: cd lib && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features --features=alloc
run: cargo +1.70 build --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --no-default-features --features=alloc
run: cargo +1.48 build --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features --features=alloc
run: cargo +1.70 build --release --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --release --no-default-features --features=alloc
run: cargo +1.48 build --release --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features
run: cargo +1.70 build --no-default-features
- name: cd lib && cargo +1.48 build --no-default-features
run: cargo +1.48 build --no-default-features
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features
run: cargo +1.70 build --release --no-default-features
- name: cd lib && cargo +1.48 build --release --no-default-features
run: cargo +1.48 build --release --no-default-features
working-directory: lib
- name: cd lib/macro/internal && cargo +1.70 build
run: cargo +1.70 build
- name: cd lib/macro/internal && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro/internal
- name: cd lib/macro/internal && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro/internal && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro/internal
- name: cd lib/macro && cargo +1.70 build
run: cargo +1.70 build
- name: cd lib/macro && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro
- name: cd lib/macro && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro
windows:
runs-on: windows-latest
Expand Down Expand Up @@ -320,34 +323,37 @@ jobs:
- name: cd bin && cargo +stable build --release
run: cargo +stable build --release
working-directory: bin
- run: rustup install 1.70
- name: cd lib && cargo +1.70 build
run: cargo +1.70 build
- run: rustup install 1.48
- run: mv lib/Cargo.lock.msrv lib/Cargo.lock
- run: mv lib/macro/internal/Cargo.lock.msrv lib/macro/internal/Cargo.lock
- run: mv lib/macro/Cargo.lock.msrv lib/macro/Cargo.lock
- name: cd lib && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib
- name: cd lib && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features --features=alloc
run: cargo +1.70 build --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --no-default-features --features=alloc
run: cargo +1.48 build --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features --features=alloc
run: cargo +1.70 build --release --no-default-features --features=alloc
- name: cd lib && cargo +1.48 build --release --no-default-features --features=alloc
run: cargo +1.48 build --release --no-default-features --features=alloc
working-directory: lib
- name: cd lib && cargo +1.70 build --no-default-features
run: cargo +1.70 build --no-default-features
- name: cd lib && cargo +1.48 build --no-default-features
run: cargo +1.48 build --no-default-features
working-directory: lib
- name: cd lib && cargo +1.70 build --release --no-default-features
run: cargo +1.70 build --release --no-default-features
- name: cd lib && cargo +1.48 build --release --no-default-features
run: cargo +1.48 build --release --no-default-features
working-directory: lib
- name: cd lib/macro/internal && cargo +1.70 build
run: cargo +1.70 build
- name: cd lib/macro/internal && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro/internal
- name: cd lib/macro/internal && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro/internal && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro/internal
- name: cd lib/macro && cargo +1.70 build
run: cargo +1.70 build
- name: cd lib/macro && cargo +1.48 build
run: cargo +1.48 build
working-directory: lib/macro
- name: cd lib/macro && cargo +1.70 build --release
run: cargo +1.70 build --release
- name: cd lib/macro && cargo +1.48 build --release
run: cargo +1.48 build --release
working-directory: lib/macro
5 changes: 5 additions & 0 deletions lib/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions lib/macro/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions lib/macro/internal/Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#![warn(unreachable_pub)]
#![warn(unsafe_op_in_unsafe_fn)]
#![warn(unused_results)]
#![warn(clippy::pedantic)]
#![allow(clippy::enum_glob_use)]
Expand Down Expand Up @@ -304,7 +303,7 @@ impl core::fmt::Display for DecodeKind {
DecodeKind::Trailing => "non-zero trailing bits",
DecodeKind::Padding => "invalid padding length",
};
write!(f, "{description}")
write!(f, "{}", description)
}
}

Expand Down Expand Up @@ -1565,7 +1564,7 @@ impl core::fmt::Display for SpecificationError {
Duplicate(c) => write!(f, "{:?} has conflicting definitions", c as char),
ExtraPadding => write!(f, "unnecessary padding"),
WrapLength => write!(f, "invalid wrap width or separator length"),
WrapWidth(x) => write!(f, "wrap width not a multiple of {x}"),
WrapWidth(x) => write!(f, "wrap width not a multiple of {}", x),
FromTo => write!(f, "translate from/to length mismatch"),
Undefined(c) => write!(f, "{:?} is undefined", c as char),
}
Expand Down
15 changes: 14 additions & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum Toolchain {
#[strum(serialize = "stable")]
Stable,

#[strum(serialize = "1.70")]
#[strum(serialize = "1.48")]
Msrv,
}

Expand Down Expand Up @@ -371,6 +371,19 @@ impl Flags {
run: Some(format!("rustup install {}", actions[0].toolchain)),
..Default::default()
});

if actions[0].toolchain == Toolchain::Msrv {
for dir in Dir::iter().filter(|x| x.is_published() && x != &Dir::Bin) {
job.steps.push(WorkflowStep {
run: Some(format!(
"mv {}/Cargo.lock.msrv {}/Cargo.lock",
dir, dir
)),
..Default::default()
});
}
}

let components: BTreeSet<_> = actions
.iter()
.filter_map(|x| match x.task {
Expand Down

0 comments on commit 4597e11

Please sign in to comment.