rust-lang / docs.rs

crates.io documentation generator
https://docs.rs
MIT License
959 stars 195 forks source link

Add option to build with stable #506

Open rodrimati1992 opened 4 years ago

rodrimati1992 commented 4 years ago

https://docs.rs/crate/abi_stable/0.8.0/builds

abi_stable https://docs.rs/crate/abi_stable/0.8.0/builds/203164

It also failed on my computer (in nightly-2019-12-03-x86_64-unknown-linux-gnu) with the same error and this backtrace

Backtrace ``` error: internal compiler error: src/librustc/hir/def.rs:385: attempted .def_id() on invalid res: Err thread 'rustc' panicked at 'Box', src/librustc_errors/lib.rs:892:9 stack backtrace: 0: 0x7fd3894065d4 - backtrace::backtrace::libunwind::trace::hc586f95f659e6084 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0x7fd3894065d4 - backtrace::backtrace::trace_unsynchronized::ha9827fdb593fd967 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0x7fd3894065d4 - std::sys_common::backtrace::_print_fmt::h00c888c95e07165a at src/libstd/sys_common/backtrace.rs:84 3: 0x7fd3894065d4 - ::fmt::h8407ffb2d059bc74 at src/libstd/sys_common/backtrace.rs:61 4: 0x7fd38943ecec - core::fmt::write::h4165a12a3856465f at src/libcore/fmt/mod.rs:1024 5: 0x7fd3893fa937 - std::io::Write::write_fmt::h499a0566ceaa0048 at src/libstd/io/mod.rs:1428 6: 0x7fd38940aa7e - std::sys_common::backtrace::_print::h05fbb11587298e2b at src/libstd/sys_common/backtrace.rs:65 7: 0x7fd38940aa7e - std::sys_common::backtrace::print::h8021a3ed2b5ff07e at src/libstd/sys_common/backtrace.rs:50 8: 0x7fd38940aa7e - std::panicking::default_hook::{{closure}}::hd3a6326f5c6c149f at src/libstd/panicking.rs:193 9: 0x7fd38940a771 - std::panicking::default_hook::h7088fb00a0cb1faf at src/libstd/panicking.rs:210 10: 0x7fd3734d3248 - as core::ops::function::Fn>::call::ha9a0e3c625716847 at /rustc/fdc0011561c6365c596dfd8fa1ef388162bc89c7/src/liballoc/boxed.rs:983 11: 0x7fd3734d7a84 - proc_macro::bridge::client::::enter::{{closure}}::{{closure}}::hd6bd7ccb0bdaefed at /rustc/fdc0011561c6365c596dfd8fa1ef388162bc89c7/src/libproc_macro/bridge/client.rs:305 12: 0x7fd38940b230 - std::panicking::rust_panic_with_hook::h6b223bff7721d4c1 at src/libstd/panicking.rs:475 13: 0x7fd38ba6256d - std::panicking::begin_panic::h8ef26d2aea648f22 14: 0x7fd38ba969a0 - rustc_errors::HandlerInner::bug::h6b233e840067cebc 15: 0x7fd38ba9568a - rustc_errors::Handler::bug::hb654993c1e76b21a 16: 0x7fd38b36df9b - rustc::util::bug::opt_span_bug_fmt::{{closure}}::h056cc1cdf743dd12 17: 0x7fd38b36ca33 - rustc::ty::context::tls::with_opt::{{closure}}::he8758b5e67be4aee 18: 0x7fd38b36c9eb - rustc::ty::context::tls::with_opt::h944a0b8dbaa86ba6 19: 0x7fd38b36dea8 - rustc::util::bug::opt_span_bug_fmt::hae9ab10c0feecbc5 20: 0x7fd38b36de12 - rustc::util::bug::bug_fmt::h886f94e8d4bb0f0b 21: 0x556d8c032ee2 - rustc::hir::def::Res::def_id::{{closure}}::h635d7f9433dcef5e 22: 0x556d8c06edf2 - rustdoc::clean::register_res::h48d433549701437b 23: 0x556d8c1503ee - as rustdoc::clean::Clean>::clean::h49051be75d01b5e8 24: 0x556d8c11e6e4 - >::clean::h5e93a91f40d130ad 25: 0x556d8c1c6900 - as alloc::vec::SpecExtend>::from_iter::h50cc920a3f15ad93 26: 0x556d8c11edb4 - >::clean::h3304943530443092 27: 0x556d8c115fb1 - >::clean::h18c1955c1f582d3f 28: 0x556d8c116331 - >::clean::h18c1955c1f582d3f 29: 0x556d8c116331 - >::clean::h18c1955c1f582d3f 30: 0x556d8c116331 - >::clean::h18c1955c1f582d3f 31: 0x556d8c066609 - rustdoc::clean::krate::h500052b81e82211b 32: 0x556d8c0d9c8f - rustc::ty::context::tls::enter_global::hb6e5b84eb752cea9 33: 0x556d8c0ae1b3 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h7a4bf6c65cd2ef69 34: 0x556d8c28c748 - std::panicking::try::do_call::had10e69eb7c0fd8f 35: 0x7fd38941bd0a - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:78 36: 0x556d8c2883be - rustc_driver::catch_fatal_errors::h9519cfc4ab58ee18 37: 0x556d8c0465ba - rustdoc::main_options::h6fa48593da911d49 38: 0x556d8c25c8b4 - std::thread::local::LocalKey::with::hc2830240e0119ac9 39: 0x556d8c12f4ce - scoped_tls::ScopedKey::set::h8b122eaf66ecd628 40: 0x556d8c2a0984 - syntax::with_globals::h5410313cd41d17b9 41: 0x556d8c0aea72 - std::sys_common::backtrace::__rust_begin_short_backtrace::he357e176bbab3f66 42: 0x7fd38941bd0a - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:78 43: 0x556d8c133ee9 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h21e3347670049c74 44: 0x7fd3893ec88f - as core::ops::function::FnOnce>::call_once::h9ef9eb6ec2ee6be0 at /rustc/fdc0011561c6365c596dfd8fa1ef388162bc89c7/src/liballoc/boxed.rs:969 45: 0x7fd38941a730 - as core::ops::function::FnOnce>::call_once::hc0fc46e9a64f076e at /rustc/fdc0011561c6365c596dfd8fa1ef388162bc89c7/src/liballoc/boxed.rs:969 46: 0x7fd38941a730 - std::sys_common::thread::start_thread::h4eee21a391e25c99 at src/libstd/sys_common/thread.rs:13 47: 0x7fd38941a730 - std::sys::unix::thread::Thread::new::thread_start::h673f7c20aae94594 at src/libstd/sys/unix/thread.rs:80 48: 0x7fd3891876db - start_thread 49: 0x7fd388c9888f - __clone 50: 0x0 - error: aborting due to previous error error: Could not document `abi_stable`. Caused by: process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name abi_stable abi_stable/src/lib.rs -o '[redacted]/abi_stable_crates/target/doc' --cfg 'feature="channels"' --cfg 'feature="crossbeam-channel"' --cfg 'feature="default"' --cfg 'feature="serde_json"' --error-format=json --json=diagnostic-rendered-ansi -L 'dependency=[redacted]/abi_stable_crates/target/debug/deps' --extern 'abi_stable_derive=[redacted]/abi_stable_crates/target/debug/deps/libabi_stable_derive-dff63361c452ddd1.so' --extern 'abi_stable_shared=[redacted]/abi_stable_crates/target/debug/deps/libabi_stable_shared-a014f0489f9ded5a.rmeta' --extern 'core_extensions=[redacted]/abi_stable_crates/target/debug/deps/libcore_extensions-e62cb7643589c738.rmeta' --extern 'crossbeam_channel=[redacted]/abi_stable_crates/target/debug/deps/libcrossbeam_channel-24cdc3968a67dddd.rmeta' --extern 'generational_arena=[redacted]/abi_stable_crates/target/debug/deps/libgenerational_arena-9d2bda75b8618542.rmeta' --extern 'libloading=[redacted]/abi_stable_crates/target/debug/deps/liblibloading-8e22a41a3a91c5e8.rmeta' --extern 'lock_api=[redacted]/abi_stable_crates/target/debug/deps/liblock_api-6a62490fb191d43f.rmeta' --extern 'parking_lot=[redacted]/abi_stable_crates/target/debug/deps/libparking_lot-cad3989fbf66bad1.rmeta' --extern 'serde=[redacted]/abi_stable_crates/target/debug/deps/libserde-65fb8b5741d2fe57.rmeta' --extern 'serde_derive=[redacted]/abi_stable_crates/target/debug/deps/libserde_derive-86d96a74bd7eff56.so' --extern 'serde_json=[redacted]/abi_stable_crates/target/debug/deps/libserde_json-8969eba699194ab2.rmeta' --cfg 'feature="rust_1_36"' --cfg 'feature="rust_1_38"' --cfg 'feature="rust_1_39"' --cfg 'feature="nightly_rust"'` (exit code: 1) ```

This seems to be the same bug as https://github.com/rust-lang/rust/issues/67006.

cargo doc runs fine on stable-x86_64-unknown-linux-gnu - rustc 1.39.0 (4560ea788 2019-11-04).

jyn514 commented 4 years ago

This is not a docs.rs bug. Feel free to open an issue in https://github.com/rust-lang/rust/ if you think it is sufficiently different from https://github.com/rust-lang/rust/issues/67006.

rodrimati1992 commented 4 years ago

It is a build failure that would be fixed by building this crate with rustdoc stable,which is why I mention it at the end of the comment.

rodrimati1992 commented 4 years ago

cargo +nightly doc has been buggy enough for me that I would prefer if building with stable was an option on a per-crate basis.

jyn514 commented 4 years ago

This seems unlikely to be possible in the near future, see https://github.com/rust-lang/docs.rs/issues/228#issuecomment-558998819. However I would like to support this so I'm leaving the issue open.

jyn514 commented 4 years ago

The nightly options are --resource-suffix, --static-root-path, and --disable-per-crate-search. The 3rd could probably be worked around, but the first two are necessary to ensure the proper CSS files are linked for the documentation.

jyn514 commented 4 years ago

@rodrimati1992 I rebuilt your crate manually, but it failed with a different ICE! Sorry for the trouble haha, here's the new error if you want to file a bug: https://docs.rs/crate/abi_stable/0.8.1/builds/208296

rodrimati1992 commented 4 years ago

This ICE has already been reported for servo in https://github.com/rust-lang/rust/issues/67601 .

TheBlueMatt commented 3 years ago

We also now see failure to build due to https://github.com/rust-lang/rust/issues/84738. Maybe its time to switch to stable (or stable-built-with-unstable-flags-enabled) now given the recent instability of nightly?

jyn514 commented 3 years ago

@TheBlueMatt this is not currently possible, see https://github.com/rust-lang/docs.rs/issues/506#issuecomment-561958210

TheBlueMatt commented 3 years ago

Correct me if I’m wrong, but that doesn’t seem to preclude the possibility of pinning nightly instead of upgrading regularly? If nightly were pinned and only updated more occasionally we could avoid some of the breakage, no?

On Jun 14, 2021, at 16:20, Joshua Nelson @.***> wrote:

 @TheBlueMatt this is not currently possible, see #506 (comment)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jyn514 commented 3 years ago

Pinning a nightly is tracked by https://github.com/rust-lang/docs.rs/issues/228, not here.

I am not willing to have the docs.rs team be in charge of finding a "blessed" nightly that works for everyone, we don't have the time or manpower to be responsible for that.

TheBlueMatt commented 3 years ago

Is it not possible to build the release tags without the release bit set - effectively using “stable” without needing to use only stable features? Years ago I was aware of some projects that did that as a really trivial way to select a “blessed” version without needing to think about it.

On Jun 14, 2021, at 19:06, Joshua Nelson @.***> wrote:

 Pinning a nightly is tracked by #228, not here.

I am not willing to have the docs.rs team be in charge of finding a "blessed" nightly that works for everyone, we don't have the time or manpower to be responsible for that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jyn514 commented 3 years ago

@TheBlueMatt building rustc from source takes about 45 minutes on consumer hardware, and we would need somewhere to store the artifacts. There is no nightly that corresponds to stable because it will be missing backports, and it means a great deal more complexity for the team because it introduces a 6-12 week delay between when features are introduced to rustdoc and docs.rs can start using them. So I don't consider that a good alternative at this time, I think pinning nightlies is much more feasible.