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

Update MSRVs to be accurate #6742

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

itsjunetime
Copy link
Contributor

Which issue does this PR close?

Closes #6741

What changes are included in this PR?

This changes MSRVs of a lot of crates in this repo to accurately reflect their actual MSRV, as they've fallen out of date.

There's an MSRV check in CI, but it currently only checks a few specific crates instead of all of them. It also doesn't have any way to tell if the workspace's rust-version field has fallen out of date due to all other crates in the workspace using a specifically different MSRV. This fixes both of those issues by checking every Cargo.toml that exists in this repo and also making sure at least one of them uses rust-version = { workspace = true }.

The MSRVs that these were changed to were all found by running cargo msrv find --manifest-path $cargo_toml_path for each Cargo.toml in the repo. If it failed due to a dependency that we could downgrade, I downgraded it as low as our Cargo.toml allowed it to go to see if that would allow us to get the MSRV lower.

Rationale for this change

The repo is easier to use and manage if this task is automated

Also, at time of writing, the arrow-flight/gen crate has a broken MSRV. This is to ensure the CI checks that I added actually work. I'll change it back once CI has verified it's bad.

Are there any user-facing changes?

No; these crates already wouldn't compile with their current (incorrect) MSRVs so we aren't affecting users at all with these changes.

@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate object-store Object Store Interface labels Nov 17, 2024
@@ -122,24 +122,20 @@ jobs:
uses: ./.github/actions/setup-builder
- name: Install cargo-msrv
run: cargo install cargo-msrv
- name: Downgrade arrow dependencies
run: cargo update -p ahash --precise 0.8.7
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahash's MSRV now is 1.60, so we don't need this downgrade anymore.

@itsjunetime
Copy link
Contributor Author

The MSRV check failed, and although the output was too long to see what exactly the error was, I'm going to update the purposefully-broken package's MSRV to see if things pass now.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you so much @itsjunetime for cleaning this up 🙏

The basic pattern looks very promising to me

The CI is currently failing https://github.com/apache/arrow-rs/actions/runs/11876059759/job/33093978528?pr=6742

I ran the check locally

cargo msrv verify --manifest-path object_store/Cargo.toml

And the actual appears to be this

  │ error: package `tokio v1.39.1` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.64.0 │

- name: Check object_store
working-directory: object_store
run: cargo msrv --log-target stdout verify
- name: Check all packages
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awesome ❤️

echo "Checking package '$dir'"
cargo msrv verify --manifest-path "$dir" || exit 1
done
# If no packages are using the workspace's rust-version, then it's out of date
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that cargo msrv can't currently check a crate that uses the workspace MSRV, maybe we should just remove the workspace MSRV in favor of explicit versions in all the crates 🤔

@alamb alamb added development-process Related to development process of arrow-rs and removed development-process Related to development process of arrow-rs labels Nov 17, 2024
@alamb
Copy link
Contributor

alamb commented Nov 22, 2024

I took the liberty of pushing some commits to this branch to get this PR unstuck and hopefully ready to merge

  • Updated object_store stated msrv
  • removed workspace check
  • merged from apache/main

@alamb alamb added the development-process Related to development process of arrow-rs label Nov 22, 2024
alamb
alamb previously approved these changes Nov 22, 2024
@@ -24,7 +24,7 @@ readme = "README.md"
description = "A generic object store interface for uniformly interacting with AWS S3, Google Cloud Storage, Azure Blob Storage and local files."
keywords = ["object", "storage", "cloud"]
repository = "https://github.com/apache/arrow-rs/tree/master/object_store"
rust-version = "1.64.0"
rust-version = "1.70.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised by this given we had CI checking this previously?

Copy link
Contributor

Choose a reason for hiding this comment

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

I double checked, and indeed you are right that cargo msrv still passes with 1.64 (but it requires downgrading tokio)

Not sure what is going on. Pushed a change to revert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alamb it seems you changed this to 1.70 in bfe798d from what I had set it to (1.62.1, what cargo msrv find reports after downgrading tokio). I'm not quite sure why you did that - unless there's a reason this must be 1.64, I think it would be best to drop it down to 1.62.1.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree -- I think it was my mistake to push it to 1.64. Let's put it back to 1.62.1

@github-actions github-actions bot removed the object-store Object Store Interface label Nov 23, 2024
@tustvold
Copy link
Contributor

I struggle to approve this as a number of these crates were being tested with MSRV and were passing (e.g. arrow-flight)... Am I missing something?

@alamb alamb dismissed their stale review November 30, 2024 12:38

still not sure about this

@github-actions github-actions bot added the object-store Object Store Interface label Dec 2, 2024
@itsjunetime
Copy link
Contributor Author

I struggle to approve this as a number of these crates were being tested with MSRV and were passing (e.g. arrow-flight)... Am I missing something?

Yes - everything was passing before, but it simply wasn't testing every crate in this repo and we also had multiple MSRVs set too high (which msrv testing wouldn't catch, since we don't try to verify that the MSRV is set as low as it can go)

For example, arrow-flight was passing before, and we didn't change anything about it - however, the arrow-flight/gen crate had the MSRV set too low. It was set to 1.70.0, when the lowest version it actually supported was 1.71.1. We didn't catch this because the arrow-flight crate was already set to 1.71.1, and that was the only thing we were testing.

In the same vein, the arrow-integration-testing and arrow-pyarrow-integration-testing weren't being checked by CI at all either, so their MSRVs had fallen out of sync. This probably won't impact dependents at all, as I doubt anyone is using these crates besides this repo alone, but it's just nice to have them more up-to-date with this change now.

Besides these sorts of things, the other main change is updating the workspace's MSRV to 1.70 (from 1.62) since it had just fallen out-of-date with what the minimum MSRV is within the workspace. Since the workspace MSRV is now 1.70, all the crates that previously had their MSRV explicitly set to "1.70.0" can now just use { workspace = true }.

This PR fixes the above issues by:

  1. Using a find loop to test every Cargo.toml in the repo for CI, instead of just a few hand-picked specific ones
  2. Making sure at least one crate in the repo uses rust-version = { workspace = true } so that the workspace's MSRV doesn't get out-of-date anymore.

@crepererum
Copy link
Contributor

I wonder if we should even have per-crate MSRVs or rather opt for a workspace-wide one. To me, the different ranges are close to impossible to keep track off.

@tustvold
Copy link
Contributor

I wonder if we should even have per-crate MSRVs or rather opt for a workspace-wide one. To me, the different ranges are close to impossible to keep track off.

I think it would make sense for a single MSRV for arrow and a single MSRV for object_store (likely the same)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate development-process Related to development process of arrow-rs object-store Object Store Interface parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some MSRVs are inaccurate
4 participants