Skip to content

specify recent once_cell version in a single place #2350

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

Closed
wants to merge 2 commits into from

Conversation

brody4hire
Copy link
Contributor

No description provided.

@brody4hire brody4hire changed the title cleanup: specify once_cell version in only 1 place specify recent once_cell version in a single place Feb 23, 2025
Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.89%. Comparing base (3ccfcec) to head (dc1601a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2350   +/-   ##
=======================================
  Coverage   94.89%   94.89%           
=======================================
  Files         103      103           
  Lines       24274    24274           
=======================================
  Hits        23034    23034           
  Misses       1240     1240           

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

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

Is there a reason you opened this as a draft? The general change seems good to me.

@@ -67,7 +67,7 @@ log = { version = "0.4.8" }
macro_rules_attribute = "0.2"
mio = { version = "1", features = ["net", "os-poll"] }
num-bigint = "0.4.4"
once_cell = { version = "1.16", default-features = false, features = ["alloc", "race"] }
once_cell = { version = "1.20.3", default-features = false, features = ["alloc", "race"] }
Copy link
Member

Choose a reason for hiding this comment

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

Can we use "1" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but I would personally downvote that idea.

I would personally vote against supporting too many outdated dependencies unless there is some kind of strong and documented motivation for this, supporting older MSRV could be an interesting example.

Outdated dependencies may have some bugs, potentially even security issues, that have already been resolved. Also I do not recall there is CI testing with the older dependency versions.

Leaving this decision up to you. I started this as a draft until I had the second commit ready. I would be happy to squash if needed.

Copy link
Member

Choose a reason for hiding this comment

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

I suggest keeping this as "1.16". The lowest we can write here is "1.7" (introduction of the "race" feature).

Generally the minor number should be moved forward only when a specific API is required; this gives cargo the widest possible set of versions to select from. And the patch number should only be specified if we have a known, specific requirement on a fix it introduced.

Copy link
Member

Choose a reason for hiding this comment

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

If we really want to sweat the details on this, we'd use cargo-minimal-versions to find (and then potentially test in CI) that we depend on the minimal version.

I don't think we should unnecessarily bump the requirement.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

But I guess that only checks in one direction: whether the required version is still good enough. The more ambitious version would be to also do the bisection to figure out the oldest version that still allows us to pass the test suite.

@brody4hire brody4hire marked this pull request as ready for review February 23, 2025 23:32
@@ -40,7 +40,7 @@ brotli-decompressor = { workspace = true, optional = true }
hashbrown = { workspace = true, optional = true }
log = { workspace = true, optional = true }
# only required for no-std
once_cell = { version = "1.16", default-features = false, features = ["alloc", "race"] }
once_cell = { workspace = true, default-features = false, features = ["alloc", "race"] }
Copy link
Member

Choose a reason for hiding this comment

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

I think the , default-features = false, features = ["alloc", "race"] can be dropped here?

Copy link
Contributor Author

@brody4hire brody4hire Feb 24, 2025

Choose a reason for hiding this comment

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

done

@@ -67,7 +67,7 @@ log = { version = "0.4.8" }
macro_rules_attribute = "0.2"
mio = { version = "1", features = ["net", "os-poll"] }
num-bigint = "0.4.4"
once_cell = { version = "1.16", default-features = false, features = ["alloc", "race"] }
once_cell = { version = "1.20.3", default-features = false, features = ["alloc", "race"] }
Copy link
Member

Choose a reason for hiding this comment

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

I suggest keeping this as "1.16". The lowest we can write here is "1.7" (introduction of the "race" feature).

Generally the minor number should be moved forward only when a specific API is required; this gives cargo the widest possible set of versions to select from. And the patch number should only be specified if we have a known, specific requirement on a fix it introduced.

@brody4hire brody4hire closed this Feb 24, 2025
@brody4hire brody4hire deleted the cleanup-once-cell-version branch February 24, 2025 14:41
@brody4hire brody4hire restored the cleanup-once-cell-version branch February 24, 2025 14:41
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.

4 participants