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

Run rustdoc as part of CI process / resolve failure on docs.rs #241

Closed
iliekturtles opened this issue Feb 15, 2021 · 2 comments
Closed

Run rustdoc as part of CI process / resolve failure on docs.rs #241

iliekturtles opened this issue Feb 15, 2021 · 2 comments

Comments

@iliekturtles
Copy link
Owner

https://docs.rs/crate/uom/0.31.0/builds/332917

v0.31.0 failed to build documentation on docs.rs. Likely cause is time/memory limits based on the SIGKILL in the log. The log also highlights a warning that wasn't caught as part of the CI process.

Running rustdoc as part of CI is complicated because cargo doc doesn't provide a way to pass the -D warnings flag to rustdoc itself. rustdoc doesn't use RUSTFLAGS or a similar variable as far as I can tell and the cargo interface provides no escape to send parameters directly rust doc, e.g. cargo doc -- -D warnings.

Currently uom instructs docs.rs to compile with all features.

uom/Cargo.toml

Lines 19 to 20 in 8a4883b

[package.metadata.docs.rs]
all-features = true

How much time/memory is this taking? Reduce the number of features? Ask for a sandbox limit increase?

@iliekturtles
Copy link
Owner Author

Turns out RUSTDOCFLAGS works.

https://doc.rust-lang.org/cargo/reference/environment-variables.html

iliekturtles added a commit that referenced this issue Feb 15, 2021
iliekturtles added a commit that referenced this issue Feb 15, 2021
iliekturtles added a commit that referenced this issue Feb 15, 2021
iliekturtles added a commit that referenced this issue Feb 15, 2021
iliekturtles added a commit that referenced this issue Feb 15, 2021
@iliekturtles
Copy link
Owner Author

Reduced features for docs.rs to drop max memory usage below 3 GB.

~/uom (master)$ /usr/bin/time cargo doc --all-features
    Finished dev [unoptimized + debuginfo] target(s) in 1m 49s
106.50user 43.56system 1:50.04elapsed 136%CPU (0avgtext+0avgdata 3246772maxresident)k
0inputs+0outputs (0major+2071424minor)pagefaults 0swaps
~/uom (master)$ /usr/bin/time -v cargo doc --features "usize u32 u64 isize i32 i64 bigint biguint rational rational32 rational64 bigrational try-from use_serde"
    Finished dev [unoptimized + debuginfo] target(s) in 54.93s
    Maximum resident set size (kbytes): 2536176

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

1 participant