Skip to content

Panic when cross-compiling with cargo-zigbuild for x86_64-pc-windows-gnu #364

@tahadostifam

Description

@tahadostifam

Description

When attempting to cross-compile using cargo-zigbuild with nightly Rust, the build panics inside cargo-zigbuild with an out-of-range slice access.

Reproduction:

RUST_BACKTRACE=full cargo zigbuild -v --target x86_64-pc-windows-gnu -Zbuild-std

Stack trace:

thread 'main' panicked at 'range start index 18446744073709551614 out of range for slice of length 2', /home/taha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:2836:36
stack backtrace:
   0: std::sys::backtrace::BacktraceLock::print
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::sys::backtrace::BacktraceLock::print
   4: std::panicking::default_hook
   5: std::panicking::default_hook
   6: std::panicking::panic_with_hook
   7: std::panicking::panic_handler
   8: std::sys::backtrace::__rust_end_short_backtrace
   9: rust_begin_unwind
  10: core::panicking::panic_fmt
  11: core::slice::index::slice_index_fail
  12: core::slice::index::slice_index_fail
  13: cargo_zigbuild::zig::Zig::apply_command_env
  14: cargo_zigbuild::build::Build::build_command
  15: cargo_zigbuild::build::Build::execute
  16: cargo_zigbuild::main
  17: std::sys::backtrace::__rust_begin_short_backtrace
  18: std::rt::lang_start
  19: std::rt::lang_start_internal
  20: main
  21: __libc_start_call_main
  22: __libc_start_main_alias_2
  23: _start

Environment:

OS: Linux x86_64
Rust: nightly-x86_64-unknown-linux-gnu (rustup)
cargo-zigbuild: latest
Target: x86_64-pc-windows-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions