amethyst / specs

Specs - Parallel ECS
https://amethyst.github.io/specs/
Apache License 2.0
2.51k stars 221 forks source link

Build fails if default-features is false #642

Closed Duddino closed 4 years ago

Duddino commented 5 years ago

Description

Build fails if default features if off

Meta

Rust version: 1.37.0 Specs version / commit: 0.15.1 Operating system: Windows 10

Reproduction

  1. create a new project with cargo new test_project
  2. in cargo.toml write specs = {version = "0.15.1", default-features = false } in the dependencies
  3. type cargo check or cargo build and wait

Error: ``error[E0433]: failed to resolve: could not findrayonin{{root}} --> C:\Users\DUDDINO\.cargo\registry\src\github.com-1ecc6299db9ec823\shred-0.9.3\src\dispatch\dispatcher.rs:7:56 | 7 | pub type ThreadPoolWrapper = Option<::std::sync::Arc<::rayon::ThreadPool>>; | ^^^^^ could not findrayonin{{root}}`

error[E0609]: no field thread_pool on type dispatch::builder::DispatcherBuilder<'a, 'b> --> C:\Users\DUDDINO.cargo\registry\src\github.com-1ecc6299db9ec823\shred-0.9.3\src\dispatch\builder.rs:238:28 | 238 | dispatcher_builder.thread_pool = self.thread_pool.clone(); | ^^^^^^^^^^^ help: a field with a similar name exists: thread_local

error[E0609]: no field thread_pool on type &mut dispatch::builder::DispatcherBuilder<'a, 'b> --> C:\Users\DUDDINO.cargo\registry\src\github.com-1ecc6299db9ec823\shred-0.9.3\src\dispatch\builder.rs:238:47 | 238 | dispatcher_builder.thread_pool = self.thread_pool.clone(); | ^^^^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0433, E0609. For more information about an error, try rustc --explain E0433. error: Could not compile shred.

Duddino commented 5 years ago

It's a bug in shred, and there is a pull request opened for it. for right now we could fix it by using shred 0.9.2. I will submit a PR

liamcurry commented 5 years ago

FYI in the meantime for anyone else running into this issue, I was able to compile specs without default-features by adding this to my root Cargo.toml file:

[patch.crates-io]
shred = { git = "https://github.com/mystal/shred.git", branch = "fix_no_parallel", default-features = false }

More info on [patch]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section

kyren commented 4 years ago

I believe this is fixed now that https://github.com/amethyst/shred/pull/163 is merged and shred 0.9.4 is released (though specs should probably depend on shred 0.9.4 I suppose).

kyren commented 4 years ago

Polite bump, would it be possible to change the shred dependency to 0.9.4 and release a specs 0.15.2 to fix this?

azriel91 commented 4 years ago

Hm, shred is at 0.10.0, so it would have to be a 0.16.0 (unfortunately have to update-all-the-things everywhere). Would've liked it to be 0.15.2 as well.