Byron / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.84k stars 301 forks source link

Fix msrv: Run msrv checks with minimal versions #1541

Closed NobodyXu closed 1 month ago

NobodyXu commented 1 month ago

Since it is possible to for dependencies to bump MSRV in patch release, msrv checking should use the minimal versions supported by gix.

Users cares deeply about msrv can also pin them to the minimal versions to maintain their current msrv.

This would have also help discover bug in #1538

Byron commented 1 month ago

Even though it was initially reproducing the gix-object + winnow error, now it seems to fail in another crate entirely.

Is this something you can figure out? I tried, but it doesn't make sense after all.

NobodyXu commented 1 month ago

I think the version of yoke might be too old?

Since the error is from icu_locid_transform I suppose try bumping it, if latest version doesn't work then I think it's report a bug in upstream.

NobodyXu commented 1 month ago
error: failed to run custom build command for `libz-ng-sys v1.1.8`

Caused by:
  process didn't exit successfully: `D:\a\gitoxide\gitoxide\target\debug\build\libz-ng-sys-c79adf8887a64bd5\build-script-build_zng` (exit code: 101)
  --- stderr
  thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.44\src\lib.rs:783:22:
  Visual studio version detected but this crate doesn't know how to generate cmake files for it, can the `cmake` crate be updated?

looks like libz-ng is too old?

Byron commented 1 month ago

Thanks a lot for the encouragement!

I ended up running the cargo +nightly update -Zminimal-versions to reproduce it locally.

However, now it seems to show drift in the flate2 crate, which apparently fails to build on Windows 2022, and I opened a PR against it.

This shows that minimal-versions is also debugging the entire dependency tree, and I don't know if I like that burden responsibility 😅.

NobodyXu commented 1 month ago

This shows that minimal-versions is also debugging the entire dependency tree, and I don't know if I like that burden responsibility 😅.

Yeah it's somewhat transitive, I think we can reduce this burden by running -Zminimal-versions in more places, i.e. in flate2, url, etc

If more crates start using it, then it would be detected early on instead of passing it to downstream.

NobodyXu commented 1 month ago

@Byron I opened rust-lang/flate2-rs#425 to add -Zminimal-versions to flate2

Byron commented 1 month ago

Thanks - once it fails I plan to put my 'fix' from the other PR on top of it, bump the version, merge and create a new release. Then this PR should be unblocked (or is blocked by something else :D).

Byron commented 1 month ago

Needs https://github.com/rust-lang/flate2-rs/pull/425 to continue, which needs minimal-version checks for libz-sys along with a fix to raise the minimally required vcpkg.