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 platforms on docs.rs #1028

Closed
felixrabe opened this issue Jul 8, 2019 · 10 comments · Fixed by #2324
Closed

Missing platforms on docs.rs #1028

felixrabe opened this issue Jul 8, 2019 · 10 comments · Fixed by #2324
Labels
C - needs investigation Issue must be confirmed and researched S - docs Awareness, docs, examples, etc.

Comments

@felixrabe
Copy link
Contributor

For some reason, https://docs.rs/winit (0.20.0-alpha1) only provides the following platforms in the "Platform" dropdown menu:

  • i686-windows-pc-msvc
  • x86_64-windows-pc-msvc
  • x86_64-unknown-linux-gnu

Obviously, there's more missing, but I dearly miss macOS stuff.

@Osspial Osspial added C - needs investigation Issue must be confirmed and researched S - docs Awareness, docs, examples, etc. labels Jul 9, 2019
@Osspial
Copy link
Contributor

Osspial commented Jul 9, 2019

I'm unable to find the docs.rs logs for this. Does anyone know where you'd look to see what's going on here?

@ryanisaacg
Copy link
Contributor

The mac logs are appearing now, and docs.rs is using a new architecture iirc. Should we close this because it affects an older alpha release?

@simlay
Copy link
Contributor

simlay commented Nov 20, 2019

Having iOS (and probably android) platform docs would also be quite useful as well I think. The mobile ecosystem is slowly growing (iced-rs/iced#57)

@Osspial
Copy link
Contributor

Osspial commented Nov 21, 2019

@ryanisaacg Let's leave this open, since the docs currently aren't generated for mobile or the web.

Does anyone know of any way to have docs.rs generate docs for mobile and the web? I'm not entirely sure that's possible right now.

@ryanisaacg
Copy link
Contributor

I don't think we can convince it to? Another option would be a github pages branch on winit's repo with custom-built docs, but that would be a fair bit of effort.

@simlay
Copy link
Contributor

simlay commented Nov 21, 2019

Looks like according to rust-lang/docs.rs#343 there are currently only 6 targets supported (none of which are Android, iOS or WASM) for which docs are built. Though, it looks rust-lang/docs.rs#346 adds support for a extra_targets so, that in theory would conveniently allow for mobile and web docs when it's landed and deployed.

@jyn514
Copy link

jyn514 commented Apr 2, 2020

docs.rs supports all targets supported by rustup since rust-lang/docs.rs#633. You can opt-in using targets in Cargo.toml, which is documented on the about page.

We don't currently expose a way to see logs for platforms besides the default, the best you can do is build the crate with docs.rs locally: https://github.com/rust-lang/docs.rs#development

Usually the problem is missing dependencies which you can a PR to add following the instructions here: https://rust-lang.github.io/rust-forge/docs-rs/add-dependencies.html

@jyn514
Copy link

jyn514 commented Apr 2, 2020

Also we have a default platform limit of 10, but we can raise that if you have a use-case for more platforms.

@simlay
Copy link
Contributor

simlay commented Apr 3, 2020

So, I looked into getting more of the docs built. Currently on docs.rs, the builds are the default (i686-pc-windows-msvc, x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu, and x86_64-apple-darwin) which is everything except i686-unknown-linux-gnu at least according to the GUI.

Here's the build log trace for i686-unknown-linux-gnu. Due to the layers of docker, I'm not really sure what it's missing.

I also looked into aarch64-apple-ios and x86_64-apple-ios targets. The error that pops up is:

2020/04/03 19:32:11 [INFO] rustwide::cmd: running `"docker" "start" "-a" "2618d17a6802c9bbd798be303ed78d2fd6b3a385d65a390dc1e5e4654a544fc2"`
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr] error: failed to run `rustc` to learn about target-specific information
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr]
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr] Caused by:
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr]   process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target x86_64-apple-ios --crate-type bin --crate-type rlib --crate-typ
e dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr] --- stderr
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr] error: Error loading target specification: failed to get iphonesimulator SDK path: No such file or directory (os error 2)
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr]   |
2020/04/03 19:32:12 [INFO] rustwide::cmd: [stderr]   = help: Use `--print target-list` for a list of built-in targets

This is because rustc needs xcrun to set the -isysroot for the linker. I'm guessing that x86_64-apple-darwin doesn't need the -sysroot param because that's the default but that's a different topic.

Anyway, I've gotten wasm32-unknown-unkown to work, so I'll submit a PR for that and add explicit targets to the list.

I'll let someone else look into android stuff.

Also we have a default platform limit of 10, but we can raise that if you have a use-case for more platforms.

It seems that the GUI doesn't populate more than 4 for me? If I specify more than 4 targets, a random subset seems to not be there. I'll file a bug with docs.rs.

@jyn514
Copy link

jyn514 commented Apr 3, 2020

Here's the build log trace for i686-unknown-linux-gnu. Due to the layers of docker, I'm not really sure what it's missing.

The relevant error message is

2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m32" "-march=i686" "-Wall" "-Wextra" "-o" "/opt/rust
wide/target/i686-unknown-linux-gnu/debug/build/libloading-50b7866e56dc9b12/out/src/os/unix/global_static.o" "-c" "src/os/unix/global_static.c"
2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] cargo:warning=In file included from /usr/include/pthread.h:21:0,
2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] cargo:warning=                 from src/os/unix/global_static.c:1:
2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] cargo:warning=/usr/include/features.h:424:12: fatal error: sys/cdefs.h: No such file or directory
2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] cargo:warning= #  include <sys/cdefs.h>
2020/04/03 19:20:11 [INFO] rustwide::cmd: [stderr] cargo:warning=            ^~~~~~~~~~~~~

(we could probably work on trimming down how much we log)

From a quick google, it looks like docs.rs needs to have gcc-multilib installed to cross-compile for x32? You could add that in a PR to crates-build-env.

This is because rustc needs xcrun to set the -isysroot for the linker. I'm guessing that x86_64-apple-darwin doesn't need the -sysroot param because that's the default but that's a different topic.

It looks like xcrun is a MacOS-only tool? There's probably not a way to install it in the build environment then unfortunately, we only have packages in the Ubuntu 18.04 repository.

It seems that the GUI doesn't populate more than 4 for me? If I specify more than 4 targets, a random subset seems to not be there. I'll file a bug with docs.rs.

Oh, that is a bug. Let me look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs investigation Issue must be confirmed and researched S - docs Awareness, docs, examples, etc.
Development

Successfully merging a pull request may close this issue.

5 participants