Skip to content

Update to Rust edition 2024 / Bump MSRV to 1.88.0 - #69

Merged
juhoinkinen merged 11 commits into
NatLibFi:mainfrom
nwagner84:msrv-1.99.0
Oct 12, 2026
Merged

juhoinkinen merged 11 commits into
NatLibFi:mainfrom
nwagner84:msrv-1.99.0

Conversation

@nwagner84

@nwagner84 nwagner84 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR update to the latest Rust edition 2024. As a result the minimum supported Rust version (MSRV) has to be updated to 1.88.0.

Changes

Rust Edition

The Rust edition has been updated to version 2024 to enable the use of new language features in future developments. The resulting minor compiler errors have been fixed. The version of the c-api crate has been left at 2021, as updating it would require additional effort and the integration is anyway to be switched to pyo3.

Minimum Supported Rust Version (MSRV)

In addition, the MSRV was set to version 1.88.0. The MSRV was determined using the cargo-msrv tool:

$ cargo msrv find
  [Meta]   cargo-msrv 0.19.3

Compatibility Check #1: Rust 1.92.0
  [OK]     Is compatible

Compatibility Check #2: Rust 1.88.0
  [OK]     Is compatible

Compatibility Check #3: Rust 1.86.0
  [OK]     Is compatible

Compatibility Check #4: Rust 1.85.1
  [OK]     Is compatible

Result:
   Considered (min … max):   Rust 1.85.1 … Rust 1.99.0
   Search method:            bisect
   MSRV:                     1.85.1
   Target:                   x86_64-unknown-linux-gnu

However, the MSRV was set to 1.88.0 because the time dependency requires at least this version:

error: rustc 1.85.1 is not supported by the following packages:
  time@0.3.55 requires rustc 1.88.0
  time-core@0.1.9 requires rustc 1.88.0
  time-core@0.1.9 requires rustc 1.88.0
  time-macros@0.2.32 requires rustc 1.88.0

CI/CD-Pipeline

I've expanded the pipeline to include an additional build step, rust-test, which tests both the stable version (gnu/musl) and the explicit MSRV version 1.88.0 in a matrix. This makes it possible to determine at any time whether features are being used in development that aren't supported by the MSRV and require a version adjustment.

Furthermore, I've switched to the GitHub Action dtolnay/rust-toolchain, which is widely used in the Rust community to incorporate different Rust versions into CI/CD pipelines.

Documentation tests are also being run, even though there aren't any. I think it makes sense to run them at the same time to ensure that future tests in the documentation are taken into account.

Note, that the new pipeline step rust-test contains redundancies with rust-build, which I would remove in a follow-up PR.

Signed-off-by: Nico Wagner <n.wagner@dnb.de>
@nwagner84

Copy link
Copy Markdown
Contributor Author

It appears that GitHub Actions dtolnay/rust-toolchain and taiki-e/install-action cannot be used due to a policy.

The actions dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
and taiki-e/install-action@d438492cf8a250514fa2d34b30bc3c0dc37c65ff are not
allowed in NatLibFi/omikuji because all actions must be from a repository
owned by NatLibFi, created by GitHub, or verified in the GitHub Marketplace.

I could remove the nextest test runner and replace it with the default test runner. Would it be possible to set up an exception for dtolnay/rust-toolchain? I've had good experiences with this action for many years.

What do you think about that, @juhoinkinen?

@juhoinkinen

Copy link
Copy Markdown
Member

This PR sets the minimum supported Rust version (MSRV) to the latest stable release v1.99. I think now is a good time to set the minimum version.

This has no negative impact on the CI/CD pipeline, since we were already working with the latest stable version anyway.

I think some users are still to installing Omikuji as a sdist, and the Rust version requirement could affect them. But I don't know if that's a real problem. Can anyone update to Rust 1.99 on their machine easily without breaking some other projects they might be building? Actually, it seems to be possible to have multiple versions of rustc and cargo etc. using the toolchain thing (not a surprise, I think), so updating to and using Rust 1.99 should not be a big problem.

However, does requiring version 1.99+ of Rust give benefits? Could the required version be some older one; the 1.99 is very recent (I have 1.97 on my laptop, and that too was released just this July)? What could be oldest sensible version that would work as MSRV?

The matrix checking the Rust versions is good!

Finally, I've used nextest as the test runner, which allows for much faster test execution.

I could remove the nextest test runner and replace it with the default test runner.

Yes, please avoid nextest; while it could be faster, the default rust-build job is not too slow currently.

Would it be possible to set up an exception for dtolnay/rust-toolchain? I've had good experiences with this action for many years.

The action dtolnay/rust-toolchain is now explicitly allowed.

Note, that the new pipeline step rust-test contains redundancies with rust-build, which I would remove in a follow-up PR.

The old rust-build job could be removed in this PR directly.

@juhoinkinen

Copy link
Copy Markdown
Member

BTW, how you feel about AI reviews @nwagner84? I've been using the Copilot review lately, because it really can spot things I miss (especially with Rust...).

Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
@nwagner84 nwagner84 changed the title Bump MSRV to 1.99 Bump MSRV to 1.80.1 Oct 9, 2026
@nwagner84

Copy link
Copy Markdown
Contributor Author

Hi @juhoinkinen,

good point; maybe setting the MSRV to 1.99 is a bit to strict, if there are user who install via sdist. I've find the MSRV via cargo-msrv and updated the code and PR description. Also I removed the nextest step.

I have no issue with a co-pilot review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

CI does not validate the C API at the declared MSRV and has unresolved musl and release-gating issues.

2 open findings
What changed in this PR

Raises the Rust MSRV to 1.80.1 and adds stable/MSRV CI coverage across GNU and musl targets.

Changes:

  • Declares the MSRV for both crates.
  • Adds Rust toolchain and target test coverage.
  • Adds documentation and example checks.
File Description
Cargo.toml Declares the root crate’s MSRV.
c-api/​Cargo.toml Declares the C API crate’s MSRV.
.github/​workflows/​cicd.yaml Adds Rust toolchain and target testing.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/cicd.yaml Resolved
Comment thread .github/workflows/cicd.yaml Resolved
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
@nwagner84 nwagner84 changed the title Bump MSRV to 1.80.1 Update to Rust edition 2024 / Bump MSRV to 1.88.0 Oct 12, 2026
Signed-off-by: Nico Wagner <n.wagner@dnb.de>
@nwagner84

Copy link
Copy Markdown
Contributor Author

Hi @juhoinkinen,

I've revised the PR a bit more and incorporated the review comments. I've also updated the PR description. As far as I'm concerned, the PR is now ready, and you can merge the change.

As noted, I’ve kept the old rust-build job for now, since I plan to add a rust-lint job soon that will handle the remaining steps.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The edition migration, compatibility updates, MSRV declarations, and CI coverage are consistent and complete.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@juhoinkinen

Copy link
Copy Markdown
Member

since I plan to add a rust-lint job soon that will handle the remaining steps.

At first I was inclined to having the linting (rustfmt) in the same job as the as the rust tests, because Python code format is linted in the same job as sdist is built. But actually, linting of Python code is also better done in a dedicated job, separate to the one "building" sdist, right?

@juhoinkinen juhoinkinen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think this can be merged.

As far as I can see, the changes on the Rust code are non-operational modernizations.

@juhoinkinen
juhoinkinen merged commit 5d5d54e into NatLibFi:main Oct 12, 2026
21 checks passed
@juhoinkinen juhoinkinen mentioned this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants