Skip to content
New issue

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

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

Already on GitHub? # to your account

Drop once_cell #1518

Closed

Conversation

spenserblack
Copy link
Contributor

@spenserblack spenserblack commented Aug 12, 2024

The ecosystem seems to be moving away from using the once_cell crate towards using the types available in the standard library. In particular, once_cell::sync::Lazy is getting replaced by std::sync::LazyLock, which is mostly a drop-in replacement.

As LazyLock was stabilized in 1.80, this is a drastic increase in the MSRV, so this probably shouldn't be merged for a while. I'm not sure what the MSRV policy is, but I haven't really searched too deeply for it, yet. X versions back? X months back?

Leaving this in a draft status until:

  • The new MSRV is no longer "too new" (see helix)
  • std::cell::OnceCell::get_or_try_init is stabilized

@spenserblack spenserblack marked this pull request as draft August 12, 2024 15:57
This almost completely drops the `once_cell` crate, but `OnceCell` is
still in use. While the `OnceCell` type is available in the standard
library, the `get_or_try_init` method is not yet stabilized.

This bumps the MSRV up to 1.80, which is the first version to stabilize
`std::sync::LazyLock`.
@Byron
Copy link
Member

Byron commented Aug 12, 2024

Thanks for the initiative, it's much appreciated!

It seems a bit early, especially since you have to keep maintaining this PR for however long it takes until the MSRV can be 1.80, but I suppose this is acceptable to you.

My recommendation is to track the MSRV of helix, which in turn is tracked by gitoxide.

@spenserblack
Copy link
Contributor Author

My recommendation is to track the MSRV of helix, which in turn is tracked by gitoxide.

Does this mean that, as helix's MSRV is updated, gitoxide will respond by updating the MSRV?

@Byron
Copy link
Member

Byron commented Aug 12, 2024

Yes, that's usually what I do.

@Byron
Copy link
Member

Byron commented Aug 19, 2024

Would you consider reopneing the PR once it has a chance to actually be merged?

@spenserblack
Copy link
Contributor Author

Sure! Up to you how you want to manage this project, but what I had in mind is that this could sit around as a "to do" that I'd check in with occasionally.

@Byron
Copy link
Member

Byron commented Aug 19, 2024

I think that works similarly (from your side) on a closed PR. If CI is needed, it's possible to enable it on your fork, and it will run automatically for all branches named run-ci/** (see here).

Right now there are a lot of mostly stale PRs and this one I think will be around for quite a few months until 1.80 is the new baseline MSRV.

@spenserblack
Copy link
Contributor Author

No problem, I'll check in a while later. Unless someone else remakes this PR before I get back to it 😆

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants