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

Windows crate docs won't build #1444

Closed
kennykerr opened this issue Jul 6, 2021 · 16 comments
Closed

Windows crate docs won't build #1444

kennykerr opened this issue Jul 6, 2021 · 16 comments
Labels
C-build-failure Category: This is a crate that failed to build S-waiting-on-crate-author Status: This is a build failure that has to be fixed by the crate author, not the docs.rs team

Comments

@kennykerr
Copy link

Crate name

Windows

Build failure link

https://docs.rs/crate/windows/0.14.0/builds/408479

Requested RAM limit

No response

Requested timeout

No response

Requested number of targets

No response

Why your crate needs the resource increases

The crate docs shouldn't be overly large, but the error includes mention of memory limits and timeout. Not sure why.

@jyn514
Copy link
Member

jyn514 commented Jul 6, 2021

[INFO] [stderr] Compiling windows_gen v0.14.0
[ERROR] error running command: command timed out after 900 seconds

15 minutes is already pretty long ... Have you tested how long the docs take to build? How high a limit would you need?

@jyn514 jyn514 added the C-build-failure Category: This is a crate that failed to build label Jul 6, 2021
@kennykerr
Copy link
Author

Maybe intermittent infrastructure failure? Building locally takes around 12 seconds.


C:\git\windows-rs>cargo clean

C:\git\windows-rs>cargo doc
   Compiling proc-macro2 v1.0.27
    Checking unicode-xid v0.2.2
   Compiling syn v1.0.73
   Compiling windows_gen v0.14.0 (C:\git\windows-rs\crates\gen)
 Documenting unicode-xid v0.2.2
    Checking const-sha1 v0.2.0
 Documenting const-sha1 v0.2.0
 Documenting windows_gen v0.14.0 (C:\git\windows-rs\crates\gen)
 Documenting proc-macro2 v1.0.27
    Checking quote v1.0.9
 Documenting quote v1.0.9
 Documenting syn v1.0.73
 Documenting windows_macros v0.14.0 (C:\git\windows-rs\crates\macros)
   Compiling windows_macros v0.14.0 (C:\git\windows-rs\crates\macros)
 Documenting windows v0.14.0 (C:\git\windows-rs)
    Finished dev [unoptimized + debuginfo] target(s) in 11.94s

@jyn514
Copy link
Member

jyn514 commented Jul 6, 2021

This looks like a bug in your build script. I tried building the docs locally (on x86_64 linux) and it loops forever; strace shows it's trying to open /Cargo.toml over and over.

statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/Cargo.toml", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffe43ad85f0) = -1^Cstrace: Process 75617 detached

@jyn514
Copy link
Member

jyn514 commented Jul 6, 2021

There's no exit condition here: https://github.com/microsoft/windows-rs/blob/2538dce6a1f071f1d4afdde7ceab0c0224e33303/crates/gen/build.rs#L13-L26

Docs.rs does not keep OUT_DIR in a subdirectory of the source folder.

@jyn514 jyn514 added the S-waiting-on-crate-author Status: This is a build failure that has to be fixed by the crate author, not the docs.rs team label Jul 6, 2021
@kennykerr
Copy link
Author

That's good to know thanks!

It is incredibly frustrating that there seems to be no reliable way to determine the target dir. Am I missing something obvious? 😬

@jyn514
Copy link
Member

jyn514 commented Jul 7, 2021

Hmm, I'm not sure, you'd have to ask the cargo team if they provide that for build scripts. I know for docs.rs we set CARGO_TARGET_DIR, so you could check if that's set and default to $CARGO_MANIFEST_DIR/target otherwise. I wouldn't recommend the manual loop you have now, CARGO_MANIFEST_DIR should be more reliable in case you're in a workspace or something.

@kennykerr
Copy link
Author

I already scoured the environment variables. Its not there by default. I used CARGO_MANIFEST_DIR until I figured out that when building a published crate it sets CARGO_MANIFEST_DIR to somewhere in C:\Users\kenny\.cargo\git\checkouts\<random>\<random> and the target dir is long gone. So I'm stuck having to hack around hoping to find it. 😢

Obviously, a CARGO_TARGET_DIR would be grand. 😉

@jyn514
Copy link
Member

jyn514 commented Jul 7, 2021

@kennykerr I'm pretty sure Cargo propagates CARGO_TARGET_DIR for build scripts, you should be able to test it locally. It doesn't fix the general issue but that should get docs.rs builds working.

@kennykerr
Copy link
Author

kennykerr commented Jul 7, 2021

Yes, for doc builds but its no good if the crate itself doesn't work reliably. That's my bigger concern.

@pietroalbini
Copy link
Member

@kennykerr hello! We temporarily blocked new builds of the windows, windows_gen, windows-macros and windows-app crates, as the frequent releases combined with the 15 minutes timeout were clogging the queue:

2021-07-08--00-20-43

This is just a temporary stopgap to avoid the docs.rs queue getting out of hand, and we'll happily remove the block as soon as you have a version number that's confirmed to be fixed. Note that the documentation of the existing versions is still up, the only thing the block does is preventing new releases from being queued for a build.

@kennykerr
Copy link
Author

Sorry about the noise. I've been working on this problem all day. 😉

@pietroalbini
Copy link
Member

No worries! I hope you'll find a solution soon

@kennykerr
Copy link
Author

OK, the loop is gone: https://github.com/microsoft/windows-rs/blob/master/crates/gen/build.rs

And since the build script isn't needed for non-Windows builds anyway, I've cfg'd it away entirely for good measure.

This is fixed as of version 0.17.0 of windows, windows_gen, windows_macros, and windows-app crates.

Apologies again for the trouble.

@kennykerr
Copy link
Author

For what its worth, I also switched the build to check the docs on ubuntu instead:

microsoft/windows-rs#957

@pietroalbini
Copy link
Member

Unblocked the crates and queued builds for the 0.17.0 version of those crates! Will check in a bit to ensure they finished.

@pietroalbini
Copy link
Member

https://docs.rs/windows/0.17.0/windows/ 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-build-failure Category: This is a crate that failed to build S-waiting-on-crate-author Status: This is a build failure that has to be fixed by the crate author, not the docs.rs team
Projects
None yet
Development

No branches or pull requests

3 participants