Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with MSRV #1808

Open
bryceberger opened this issue Jan 25, 2025 · 6 comments
Open

Does not compile with MSRV #1808

bryceberger opened this issue Jan 25, 2025 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@bryceberger
Copy link
Contributor

Currently, the MSRV is:

  • 1.70 according to gix/Cargo.toml
  • 1.74 (nightly!) according to .github/workflows/msrv.yml
  • 1.76 according to a comment in gix-commitgraph/CHANGELOG.md stating:

    Our MSRV follows the one of helix, which in turn follows Firefox

  • 1.84 for all crates that are not dependents of gix (list?), according to STABILITY.md

However, gix can only build on 1.77+, due to c-string literals, used in rusqlite/rusqlite#1483. The CI passes because it only runs cargo check, which does work on 1.74.

Additionally, tests only build on 1.79+, due to rust-lang/rust#121346.

gix-macros/tests/momo/ux/error_if_ineffective.rs fails on nightly versions. This appears to be due to differences in macro source location tracking on nightly versions.

@Byron
Copy link
Member

Byron commented Jan 26, 2025

Thanks for bringing this to my attention!

Maybe we can start to untangle this by making the MSRV CI step perform a build instead, and use stable?

Then it seems that STABILITY.md could be changed to be less ambiguous and clarify possible differences between build and test.

Regarding gix/Cargo.toml - that can probably just be put to 1.74 like the rest of the crates.

@EliahKagan
Copy link
Member

EliahKagan commented Feb 22, 2025

Regarding gix/Cargo.toml - that can probably just be put to 1.74 like the rest of the crates.

Is this to say that all crates whose Cargo.toml files list lower Rust versions than 1.74 can and should already have them updated to 1.74? Currently, not all crates have a rust-version key in their Cargo.toml file, but of the 76 crates that do, its value is "1.70" for 75 of them.

Specifically, at the current tip of main (8776a3e), I ran:

diff -U1000 <(git grep -Fn 'rust-version = "1.70"' -- '**/Cargo.toml') <(git grep -Fn 'rust-version = "' -- '**/Cargo.toml')

The output was:

