-
Notifications
You must be signed in to change notification settings - Fork 519
Use subcrates #169
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
Use subcrates #169
Conversation
Cargo.toml
Outdated
| [features] | ||
| nightly = [] | ||
| default = ["use_std"] | ||
| nightly = ["crossbeam-epoch/nightly"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also include crossbeam-utils/nightly and crossbeam-channel/nightly.
Cargo.toml
Outdated
| nightly = [] | ||
| default = ["use_std"] | ||
| nightly = ["crossbeam-epoch/nightly"] | ||
| use_std = ["crossbeam-epoch/use_std"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, crossbeam-utils/use_std.
| [dependencies] | ||
| crossbeam-epoch = "0.2" | ||
| crossbeam-utils = "0.2" | ||
| crossbeam-deque = "0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want to expose channel for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, crossbeam-channel should replace the two queue implementations in sync. I don't know what's the best way to do it. I omitted this migration in this PR because I think it's @stjepang's call to make.
|
@Vtec234 I adjusted |
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, at least as a first step in the big refactoring. :)
Just one more thing: let's add crossbeam-channel as a dependency and re-export it as:
#[macro_use]
pub extern crate crossbeam_channel as channel;In the future, I'd like to see the stack and queues moved into crossbeam-stack and crossbeam-queue, but I guess it's okay if leaving them for now. Also, we should move ArcCell somewhere else (perhaps into crossbeam-atomic?) and clean up crossbeam-utils (it still has an unsound implementation of AtomicOption).
|
@stjepang hmm, do you want to reexport the macros defined in When I just copy-and-pasted your code snippet in error[E0468]: an `extern crate` loading macros must be at the crate root
--> src/sync/mod.rs:11:1
|
11 | pub extern crate crossbeam_channel as channel;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^When I copy-and-pasted your code snippet in warning: unused `#[macro_use]` import
--> src/lib.rs:30:1
|
30 | #[macro_use]
| ^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default |
|
Does this solution work? Also, I think it'd be better to re-export channel inside |
3dac13e to
e9c2407
Compare
e9c2407 to
fb357fb
Compare
|
@stjepang It works, but as a side effect, all the members of |
|
@stjepang The side-effect of visibility (e.g. |
|
Yes, I'm okay with leaving |
This reverts commit fb357fb.
This is a long-waited architectural change that makes
crossbeamuse subcrates we've been developing so far:crossbeam-epoch,crossbeam-utils, andcrossbeam-deque.It closes #168, closes #157, closes #70, closes #166, closes #165, closes #159, closes #137, closes #116, closes #113, closes #112, closes #60, closes #37, and closes #13. If any of them seems still relevant to the new version, please leave a message here.
It contains a huge API breaking change, so I bumped the version to
0.4.0. Before publishing a new version, I think we need to discuss how to organize this crate and how to document things, esp. those in the subcrates. Maybe we need an RFC for making a consensus.