- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bug
Description
Problem
Prior to Rust 2021, when building wgpu on windows without resolver = "2", I get this error:
error: Metal API enabled on non-Apple OS. If your project is not using resolver="2" in Cargo.toml, it should.
  --> C:\Users\me\.cargo\registry\src\gitproxy.zycloud.tk-1ecc6299db9ec823\wgpu-hal-0.11.3\src\lib.rs:49:1
   |
49 | compile_error!("Metal API enabled on non-Apple OS. If your project is not using resolver=\"2\" in Cargo.toml, it should.");  
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
Now with Rust 2021, this is fixed for crates, but it doesn't seem to be fixed in workspaces.
Steps
- Create a workspace with
[workspace]
members = [ "foo" ]
- cargo new fooand use this config
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
wgpu = "0.11.0"
- Run cargo buildand get wgpu's resolver error.
- Repeat the above without a workspace, and see there is no resolver error.
Possible Solution(s)
After searching the code, I found
cargo/src/cargo/core/workspace.rs
Line 184 in 72aee9e
| resolve_behavior: ResolveBehavior::V1, | 
which might be the problem.
Notes
No response
Version
cargo 1.56.0 (4ed5d137b 2021-10-04)
release: 1.56.0
commit-hash: 4ed5d137baff5eccf1bae5a7b2ae4b57efad4a7d
commit-date: 2021-10-04
rukai, vladbat00, rMazeiks, Manu343726, swarnimarun and 1 more
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug