-
Couldn't load subscription status.
- Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bugZ-scrape-examplesNightly: rustdoc scrape examplesNightly: rustdoc scrape examples
Description
Problem
If a crate's build-script fails when it has examples and -Zrustdoc-scrape-examples is used that failure is ignored and the crate is still attempted to be compiled.
Steps
> cargo new foo && cd foo
Created binary (application) `foo` package
> echo 'fn main() { panic!("failed") }' > build.rs
> echo 'compile_error!("build script failed, cannot compile");' > src/main.rs
> mkdir examples && echo 'fn main() {}' > examples/foo.rs
> cargo rustdoc
Compiling foo v0.1.0
error: failed to run custom build command for `foo v0.1.0`
Caused by:
process didn't exit successfully: `target/debug/build/foo-ba25a7af077036f3/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'failed', build.rs:1:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> cargo rustdoc -Zrustdoc-scrape-examples
Compiling foo v0.1.0
Scraping foo v0.1.0
Documenting foo v0.1.0
error: build script failed, cannot compile
--> src/main.rs:1:1
|
1 | compile_error!("build script failed, cannot compile");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Compilation failed, aborting rustdoc
error: could not document `foo`Possible Solution(s)
No response
Notes
No response
Version
cargo 1.69.0-nightly (985d561f0 2023-01-20)
release: 1.69.0-nightly
commit-hash: 985d561f0bb9b76ec043a2b12511790ec7a2b954
commit-date: 2023-01-20
host: x86_64-unknown-linux-gnu
libgit2: 1.5.1 (sys:0.16.1 vendored)
libcurl: 7.86.0-DEV (sys:0.4.59+curl-7.86.0 vendored ssl:OpenSSL/1.1.1q)
os: Arch Linux [64-bit]
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugZ-scrape-examplesNightly: rustdoc scrape examplesNightly: rustdoc scrape examples