Skip to content

Check in Cargo.lock - #2482

Merged
LucaCappelletti94 merged 9 commits into
apache:mainfrom
alamb:checkin-cargo-lock
Sep 25, 2026
Merged

LucaCappelletti94 merged 9 commits into
apache:mainfrom
alamb:checkin-cargo-lock

Conversation

@alamb

@alamb alamb commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A

Rationale for this change

Checking in Cargo.lock gives CI reproducible builds and makes dependency updates visible in review, per the current Cargo guidance which now recommends committing the lockfile for libraries as well.

What changes are included in this PR?

  • Remove Cargo.lock from .gitignore
  • Check in Cargo.lock generated with cargo update (all 46 packages locked to the latest semver-compatible versions; no Cargo.toml changes needed)

Are these changes tested?

cargo test --all-features passes (22/22 suites, 0 failures).

Are there any user-facing changes?

No. This only affects local development and CI of this repository; downstream users of the published crate are unaffected.

@alamb alamb changed the title Check in Cargo.lock, update dependencies to latest compatible versions Check in Cargo.lock Sep 7, 2026
@alamb
alamb marked this pull request as ready for review September 7, 2026 10:45

@LucaCappelletti94 LucaCappelletti94 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.

To make dependency updates reliably visible in review, maybe we should use --locked in the CI? The sqlparser_bench job uses an independent manifest, so it likely needs its own committed lockfile, or possibly better a workspace integration.

Comment thread Cargo.lock
@@ -0,0 +1,412 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4

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.

At this time https://github.com/apache/datafusion-sqlparser-rs/blob/main/.tool-versions still specifies Rust 1.75, and version = 4 is only supported from 1.78. I suspect that the current CI misses this because it tests only stable, beta, and nightly, and not specifically 1.75.

I am not sure whether here we would want to either bump .tool-versions or downgrade the version of the Cargo.lock.

@alamb

alamb commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

thanks @LucaCappelletti94 -- I defer to your judgement for such changes. Maybe we should just punt on thsi PR until we have some issue due to dependencies 🤷

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

thanks @LucaCappelletti94 -- I defer to your judgement for such changes. Maybe we should just punt on thsi PR until we have some issue due to dependencies 🤷

I had to Google what punt meant lol, I hadn't heard it yet. Anyway sure I do not believe it is biting at this time, we can extend this PR with the updated CI later. I currently cannot yet push commits here to adjust the aforementioned things, but I suppose I should be able to next week.

@alamb

alamb commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Sounds good -- thank you

@codecov-commenter

codecov-commenter commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.96%. Comparing base (667e81d) to head (e9b3ef6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2482   +/-   ##
=======================================
  Coverage   80.96%   80.96%           
=======================================
  Files          42       42           
  Lines       33373    33373           
  Branches    33373    33373           
=======================================
  Hits        27022    27022           
  Misses       2789     2789           
  Partials     3562     3562           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

@alamb I pushed the follow-ups from my review to your branch. sqlparser_bench is now a workspace member, so one lockfile covers everything except fuzz/, which keeps its own workspace and ignores its lockfile as before. Every cargo command in CI now runs with --locked, so a dependency change that is not committed to Cargo.lock fails the build, and the lockfile diff is where reviewers see it.

.tool-versions is bumped to 1.88.0 and kept the lockfile at version 4. Making sqlparser_derive a workspace member also brings it under clippy, which flagged one sort_by that I changed to sort_by_key.

One consequence worth knowing is that the daily cargo audit now checks the committed lockfile, so a new advisory will fail it until someone runs cargo update.

LMK whether all looks good to you.

@LucaCappelletti94 LucaCappelletti94 added the waiting on contributor The review needs further refinements by its author label Sep 24, 2026

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @LucaCappelletti94 -- other than the change to tool version this makes sense to me

Comment thread .tool-versions
@@ -1 +1 @@
rust 1.75.0 No newline at end of file
rust 1.88.0 No newline at end of file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does this change the "msrv" of the crate (the minimum supported rust version) or just the versions that run the tests?

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.

The .tool-versions bump leaves the crate's MSRV untouched. The crate declares no rust-version in Cargo.toml (maybe we should), so cargo enforces no MSRV for downstream users, and downstream builds resolve their own dependency graph without reading our Cargo.lock. CI does not read .tool-versions either.

The file only selects the toolchain that asdf and mise install for local development in this checkout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The file only selects the toolchain that asdf and mise install for local development in this checkou

I thought it changes the version of rust used for clippy, etc

So that by changing this we will implicitly start testing with a newer version of rust 🤔

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.

No, those tools go by the version specified in CI, which currently is:

rust: [stable, beta, nightly]

@alamb alamb Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, I think i was confused with rust-toolchain.toml (e.g. https://github.com/apache/arrow-rs/blob/main/rust-toolchain.toml). Sorry about that

@alamb

alamb commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Looks ready to me @LucaCappelletti94 -- thank you

@LucaCappelletti94
LucaCappelletti94 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into apache:main with commit 393c2c3 Sep 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting on contributor The review needs further refinements by its author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants