crossbeam icon indicating copy to clipboard operation
crossbeam copied to clipboard

Create separate sub-crate for CachePadded (second attempt)

Open mgeier opened this issue 1 year ago • 4 comments

This is an alternative to #1069.

This simply creates a symbolic link to cache_padded.rs.

This way, crossbeam-utils is unaffected.

Fixes #1066, which contains related discussion.

This is also a proof of concept, some details still need to be ironed out.

mgeier avatar Jan 08 '24 20:01 mgeier

Are there any comments on this?

The goal of this new sub-crate was to avoid unnecessary MSRV bumps (for now using version 1.38), but this conflicts with the CI check for MSRV, which checks all sub-crates at once and fails because Rust 1.38 doesn't know yet about edition 2021. Any ideas how to fix this?

mgeier avatar Feb 16 '24 07:02 mgeier

Just for reference: I have tried to come up with a hack that moves the maintenance burden to my crate: https://github.com/mgeier/rtrb/pull/115

It's ugly, but it seems to work. It still would be great if this could work out-of-the-box with crossbeam.

mgeier avatar Apr 01 '24 12:04 mgeier

I'm thinking that if we put crossbeam-utils' atomic-related APIs behind a feature flag, adopt the approach I adopted in futures-rs (https://github.com/rust-lang/futures-rs/pull/2811), revert the edition bump (https://github.com/crossbeam-rs/crossbeam/commit/c5c1361e66897b56cfaa47c2f0f7a824cef11d2b, https://github.com/crossbeam-rs/crossbeam/commit/a57e655eef415c21babddc4ba0217b6ca7acd0a2), and disable unsafe_op_in_unsafe_fn in some crates, we can revert the MSRV bump, at least in crossbeam-utils and crossbeam-queue. Of course, the first one is a breaking change, but the master branch already has some unreleased breaking changes.

As for the currently proposed approach (adding a new CachePadded-only crate), I'm not sure it's worth having a new crate, considering that few users were using the cache-padded crate even before the deprecation.

taiki-e avatar Apr 05 '24 06:04 taiki-e

Yes, that sounds great!

considering that few users were using the cache-padded crate even before the deprecation.

This might be true, but I still consider it a very important foundational crate.

It would be great to have a widely usable and unrestricted common crate for that instead of everyone copying (parts of) the code to their own crates (like e.g. https://github.com/tqtrungse/omango-util/blob/master/src/cache_padded.rs).

mgeier avatar Apr 26 '24 19:04 mgeier