--- /dev/fd/63  2025-02-22 16:35:26.292251700 -0500
+++ /dev/fd/62  2025-02-22 16:35:26.292251700 -0500
@@ -1,75 +1,76 @@
 gix-actor/Cargo.toml:12:rust-version = "1.70"
 gix-archive/Cargo.toml:11:rust-version = "1.70"
 gix-attributes/Cargo.toml:12:rust-version = "1.70"
 gix-bitmap/Cargo.toml:11:rust-version = "1.70"
 gix-blame/Cargo.toml:11:rust-version = "1.70"
 gix-chunk/Cargo.toml:13:rust-version = "1.70"
 gix-command/Cargo.toml:11:rust-version = "1.70"
 gix-commitgraph/Cargo.toml:13:rust-version = "1.70"
 gix-config-value/Cargo.toml:11:rust-version = "1.70"
 gix-config/Cargo.toml:14:rust-version = "1.70"
 gix-config/tests/Cargo.toml:11:rust-version = "1.70"
 gix-credentials/Cargo.toml:11:rust-version = "1.70"
 gix-date/Cargo.toml:12:rust-version = "1.70"
 gix-diff/Cargo.toml:12:rust-version = "1.70"
 gix-diff/tests/Cargo.toml:12:rust-version = "1.70"
 gix-dir/Cargo.toml:11:rust-version = "1.70"
 gix-discover/Cargo.toml:12:rust-version = "1.70"
 gix-features/Cargo.toml:11:rust-version = "1.70"
 gix-fetchhead/Cargo.toml:11:rust-version = "1.70"
 gix-filter/Cargo.toml:11:rust-version = "1.70"
 gix-fs/Cargo.toml:11:rust-version = "1.70"
 gix-fsck/Cargo.toml:12:rust-version = "1.70"
 gix-glob/Cargo.toml:11:rust-version = "1.70"
 gix-hash/Cargo.toml:12:rust-version = "1.70"
 gix-hashtable/Cargo.toml:12:rust-version = "1.70"
 gix-ignore/Cargo.toml:12:rust-version = "1.70"
 gix-index/Cargo.toml:12:rust-version = "1.70"
 gix-index/tests/Cargo.toml:12:rust-version = "1.70"
 gix-lfs/Cargo.toml:11:rust-version = "1.70"
 gix-lock/Cargo.toml:12:rust-version = "1.70"
 gix-macros/Cargo.toml:16:rust-version = "1.70"
 gix-mailmap/Cargo.toml:11:rust-version = "1.70"
 gix-merge/Cargo.toml:9:rust-version = "1.70"
 gix-negotiate/Cargo.toml:11:rust-version = "1.70"
 gix-note/Cargo.toml:11:rust-version = "1.70"
 gix-object/Cargo.toml:12:rust-version = "1.70"
 gix-odb/Cargo.toml:12:rust-version = "1.70"
 gix-odb/tests/Cargo.toml:11:rust-version = "1.70"
 gix-pack/Cargo.toml:12:rust-version = "1.70"
 gix-pack/tests/Cargo.toml:11:rust-version = "1.70"
 gix-packetline-blocking/Cargo.toml:12:rust-version = "1.70"
 gix-packetline/Cargo.toml:12:rust-version = "1.70"
 gix-path/Cargo.toml:12:rust-version = "1.70"
 gix-pathspec/Cargo.toml:11:rust-version = "1.70"
 gix-prompt/Cargo.toml:12:rust-version = "1.70"
 gix-protocol/Cargo.toml:12:rust-version = "1.70"
 gix-quote/Cargo.toml:11:rust-version = "1.70"
 gix-rebase/Cargo.toml:11:rust-version = "1.70"
 gix-ref/Cargo.toml:12:rust-version = "1.70"
 gix-ref/tests/Cargo.toml:12:rust-version = "1.70"
 gix-refspec/Cargo.toml:12:rust-version = "1.70"
 gix-revision/Cargo.toml:12:rust-version = "1.70"
 gix-revwalk/Cargo.toml:12:rust-version = "1.70"
 gix-sec/Cargo.toml:12:rust-version = "1.70"
 gix-sequencer/Cargo.toml:11:rust-version = "1.70"
 gix-shallow/Cargo.toml:12:rust-version = "1.70"
 gix-status/Cargo.toml:12:rust-version = "1.70"
 gix-status/tests/Cargo.toml:12:rust-version = "1.70"
 gix-submodule/Cargo.toml:11:rust-version = "1.70"
 gix-tempfile/Cargo.toml:12:rust-version = "1.70"
 gix-tix/Cargo.toml:11:rust-version = "1.70"
 gix-trace/Cargo.toml:11:rust-version = "1.70"
 gix-transport/Cargo.toml:12:rust-version = "1.70"
 gix-traverse/Cargo.toml:12:rust-version = "1.70"
 gix-traverse/tests/Cargo.toml:11:rust-version = "1.70"
 gix-tui/Cargo.toml:11:rust-version = "1.70"
 gix-url/Cargo.toml:12:rust-version = "1.70"
 gix-utils/Cargo.toml:11:rust-version = "1.70"
 gix-validate/Cargo.toml:12:rust-version = "1.70"
 gix-worktree-state/Cargo.toml:12:rust-version = "1.70"
 gix-worktree-state/tests/Cargo.toml:12:rust-version = "1.70"
 gix-worktree-stream/Cargo.toml:11:rust-version = "1.70"
 gix-worktree/Cargo.toml:12:rust-version = "1.70"
 gix-worktree/tests/Cargo.toml:11:rust-version = "1.70"
 gix/Cargo.toml:12:rust-version = "1.70"
+tests/tools/Cargo.toml:11:rust-version = "1.76"

I would find it convenient to be able to use Rust 1.76 in more places, such as in tests on a feature branch that are more complex without OsString::into_encoded_bytes. However, that is only my motivation for inquiring about what the MSRV should be; I do not advocate using a higher MSRV to support those tests, which may or may not look this in their final form anyway.

@Byron
Copy link
Member

Byron commented Feb 23, 2025

That's a good point! I think usually when considering MSRV updates, I change all to the highest-possible MSRV and run clippy. If it doesn't find anything, I keep the previous MSRV so the version upgrade isn't happening without need. In theory, if there was a tool to test the MSRV (and I think there is), one could run it on all crates to find the lowest possible MSRV for each of the crates. That way, each of them, if used individually, might even support a lower MSRV than we test for, making them more compatible.

And since helix still uses 1.74, that's to current maximum I am afraid.

And just to state that explicitly, if it was just me, I'd use the latest stable, always, MSRV is something I don't want to think about, yet there is no way around it if one wants these crates to be as useful as possible.

@EliahKagan
Copy link
Member

Sorry--I accidentally wrote 1.76 here as the version I hoped to use, but what I meant to write here was 1.74:

I would find it convenient to be able to use Rust 1.76 in more places

1.74 is the version I hoped to use, since OsString::into_encoded_bytes is available from 1.74 and on.

@Byron
Copy link
Member

Byron commented Feb 23, 2025

Great! Then there should be nothing in the way of using it, upping the rust-version in the crate as needed.

@EliahKagan
Copy link
Member

EliahKagan commented Feb 23, 2025

Sounds good. If it ends up being useful to keep tests that (roughly speaking) look inside an OsString, then I'll undo that change to use into_encoded_bytes again and increase the rust-version on gix-command. Assuming that happens, I think it will also be necessary for me to increase the rust-version on all the crates that depend on gix-command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants