Skip to content

wgpu passing "metal" feature to wgpu_hal on Windows #3688

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

Closed
jansen44 opened this issue Apr 14, 2023 · 2 comments
Closed

wgpu passing "metal" feature to wgpu_hal on Windows #3688

jansen44 opened this issue Apr 14, 2023 · 2 comments

Comments

@jansen44
Copy link

Description
There's not much to say. I'm on Windows, but can't get my program to compile because it keeps falling on the same compile_error:

error: Metal API enabled on non-Apple OS. If your project is not using resolver="2" in Cargo.toml, it should.

At first I thought that it could be because I'm using a MacOS bootcamp, but I tried on a Windows desktop and the same error happened.

My Cargo.toml looks like this:

[package]
name = "me"
version = "0.1.0"
edition = "2021"
resolver = "2" # I even added the resolver = "2" part because of the error message even though it's not necessary anymore

[dependencies]
anyhow = "1.0.70"
bytemuck = "1.13.1"
log = "0.4.17"
pollster = "0.3.0"
simple_logger = "4.1.0"
thiserror = "1.0.40"
winit = "0.28.3"
wgpu = "0.15.1"

I think sharing the code is irrelevant since cargo/rust can't even reach the part of compiling my own code.

Platform
OS: Windows 10 (MacOS Bootcamp) and Windows 11
Rustc: 1.68.2
Cargo: 1.68.2
wgpu: 0.15.1

@daxpedda
Copy link
Contributor

For a moment I thought it was because of my PR enabling these features on all targets: #3466.

But you are saying you are using wgpu v0.15, so this really shouldn't be happening:

wgpu/wgpu/Cargo.toml

Lines 121 to 123 in 4139175

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc]
workspace = true
features = ["metal"]

Are you in a workspace? Because if you are, you have to set the resolver there: https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions.

@jansen44
Copy link
Author

@daxpedda so it was a workspace resolver issue. Well, apparently I'm dumb and can't read docs lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants