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

Missing targets when requested from metadata #2424

Closed
kpreid opened this issue Feb 26, 2024 · 3 comments
Closed

Missing targets when requested from metadata #2424

kpreid opened this issue Feb 26, 2024 · 3 comments

Comments

@kpreid
Copy link

kpreid commented Feb 26, 2024

In https://docs.rs/wgpu/0.19.1/wgpu/index.html and https://docs.rs/wgpu/0.19.0/wgpu/index.html, the Platform menu lists only x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu, even though the Cargo.toml contains

[package.metadata.docs.rs]
targets = [
    "x86_64-unknown-linux-gnu",
    "x86_64-apple-darwin",
    "x86_64-pc-windows-msvc",
    "wasm32-unknown-unknown",
]

The prior version https://docs.rs/wgpu/0.18.0/wgpu/ does have wasm32-unknown-unknown, but still not x86_64-apple-darwin. It seems like in both cases certain targets are being silently ignored (even the build log has no info on this) and this has gotten worse between the two versions.

@Nemo157
Copy link
Member

Nemo157 commented Feb 26, 2024

The issue will be that those targets failed to build, nothing being shown in the build logs is #787

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`

(I've recently noticed that there's now https://github.com/dtolnay/cargo-docs-rs which could be used to test the docs build in CI relatively similarly to how it will run on docs.rs)

@kpreid
Copy link
Author

kpreid commented Feb 28, 2024

Thanks! I've copied this info to the wgpu issue tracker.

I assume there's no reason to keep this issue open.

@syphar
Copy link
Member

syphar commented Feb 28, 2024

triggered by this discussion I had another look at logging non-default build targets: #2427

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

3 participants