facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.42k stars 205 forks source link

Failed to build on Windows #136

Closed stevefan1999-personal closed 1 year ago

stevefan1999-personal commented 1 year ago
   Compiling buck2 v0.1.0 (C:\Users\steve\scoop\persist\rustup\.cargo\git\checkouts\buck2-881d6af740402932\9178ac5\app\buck2)
warning: error finalizing incremental compilation session directory `\\?\C:\Users\steve\AppData\Local\Temp\cargo-installeWlLuT\release\incremental\buck2_build_api-3bpejjqwe8ssu\s-gjx1f497xi-18v2t4g-working`: The system cannot find the file specified. (os error 2)

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:7299 ~ buck2_build_api[daa8]::artifact_groups::calculation::_assert_ensure_artifact_group_future_size::{closure#0}), const_param_did: None }) (after phase change to runtime-optimized) at bb2[1]:
                                Cannot transmute to non-`Sized` type impl futures::Future<Output = std::result::Result<artifact_groups::calculation::EnsureArtifactGroupReady, anyhow::Error>> + '_
   --> app\buck2_build_api\src\artifact_groups\calculation.rs:238:5
    |
238 |     static_assertions::assert_eq_size_ptr!(&v, &e);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at    0: std::backtrace::Backtrace::disabled
               1: std::backtrace::Backtrace::force_capture
               2: <rustc_errors::HandlerInner>::emit_diagnostic
               3: <rustc_const_eval::transform::check_consts::qualifs::CustomEq as rustc_const_eval::transform::check_consts::qualifs::Qualif>::in_qualifs
               4: rustc_const_eval::transform::promote_consts::is_const_fn_in_array_repeat_expression
               5: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               6: <rustc_mir_transform::large_enums::EnumSizeOpt as rustc_middle::mir::MirPass>::is_enabled
               7: <rustc_mir_transform::remove_noop_landing_pads::RemoveNoopLandingPads as rustc_middle::mir::MirPass>::run_pass
               8: <&rustc_index::vec::IndexVec<rustc_middle::mir::Promoted, rustc_middle::mir::Body> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
               9: <rustc_span::def_id::DefId as rustc_serialize::serialize::Encodable<rustc_query_impl::on_disk_cache::CacheEncoder>>::encode
              10: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::as_any
              11: <rustc_metadata::creader::CStore>::from_tcx
              12: rustc_metadata::rmeta::encoder::encode_metadata
              13: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern
              14: rustc_metadata::rmeta::encoder::encode_metadata
              15: rustc_metadata::fs::encode_and_write_metadata
              16: rustc_interface::passes::start_codegen
              17: rustc_interface::proc_macro_decls::provide
              18: <rustc_interface::queries::Queries>::ongoing_codegen
              19: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
              20: rustc_driver_impl::args::arg_expand_all
              21: rustc_driver_impl::main
              22: rustc_driver_impl::args::arg_expand_all
              23: rustc_driver_impl::args::arg_expand_all
              24: std::sys::windows::thread::Thread::new
              25: BaseThreadInitThunk
              26: RtlUserThreadStart

    = note: this error: internal compiler error originates in the macro `static_assertions::assert_eq_size_ptr` (in Nightly builds, run with -Z macro-backtrace for more info)

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.70.0-nightly (23ee2af2f 2023-04-07) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C embed-bitcode=no -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
warning: `buck2_build_api` (lib) generated 1 warning
error: could not compile `buck2_build_api` (lib); 1 warning emitted
error: failed to compile `buck2 v0.1.0 (https://github.com/facebook/buck2.git#9178ac50)`, intermediate artifacts can be found at `C:\Users\steve\AppData\Local\Temp\cargo-installeWlLuT`
stevefan1999-personal commented 1 year ago

Okay so it seems like rustup install nightly-2023-01-24 is somewhat of a hard requirement, I was thinking if I have a recent nightly compiler maybe it would just work as well. Seems like I'm wrong. Close this if you think I'm right, or let's leave it hanging because it doesn't sound too good if we have to specifically select a Rust version

stepancheg commented 1 year ago

This is rust internal compiler error. Nightly compiler is broken sometimes, so we cannot guarantee that code will work with arbitrary nightly version.

stepancheg commented 1 year ago

doesn't sound too good if we have to specifically select a Rust version

When rustup is used, it reads rust-toolchain file and installs appropriate version.

We should do something better when rust is installed without rustup.

stevefan1999-personal commented 1 year ago

Closing this as a non-issue claimed by the contributor

stepancheg commented 1 year ago

(Some discussion internally in D44841691).