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 documentation for apple and microsoft target on docs.rs #3289

Closed
roblabla opened this issue Jul 3, 2023 · 15 comments · Fixed by #3470
Closed

Missing documentation for apple and microsoft target on docs.rs #3289

roblabla opened this issue Jul 3, 2023 · 15 comments · Fixed by #3470

Comments

@roblabla
Copy link
Contributor

roblabla commented Jul 3, 2023

The latest version of libc only has documentation for the following targets on docs.rs:

This is missing any documentation at least for the windows and macos versions (which were there in 0.2.146 and below, see this, and it doesn't seem to be in the build queue anymore.

@roblabla roblabla added the C-bug Category: bug label Jul 3, 2023
@JohnTitor
Copy link
Member

I believe it's an issue of docs.rs? We surely added all the supported targets in #3279. cc @GuillaumeGomez

@JohnTitor JohnTitor removed the C-bug Category: bug label Jul 5, 2023
@GuillaumeGomez
Copy link
Member

Taking a look!

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

docs.rs by default limits all crates to max 10 targets. i don't mind raising the limit as long as we decrease the max build time per target. cargo doc --features const-extern-fn,extra_traits -Zbuild-std --target x86_64-pc-windows-msvc -j2 takes 64 seconds for me on a T480s laptop, including the time to build std - does a 2 minute limit seem reasonable? (-j2 is what we use in production)

@JohnTitor
Copy link
Member

Thanks for clarifying, I see! If it doesn't have much negative impact on other crates and docs.rs, that sounds great to me (to clarify, we still can host some targets, e.g. tier 2 or below, on our Pages, but I guess it's easier to use for these docs to be available on docs.rs).

And I noticed #3279 doesn't contain any macOS targets, does it disable builds for macOS (i.e. x86_64-apple-darwin)?

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

I am not sure what order we build the targets in - which targets we select if there's too many over the limit is an implementation detail I've never tested.

Let me change the limits and rebuild 0.2.147 and we can go from there :)

@GuillaumeGomez
Copy link
Member

Thanks @jyn514 !

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

most of the targets seem to be working. here are the failures i saw:

# mipsel-unknown-linux-gnu, mipsel-unknown-linux-musl, mips-unknown-linux-gnu
error: Undefined temporary symbol $BB161_17
error: could not compile `rustc-demangle` (lib) 

# aarch64-unknown-hermit
 error[E0609]: no field `tv_sec` on type `&Timespec` 
  --> /opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/hermit/time.rs:43:29 

# x86_64-linux-android, aarch64-linux-android, thumbv7neon-linux-androideabi, arm-linux-androideabi, armv7-linux-androideabi, i686-linux-android
error: failed to run custom build command for `unwind v0.0.0 (/opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)`
thread 'main' panicked at 'Unable to invoke compiler: Error { kind: IOError, message: "No such file or directory (os error 2)" }', /opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind/build.rs:19:62 

# powerpc-unknown-netbsd
error[E0277]: the trait bound `i32: core::convert::From<u32>` is not satisfied
 --> /opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread_parking/netbsd.rs:37:37

# aarch64-wrs-vxworks, i686-wrs-vxworks, powerpc64-wrs-vxworks, powerpc-wrs-vxworks
error[E0432]: unresolved imports `libc::fdopendir`, `libc::openat`, `libc::unlinkat`
 --> /opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:1936:16
error[E0425]: cannot find value `UTIME_OMIT` in crate `libc` 
error[E0425]: cannot find function `futimens` in crate `libc`
error[E0425]: cannot find function `lchown` in crate `libc`
# ... lots more errors for this target, 9 total ... 

# riscv32imc-unknown-none-elf, riscv32i-unknown-none-elf
error[E0432]: unresolved import `core::sync::atomic::AtomicUsize`
 --> /opt/rustwide/rustup-home/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/cache.rs:8:5
error[E0432]: unresolved import `alloc::sync`
 --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/gimli-0.27.3/src/read/dwarf.rs:2:12

the build is still running so this list is not exhaustive.

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

at this point i think i would suggest running docs.rs locally so you can confirm you've properly fixed all the errors; it will be too painful to publish a release every time to test and i'm nearly out of time for rust for the day anyway. as a heuristic cargo doc -Zbuild-std --features ... on x86_64-unknown-linux-gnu will probably get you 99% percent of the way to replicating the build env.

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

i'm also a little worried about how long this takes to run ... i started the build 50 minutes ago and it shows no sign of stopping soon. maybe we can change the docs.rs configuration somehow so that build-std is only used for tier 3 targets? we'd have to add a new metadata field, i'd want to confirm first that actually makes it faster.

@GuillaumeGomez
Copy link
Member

I'm surprised it takes this long. We need to check if we link libraries and in such case, not do it if a feature is passed. To be investigated.

@jyn514
Copy link
Member

jyn514 commented Jul 5, 2023

@GuillaumeGomez the problem is that the standard library is built from source - if you could use -Zbuild-std=core or something, that would already be a big help

@jyn514

This comment was marked as resolved.

@GuillaumeGomez
Copy link
Member

I opened #3292 for that. Quite curious to see the result.

bors added a commit that referenced this issue Jul 9, 2023
Use `build-std=core` instead of `build-std` alone

Should help with #3289.
@roblabla
Copy link
Contributor Author

roblabla commented Aug 6, 2023

The microsoft targets now show up, but the macos (darwin) ones are still missing. This is a bit problematic because it results in broken links in our crate's documentation (here, clicking on stat results in a broken link for instance)

@GuillaumeGomez
Copy link
Member

I added them in #3309. So next release they should appear.

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

Successfully merging a pull request may close this issue.

4 participants