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

Docs.rs build failed for kube 0.79 #1150

Closed
clux opened this issue Feb 23, 2023 · 8 comments · Fixed by #1155
Closed

Docs.rs build failed for kube 0.79 #1150

clux opened this issue Feb 23, 2023 · 8 comments · Fixed by #1155

Comments

@clux
Copy link
Member

clux commented Feb 23, 2023

4 hours wait, and it crashes with something that doesn't reproduce locally :|
https://docs.rs/crate/kube/0.79.0/builds/750798

Looks transient. Not sure if we can re-run docs.rs?

@clux
Copy link
Member Author

clux commented Feb 23, 2023

[INFO] [stderr] thread 'rustc' panicked at 'no resolution for "kube_runtime" MacroNS DefId(21:0 ~ kube_runtime[5b43])',

i don't understand this one at least.

it could genuinely be the memory limit. 3GB seems pretty low for us when we need to compile k8s-openapi.

@clux
Copy link
Member Author

clux commented Feb 23, 2023

oh wait:

[INFO] [stderr] error: the compiler unexpectedly panicked. this is a bug.
[INFO] [stderr] 
[INFO] [stderr] note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

is this actually ICE?

@jmintb
Copy link
Contributor

jmintb commented Feb 26, 2023

I seem to be hitting the same issue locally.

thread 'rustc' panicked at 'no resolution for "kube_runtime" MacroNS DefId(21:0 ~ kube_runtime[d02f])', src/librustdoc/passes/collect_intra_doc_links.rs:391:32

@clux
Copy link
Member Author

clux commented Mar 1, 2023

This reproduces for me with latest nightly as well.

error: Recipe `doc` failed on line 18 with exit code 101
󰩽kube  meta-gen.  export RUST_BACKTRACE=full                                                                       took 22s ☸ k3d-main󰛢kube-system
󰩽kube  meta-gen.  just doc                                                                                                   ☸ k3d-main󰛢kube-system
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,jsonpatch,client,derive,runtime,admission,k8s-openapi/v1_26
 Documenting kube v0.79.0 (/Users/cluxm1/kube/kube/kube)
thread 'rustc' panicked at 'no resolution for "kube_runtime" MacroNS DefId(21:0 ~ kube_runtime[1a51])', src/librustdoc/passes/collect_intra_doc_links.r
stack backtrace:
   0:        0x1059488e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcc0d0be5d915b423
   1:        0x10599b5c8 - core::fmt::write::hd192c56b84d0d5fc
   2:        0x10593e664 - std::io::Write::write_fmt::hc875b6ab61d117f8
   3:        0x1059486f8 - std::sys_common::backtrace::print::hfdc3c075d7f207b2
   4:        0x10594b180 - std::panicking::default_hook::{{closure}}::h9a29056d92273910
   5:        0x10594aed8 - std::panicking::default_hook::h918749fa9e3bbd56
   6:        0x10da52c40 - rustc_driver_impl[d64a6cd033fc9735]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10594b878 - std::panicking::rust_panic_with_hook::h115b7bf8f2adb68e
   8:        0x10594b670 - std::panicking::begin_panic_handler::{{closure}}::h610771468070e0bf
   9:        0x105948d04 - std::sys_common::backtrace::__rust_end_short_backtrace::h84374e7a8d4c9564
  10:        0x10594b3cc - _rust_begin_unwind
  11:        0x1059c67d8 - core::panicking::panic_fmt::heb926c9af39e8a59
  12:        0x10482755c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  13:        0x104827660 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve
  14:        0x10482a34c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>:
  15:        0x104830f00 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>::visit_inner_recur
  16:        0x10482c694 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>::visit_item
  17:        0x1048263e0 - rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::collect_intra_doc_links
  18:        0x104790b70 - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15c48c11a3]::core::run_global_ctxt::{closure#7}>
  19:        0x104855dc4 - rustdoc[e57c1b15c48c11a3]::core::run_global_ctxt
  20:        0x104790ecc - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<(rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15c48c11a3]::config::RenderOptions, rustdoc[e57c1b15c48c11a3]::formats::cache::Cache), rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21:        0x10472f6e8 - <rustc_middle[9aff26e3a0f3d796]::ty::context::GlobalCtxt>::enter::<rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  22:        0x1046e1d1c - rustc_span[bf03fa047f347bdc]::with_source_map::<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  23:        0x1046c7f58 - <scoped_tls[a1ca79f4647d377]::ScopedKey<rustc_span[bf03fa047f347bdc]::SessionGlobals>>::set::<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  24:        0x1047cf910 - std[d7a38f31206b4b19]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  25:        0x104847ed8 - <<std[d7a38f31206b4b19]::thread::Builder>::spawn_unchecked_<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#1} as core[148cf5453b9b515a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:        0x105953c90 - std::sys::unix::thread::Thread::new::thread_start::hb980a9956f6723db
  27:        0x1990ae06c - __pthread_deallocate

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.69.0-nightly (31f858d9a 2023-02-28) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not document `kube`

@clux
Copy link
Member Author

clux commented Mar 1, 2023

smallest feature set / crate set i managed to reproduce this with:

$ cargo +nightly doc -p kube --no-default-features

error: could not document `kube`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name kube kube/src/lib.rs -o /Users/cluxm1/kube/kube/target/doc --
󰩽kube  meta-gen.  cargo +nightly doc -p kube --no-default-features                                                  took 7s ☸ k3d-main󰛢kube-system
 Documenting kube v0.79.0 (/Users/cluxm1/kube/kube/kube)
warning: unresolved link to `crate::client`
  --> kube/src/lib.rs:10:18
   |
10 | //! - [`client`](crate::client) with the Kubernetes [`Client`](crate::Client) and its layers
   |                  ^^^^^^^^^^^^^ no item named `client` in module `kube`
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `crate::Client`
  --> kube/src/lib.rs:10:64
   |
10 | //! - [`client`](crate::client) with the Kubernetes [`Client`](crate::Client) and its layers
   |                                                                ^^^^^^^^^^^^^ no item named `Client` in module `kube`

warning: unresolved link to `crate::config`
  --> kube/src/lib.rs:11:18
   |
11 | //! - [`config`](crate::config) for cluster [`Config`](crate::Config)
   |                  ^^^^^^^^^^^^^ no item named `config` in module `kube`

warning: unresolved link to `crate::Config`
  --> kube/src/lib.rs:11:56
   |
11 | //! - [`config`](crate::config) for cluster [`Config`](crate::Config)
   |                                                        ^^^^^^^^^^^^^ no item named `Config` in module `kube`

warning: unresolved link to `crate::api`
  --> kube/src/lib.rs:12:15
   |
12 | //! - [`api`](crate::api) with the generic Kubernetes [`Api`](crate::Api)
   |               ^^^^^^^^^^ no item named `api` in module `kube`

warning: unresolved link to `crate::Api`
  --> kube/src/lib.rs:12:63
   |
12 | //! - [`api`](crate::api) with the generic Kubernetes [`Api`](crate::Api)
   |                                                               ^^^^^^^^^^ no item named `Api` in module `kube`

warning: unresolved link to `kube_derive`
  --> kube/src/lib.rs:13:18
   |
13 | //! - [`derive`](kube_derive) with the [`CustomResource`](crate::CustomResource) derive for building controllers types
   |                  ^^^^^^^^^^^ no item named `kube_derive` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `crate::CustomResource`
  --> kube/src/lib.rs:13:59
   |
13 | //! - [`derive`](kube_derive) with the [`CustomResource`](crate::CustomResource) derive for building controllers types
   |                                                           ^^^^^^^^^^^^^^^^^^^^^ no item named `CustomResource` in module `kube`

warning: unresolved link to `crate::runtime`
  --> kube/src/lib.rs:14:19
   |
14 | //! - [`runtime`](crate::runtime) with a [`Controller`](crate::runtime::Controller) / [`watcher`](crate::runtime::watcher()) / [`reflector`](cr...
   |                   ^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::runtime::Controller`
  --> kube/src/lib.rs:14:57
   |
14 | //! - [`runtime`](crate::runtime) with a [`Controller`](crate::runtime::Controller) / [`watcher`](crate::runtime::watcher()) / [`reflector`](cr...
   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::runtime::watcher`
  --> kube/src/lib.rs:14:99
   |
14 | ...::runtime::Controller) / [`watcher`](crate::runtime::watcher()) / [`reflector`](crate::runtime::reflector::reflector) / [`Store`](crate::run...
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::runtime::reflector::reflector`
  --> kube/src/lib.rs:14:142
   |
14 | ...me::watcher()) / [`reflector`](crate::runtime::reflector::reflector) / [`Store`](crate::runtime::reflector::Store)
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::runtime::reflector::Store`
  --> kube/src/lib.rs:14:192
   |
14 | ...eflector::reflector) / [`Store`](crate::runtime::reflector::Store)
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::client`
  --> kube/src/lib.rs:41:18
   |
41 | //! - [`Client`](crate::client) for the extensible Kubernetes client
   |                  ^^^^^^^^^^^^^ no item named `client` in module `kube`

warning: unresolved link to `crate::Api`
  --> kube/src/lib.rs:42:15
   |
42 | //! - [`Api`](crate::Api) for the generic api methods available on Kubernetes resources
   |               ^^^^^^^^^^ no item named `Api` in module `kube`

warning: unresolved link to `crate::CustomResource`
   --> kube/src/lib.rs:101:26
    |
101 | //! - [`CustomResource`](crate::CustomResource) for documentation how to configure custom resources
    |                          ^^^^^^^^^^^^^^^^^^^^^ no item named `CustomResource` in module `kube`

warning: unresolved link to `crate::runtime::watcher`
   --> kube/src/lib.rs:102:28
    |
102 | //! - [`runtime::watcher`](crate::runtime::watcher()) for how to long-running watches work and why you want to use this over [`Api::watch`](cr...
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

warning: unresolved link to `crate::Api::watch`
   --> kube/src/lib.rs:102:141
    |
102 | ... you want to use this over [`Api::watch`](crate::Api::watch)
    |                                              ^^^^^^^^^^^^^^^^^ no item named `Api` in module `kube`

warning: unresolved link to `crate::runtime`
   --> kube/src/lib.rs:103:19
    |
103 | //! - [`runtime`](crate::runtime) for abstractions that help with more complicated Kubernetes application
    |                   ^^^^^^^^^^^^^^ no item named `runtime` in module `kube`

thread 'rustc' panicked at 'no resolution for "kube_core" MacroNS DefId(20:0 ~ kube_core[8870])', src/librustdoc/passes/collect_intra_doc_links.rs:391:
stack backtrace:
   0:        0x1019b88e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcc0d0be5d915b423
   1:        0x101a0b5c8 - core::fmt::write::hd192c56b84d0d5fc
   2:        0x1019ae664 - std::io::Write::write_fmt::hc875b6ab61d117f8
   3:        0x1019b86f8 - std::sys_common::backtrace::print::hfdc3c075d7f207b2
   4:        0x1019bb180 - std::panicking::default_hook::{{closure}}::h9a29056d92273910
   5:        0x1019baed8 - std::panicking::default_hook::h918749fa9e3bbd56
   6:        0x109ac2c40 - rustc_driver_impl[d64a6cd033fc9735]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x1019bb878 - std::panicking::rust_panic_with_hook::h115b7bf8f2adb68e
   8:        0x1019bb670 - std::panicking::begin_panic_handler::{{closure}}::h610771468070e0bf
   9:        0x1019b8d04 - std::sys_common::backtrace::__rust_end_short_backtrace::h84374e7a8d4c9564
  10:        0x1019bb3cc - _rust_begin_unwind
  11:        0x101a367d8 - core::panicking::panic_fmt::heb926c9af39e8a59
  12:        0x10089755c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  13:        0x100897660 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve
  14:        0x10089a34c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>:
  15:        0x1008a0f00 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>:
  16:        0x10089c694 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>:
  17:        0x1008963e0 - rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::collect_intra_doc_links
  18:        0x100800b70 - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15
  19:        0x1008c5dc4 - rustdoc[e57c1b15c48c11a3]::core::run_global_ctxt
  20:        0x100800ecc - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<(rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15c48c11a3]::config::RenderOptions, rustdoc[e57c1b15c48c11a3]::formats::cache::Cache), rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21:        0x10079f6e8 - <rustc_middle[9aff26e3a0f3d796]::ty::context::GlobalCtxt>::enter::<rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  22:        0x100751d1c - rustc_span[bf03fa047f347bdc]::with_source_map::<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  23:        0x100737f58 - <scoped_tls[a1ca79f4647d377]::ScopedKey<rustc_span[bf03fa047f347bdc]::SessionGlobals>>::set::<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  24:        0x10083f910 - std[d7a38f31206b4b19]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  25:        0x1008b7ed8 - <<std[d7a38f31206b4b19]::thread::Builder>::spawn_unchecked_<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#1} as core[148cf5453b9b515a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:        0x1019c3c90 - std::sys::unix::thread::Thread::new::thread_start::hb980a9956f6723db
  27:        0x1990ae06c - __pthread_deallocate

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.69.0-nightly (31f858d9a 2023-02-28) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
warning: `kube` (lib doc) generated 19 warnings
error: could not document `kube`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name kube kube/src/lib.rs -o /Users/cluxm1/kube/kube/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=151 -C metadata=f980c031224af1b2 -L dependency=/Users/cluxm1/kube/kube/target/debug/deps --extern k8s_openapi=/Users/cluxm1/kube/kube/target/debug/deps/libk8s_openapi-849ab57dbb0a519a.rmeta --extern kube_core=/Users/cluxm1/kube/kube/target/debug/deps/libkube_core-e2a041b0ef8754f2.rmeta --crate-version 0.79.0` (exit status: 101)

@clux
Copy link
Member Author

clux commented Mar 1, 2023

Local fix that sidesteps the issue for us (edit: parts of, full fix at bottom):

diff --git a/kube/src/lib.rs b/kube/src/lib.rs
index b497410..f5dfa75 100644
--- a/kube/src/lib.rs
+++ b/kube/src/lib.rs
@@ -175,7 +175,7 @@ pub use kube_derive::CustomResource;
 pub use kube_runtime as runtime;

 pub use crate::core::{CustomResourceExt, Resource, ResourceExt};
-/// Re-exports from [`kube_core`](kube_core)
+/// Re-exports from `kube_core`
 #[doc(inline)]
 pub use kube_core as core;

@clux clux removed the blocked awaiting upstream work label Mar 1, 2023
@clux
Copy link
Member Author

clux commented Mar 1, 2023

actually, this only fixes one of the compiler errors. when we add back the runtime feature flag we get another (after the above patch):

$ cargo +nightly doc -p kube --features=runtime

warning: unresolved link to `kube_derive`
  --> kube/src/lib.rs:13:18
   |
13 | //! - [`derive`](kube_derive) with the [`CustomResource`](crate::CustomResource) derive for building controllers types
   |                  ^^^^^^^^^^^ no item named `kube_derive` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `crate::CustomResource`
  --> kube/src/lib.rs:13:59
   |
13 | //! - [`derive`](kube_derive) with the [`CustomResource`](crate::CustomResource) derive for building controllers types
   |                                                           ^^^^^^^^^^^^^^^^^^^^^ no item named `CustomResource` in module `kube`

warning: unresolved link to `crate::CustomResource`
   --> kube/src/lib.rs:101:26
    |
101 | //! - [`CustomResource`](crate::CustomResource) for documentation how to configure custom resources
    |                          ^^^^^^^^^^^^^^^^^^^^^ no item named `CustomResource` in module `kube`

