rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.69k stars 2.41k forks source link

Docs.rs failed to build doc for sherpa-rs #14693

Open thewh1teagle opened 2 days ago

thewh1teagle commented 2 days ago

Problem

Hi, I'm working on Rust crate in https://github.com/thewh1teagle/sherpa-rs. I just released new version to crates.io, but it doesn't available in docs.rs. It says that there was a problem when trying to build the doc. though, the build of docs with cargo doc works locally.

The log from docs.rs: https://docs.rs/crate/sherpa-rs/0.1.9/builds/1317779

Note that the crate sherpa-rs depends on sherpa-rs-sys which also depends on sherpa-onnx submodule. My assumption is that it doesn't run git submodule update --init before building the doc and the sys crate failed to build, or because it doesn't have CMake installed.

Steps

  1. Publish new version of sherpa-rs
  2. Wait for docs.rs to be generated

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.79.0 (ffa9cf99a 2024-06-03) release: 1.79.0 commit-hash: ffa9cf99a594e59032757403d4c780b46dc2c43a commit-date: 2024-06-03 host: aarch64-apple-darwin libgit2: 1.7.2 (sys:0.18.3 vendored) libcurl: 8.6.0 (sys:0.4.72+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6) ssl: OpenSSL 1.1.1w 11 Sep 2023 os: Mac OS 14.5.0 [64-bit]

weihanglo commented 2 days ago

This doesn't seem to be a Cargo issue at the first glance. Could you try the same docker command and see what's going on?

[INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/sherpa-rs-0.1.9/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/sherpa-rs-0.1.9/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:923055f121b5182466d55868a8b05e67af8ba4a3a3f6bad814e953ca3cd3ac2a" "/opt/rustwide/cargo-home/bin/cargo" "+nightly-2024-08-06" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20240805-1.82.0-nightly-e57f3090a\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`

My assumption is that it doesn't run git submodule update --init before building the doc and the sys crate failed to build,

Cargo does it best to clone every submodule, but yeah could be a bug in it.

or because it doesn't have CMake installed.

Unlikely, ghcr.io/rust-lang/crates-build-env/linux seems to have cmake pre-installed: https://github.com/rust-lang/crates-build-env/blob/b1985bec6dbb979888479019a75953fb3eb4dc50/linux/packages.txt#L16