-
Notifications
You must be signed in to change notification settings - Fork 469
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
Cyclic package dependency with certain package features set #1146
Comments
Thanks for reporting, I will have a look to see if we could remove that dependency... |
We use cc-rs/src/parallel/job_token.rs Line 189 in bd5a4ec
The one in std And it looks like We can either roll our own use std::sync::OnceLock;
pub struct OnceCell<T>(OnceLock<Option<T>>);
impl<T> OnceCell<T> {
pub fn get_or_try_init(&self, f: FnOnce() -> io::Result<T>) -> io::Result<&T> {
let err = None;
let ret = self.0.get_or_init(|| {
match f() {
Ok(ret) => Some(ret),
Err(error) => {
err = Some(error);
None
}
}
});
ret.as_ref().ok_or_else(|| err.unwrap_or_else(|| io::ErrorKind::Other.into()))
}
} |
Yeah, I understand that I haven't enabled I've already patched |
It would be awesome if you can open a PR with the patch! I will do the code review |
Yeah I am happy to open a PR. However, the main problem is that Using |
I would accept a PR, this msrv bump is necessary to fix the compilation error. |
Alternative solution if we don't want to bump MSRV, is to vendor the |
Create a simple cargo project with these dependencies in Cargo.toml
Run
cargo check
, then cargo will emits error:The dependencies formed a cycle after #1037 (which introduces the
once_cell
dependency)The text was updated successfully, but these errors were encountered: