rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.65k stars 12.75k forks source link

docs.rs fails to build docs for a crate due to internal compiler error #119137

Closed JSorngard closed 11 months ago

JSorngard commented 11 months ago

This ICE caused docs.rs to fail to build docs for the crate zalgo-codec. I am unfortunately not able to reproduce this bug as cargo doc --all-features runs without issue on all local machines I have tested it on in both stable and nightly, but the docs.rs build log can be found here: https://docs.rs/crate/zalgo-codec/0.9.6/builds/1066812. This means that I am unfortunately not able to provide a lot of the information needed in the template, but will do my best.

Code

The error seems to have occurred due to something to do with wayland when compiling gdk-pixbuf-sys v0.18.0, which is a dependency of gtk-sys v0.18.0 which is a dependency of the crate rfd v0.12.1 when compiled on linux. zalgo-codec depends on rfd when its binary and/or gui features are enabled.

Meta

The build log starts with:

# rustc version
rustc 1.76.0-nightly (3f28fe133 2023-12-18)
# docs.rs version
docsrs 0.6.0 (7ef5327a 2023-12-17)

Error output

The ICE part of the build log is pasted below with 8 previous lines of context:

[INFO] [stderr]     Checking tiny-skia v0.10.0
[INFO] [stderr]     Checking guillotiere v0.6.2
[INFO] [stderr]    Compiling glib-sys v0.18.1
[INFO] [stderr]    Compiling gobject-sys v0.18.0
[INFO] [stderr]    Compiling gdk-sys v0.18.0
[INFO] [stderr]    Compiling atk-sys v0.18.0
[INFO] [stderr]    Compiling gio-sys v0.18.1
[INFO] [stderr]    Compiling gdk-pixbuf-sys v0.18.0
[INFO] [stderr] error: internal compiler error: no errors encountered even though `span_delayed_bug` issued
[INFO] [stderr] 
[INFO] [stderr] error: internal compiler error: Trying to feed an already recorded value for query visibility key=DefId(0:6977 ~ wayland_protocols[e376]::unstable::xdg_decoration::v1::generated::client::{use#18}):
[INFO] [stderr]                                 old value: Restricted(DefId(0:0 ~ wayland_protocols[e376]))
[INFO] [stderr]                                 new value: Restricted(DefId(0:6958 ~ wayland_protocols[e376]::unstable::xdg_decoration::v1::generated::client))
[INFO] [stderr]   |
[INFO] [stderr]   = note: delayed at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/compiler/rustc_middle/src/query/mod.rs:2206:1
[INFO] [stderr]              0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
[INFO] [stderr]              1: <rustc_errors::DiagCtxtInner>::emit_diagnostic
[INFO] [stderr]              2: <rustc_session::session::Session>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
[INFO] [stderr]              3: <rustc_resolve::Resolver>::feed_visibility
[INFO] [stderr]              4: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>::build_reduced_graph_for_use_tree
[INFO] [stderr]              5: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>::build_reduced_graph_for_use_tree
[INFO] [stderr]              6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]              7: rustc_ast::visit::walk_item::<rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>
[INFO] [stderr]              8: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]              9: rustc_ast::visit::walk_item::<rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>
[INFO] [stderr]             10: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]             11: <rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::visit_ast_fragment_with_placeholders
[INFO] [stderr]             12: <rustc_expand::expand::MacroExpander>::collect_invocations
[INFO] [stderr]             13: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
[INFO] [stderr]             14: <rustc_expand::expand::MacroExpander>::expand_crate
[INFO] [stderr]             15: rustc_interface::passes::resolver_for_lowering
[INFO] [stderr]             16: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
[INFO] [stderr]             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
[INFO] [stderr]             18: rustc_query_impl::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stderr]             19: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
[INFO] [stderr]             20: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
[INFO] [stderr]             21: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stderr]             22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/alloc/src/boxed.rs:2015:9
[INFO] [stderr]             23: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/alloc/src/boxed.rs:2015:9
[INFO] [stderr]             24: std::sys::unix::thread::Thread::new::thread_start
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/sys/unix/thread.rs:108:17
[INFO] [stderr]             25: <unknown>
[INFO] [stderr]             26: __clone
[INFO] [stderr]           
[INFO] [stderr] 
[INFO] [stderr] error: internal compiler error: Trying to feed an already recorded value for query visibility key=DefId(0:12939 ~ wayland_protocols[e376]::wlr::unstable::input_inhibitor::v1::generated::client::{use#18}):
[INFO] [stderr]                                 old value: Restricted(DefId(0:0 ~ wayland_protocols[e376]))
[INFO] [stderr]                                 new value: Restricted(DefId(0:12920 ~ wayland_protocols[e376]::wlr::unstable::input_inhibitor::v1::generated::client))
[INFO] [stderr]   |
[INFO] [stderr]   = note: delayed at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/compiler/rustc_middle/src/query/mod.rs:2206:1
[INFO] [stderr]              0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
[INFO] [stderr]              1: <rustc_errors::DiagCtxtInner>::emit_diagnostic
[INFO] [stderr]              2: <rustc_session::session::Session>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
[INFO] [stderr]              3: <rustc_resolve::Resolver>::feed_visibility
[INFO] [stderr]              4: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>::build_reduced_graph_for_use_tree
[INFO] [stderr]              5: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>::build_reduced_graph_for_use_tree
[INFO] [stderr]              6: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]              7: rustc_ast::visit::walk_item::<rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>
[INFO] [stderr]              8: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]              9: rustc_ast::visit::walk_item::<rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor>
[INFO] [stderr]             10: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
[INFO] [stderr]             11: <rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::visit_ast_fragment_with_placeholders
[INFO] [stderr]             12: <rustc_expand::expand::MacroExpander>::collect_invocations
[INFO] [stderr]             13: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
[INFO] [stderr]             14: <rustc_expand::expand::MacroExpander>::expand_crate
[INFO] [stderr]             15: rustc_interface::passes::resolver_for_lowering
[INFO] [stderr]             16: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
[INFO] [stderr]             17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
[INFO] [stderr]             18: rustc_query_impl::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stderr]             19: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
[INFO] [stderr]             20: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
[INFO] [stderr]             21: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stderr]             22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/alloc/src/boxed.rs:2015:9
[INFO] [stderr]             23: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/alloc/src/boxed.rs:2015:9
[INFO] [stderr]             24: std::sys::unix::thread::Thread::new::thread_start
[INFO] [stderr]                        at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/sys/unix/thread.rs:108:17
[INFO] [stderr]             25: <unknown>
[INFO] [stderr]             26: __clone
[INFO] [stderr]           
[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
[INFO] [stderr] 
[INFO] [stderr] warning: the ICE couldn't be written to `/opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/wayland-protocols-0.29.5/rustc-ice-2023-12-19T16_57_17-11.txt`: Read-only file system (os error 30)
[INFO] [stderr] 
[INFO] [stderr] note: rustc 1.76.0-nightly (3f28fe133 2023-12-18) running on x86_64-unknown-linux-gnu
[INFO] [stderr] 
[INFO] [stderr] note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
[INFO] [stderr] 
[INFO] [stderr] note: some of the compiler flags provided by cargo are hidden
[INFO] [stderr] 
[INFO] [stderr] query stack during panic:
[INFO] [stderr] end of query stack
[INFO] [stderr] error: could not compile `wayland-protocols` (lib)
[INFO] [stderr] warning: build failed, waiting for other jobs to finish...

I am unfortunately unable to provide a backtrace as I can not modify the docs.rs environment or rerun things manually, but I have posted this also as an issue for docs.rs (https://github.com/rust-lang/docs.rs/issues/2367) in case someone there is able to rerun with a backtrace.

saethlin commented 11 months ago

Duplicate of https://github.com/rust-lang/rust/issues/119126