Skip to content
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

docs.rs macOS and wasm32 builds failing #5317

Closed
kpreid opened this issue Feb 28, 2024 · 1 comment
Closed

docs.rs macOS and wasm32 builds failing #5317

kpreid opened this issue Feb 28, 2024 · 1 comment

Comments

@kpreid
Copy link
Contributor

kpreid commented Feb 28, 2024

With wgpu 0.18, the macOS and wasm32 targets no longer build on docs.rs as they did in previous versions. rust-lang/docs.rs#2424 (comment) retrieved the details:

Trying cargo rustdoc --target wasm32-unknown-unknown locally gives an explicit compile_error!:

error: webgpu feature used without web_sys_unstable_apis config:
       Here are some ways to resolve this:
       * If you wish to use webgpu backend, create a .cargo/config.toml in the root of the repo containing:
           [build]
           rustflags = [ "--cfg=web_sys_unstable_apis" ]
           rustdocflags = [ "--cfg=web_sys_unstable_apis" ]
       * If you wish to disable webgpu backend and instead use webgl backend, change your wgpu Cargo.toml entry to:
           wgpu = { version = "", default-features = false, features = ["webgl"] }
  --> src/backend/mod.rs:7:1
   |
7  | / compile_error!(
8  | |     "webgpu feature used without web_sys_unstable_apis config:
9  | | Here are some ways to resolve this:
10 | | * If you wish to use webgpu backend, create a .cargo/config.toml in the root of the repo containing:
...  |
16 | | "
17 | | );
   | |_^

while x86_64-apple-darwin appears to fail to cross-compile a dependency

warning: [email protected]: gcc: error: unrecognized command-line option ‘-arch’
warning: [email protected]: gcc: error: unrecognized command-line option ‘-mmacosx-version-min=10.7’

error: failed to run custom build command for `objc_exception v0.1.2`

So, at least, the docs.rs metadata in wgpu/Cargo.toml should be updated to include building with --cfg=web_sys_unstable_apis. I don't know what would be doable for the macOS build.

@cwfitzgerald
Copy link
Member

Way ahead of you :) This fixes the wasm issue #5310 and gfx-rs/metal-rs#303 should make metal compile again

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