thread 'rustc' panicked at 'no resolution for "kube_runtime" MacroNS DefId(20:0 ~ kube_runtime[6260])', src/librustdoc/passes/collect_intra_doc_links.rs:391:32
stack backtrace:
   0:        0x1019548e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcc0d0be5d915b423
   1:        0x1019a75c8 - core::fmt::write::hd192c56b84d0d5fc
   2:        0x10194a664 - std::io::Write::write_fmt::hc875b6ab61d117f8
   3:        0x1019546f8 - std::sys_common::backtrace::print::hfdc3c075d7f207b2
   4:        0x101957180 - std::panicking::default_hook::{{closure}}::h9a29056d92273910
   5:        0x101956ed8 - std::panicking::default_hook::h918749fa9e3bbd56
   6:        0x109a5ec40 - rustc_driver_impl[d64a6cd033fc9735]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x101957878 - std::panicking::rust_panic_with_hook::h115b7bf8f2adb68e
   8:        0x101957670 - std::panicking::begin_panic_handler::{{closure}}::h610771468070e0bf
   9:        0x101954d04 - std::sys_common::backtrace::__rust_end_short_backtrace::h84374e7a8d4c9564
  10:        0x1019573cc - _rust_begin_unwind
  11:        0x1019d27d8 - core::panicking::panic_fmt::heb926c9af39e8a59
  12:        0x10083355c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  13:        0x100833660 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector>::resolve
  14:        0x10083634c - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>::visit_item
  15:        0x10083cf00 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>::visit_inner_recur
  16:        0x100838694 - <rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::LinkCollector as rustdoc[e57c1b15c48c11a3]::visit::DocVisitor>::visit_item
  17:        0x1008323e0 - rustdoc[e57c1b15c48c11a3]::passes::collect_intra_doc_links::collect_intra_doc_links
  18:        0x10079cb70 - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15c48c11a3]::core::run_global_ctxt::{closure#7}>
  19:        0x100861dc4 - rustdoc[e57c1b15c48c11a3]::core::run_global_ctxt
  20:        0x10079cecc - <rustc_session[36d6438d8a3d46fd]::session::Session>::time::<(rustdoc[e57c1b15c48c11a3]::clean::types::Crate, rustdoc[e57c1b15c48c11a3]::config::RenderOptions, rustdoc[e57c1b15c48c11a3]::formats::cache::Cache), rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  21:        0x10073b6e8 - <rustc_middle[9aff26e3a0f3d796]::ty::context::GlobalCtxt>::enter::<rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  22:        0x1006edd1c - rustc_span[bf03fa047f347bdc]::with_source_map::<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  23:        0x1006d3f58 - <scoped_tls[a1ca79f4647d377]::ScopedKey<rustc_span[bf03fa047f347bdc]::SessionGlobals>>::set::<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  24:        0x1007db910 - std[d7a38f31206b4b19]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>
  25:        0x100853ed8 - <<std[d7a38f31206b4b19]::thread::Builder>::spawn_unchecked_<rustc_interface[dc7960f4d603634d]::util::run_in_thread_pool_with_globals<rustc_interface[dc7960f4d603634d]::interface::run_compiler<core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>, rustdoc[e57c1b15c48c11a3]::main_args::{closure#1}>::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[148cf5453b9b515a]::result::Result<(), rustc_span[bf03fa047f347bdc]::ErrorGuaranteed>>::{closure#1} as core[148cf5453b9b515a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:        0x10195fc90 - std::sys::unix::thread::Thread::new::thread_start::hb980a9956f6723db
  27:        0x1990ae06c - __pthread_deallocate

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.69.0-nightly (31f858d9a 2023-02-28) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
warning: `kube` (lib doc) generated 3 warnings
error: could not document `kube`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name kube kube/src/lib.rs -o /Users/cluxm1/kube/kube/target/doc --cfg 'feature="client"' --cfg 'feature="config"' --cfg 'feature="default"' --cfg 'feature="kube-client"' --cfg 'feature="kube-runtime"' --cfg 'feature="openssl-tls"' --cfg 'feature="runtime"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=151 -C metadata=717cf8f92c2626c2 -L dependency=/Users/cluxm1/kube/kube/target/debug/deps --extern k8s_openapi=/Users/cluxm1/kube/kube/target/debug/deps/libk8s_openapi-0d6e647cc94e150f.rmeta --extern kube_client=/Users/cluxm1/kube/kube/target/debug/deps/libkube_client-0988ba6372f61d4b.rmeta --extern kube_core=/Users/cluxm1/kube/kube/target/debug/deps/libkube_core-e5a9a1b5ee8170d1.rmeta --extern kube_runtime=/Users/cluxm1/kube/kube/target/debug/deps/libkube_runtime-b92f25e44b87787a.rmeta --crate-version 0.79.0` (exit status: 101)

@clux
Copy link
Member Author

clux commented Mar 1, 2023

Thankfully, it has a similar fix;

diff --git a/kube/src/lib.rs b/kube/src/lib.rs
index b497410..548d552 100644
--- a/kube/src/lib.rs
+++ b/kube/src/lib.rs
@@ -168,14 +168,14 @@ cfg_error! {
 #[cfg_attr(docsrs, doc(cfg(feature = "derive")))]
 pub use kube_derive::CustomResource;
 
-/// Re-exports from [`kube-runtime`](kube_runtime)
+/// Re-exports from `kube-runtime`
 #[cfg(feature = "runtime")]
 #[cfg_attr(docsrs, doc(cfg(feature = "runtime")))]
 #[doc(inline)]
 pub use kube_runtime as runtime;
 
 pub use crate::core::{CustomResourceExt, Resource, ResourceExt};
-/// Re-exports from [`kube_core`](kube_core)
+/// Re-exports from `kube_core`
 #[doc(inline)]
 pub use kube_core as core;

with this, just doc completes again 🙌

clux added a commit that referenced this issue Mar 1, 2023
See #1150
and rust-lang/rust#108501

Signed-off-by: clux <sszynrae@gmail.com>
@clux clux linked a pull request Mar 1, 2023 that will close this issue
@clux clux closed this as completed in #1155 Mar 1, 2023
clux added a commit that referenced this issue Mar 1, 2023
Bypass nightly docs ICE build

See #1150
and rust-lang/rust#108501

Signed-off-by: clux <sszynrae@gmail.com>
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

Successfully merging a pull request may close this issue.

2 participants