Failed to cross-compile library from Windows to Android - android-ndk

I'm trying to cross-compile a Rust library to 4 Android targets (i386, x86_64, armv7, and aarch64) from Windows.
I have set up Android NDK toolchain for these targets and tried to compile my library with help of this tutorial.
I think I've set up the toolchain correctly, and I'm able to successfully execute aarch64-linux-android-clang in the terminal.
Build log:
cargo build --target aarch64-linux-android --release --verbose
Fresh cc v1.0.28
Fresh autocfg v0.1.1
Fresh version_check v0.1.5
Fresh void v1.0.2
Fresh cfg-if v0.1.6
Fresh rustc-demangle v0.1.13
Fresh byteorder v1.2.7
Fresh either v1.5.0
Fresh ascii v0.9.1
Fresh jni-sys v0.3.0
Fresh cesu8 v1.1.0
Fresh unreachable v1.0.0
Fresh log v0.4.6
Fresh winapi v0.3.6
Compiling backtrace-sys v0.1.28
Fresh libc v0.2.46
Running `C:\Users\My Username\CLionProjects\my_project\target\release\build\backtrace-sys-3bfde344967f80f2\build-script-build`
Fresh winapi-util v0.1.1
Fresh memchr v2.1.2
Fresh same-file v1.0.4
Fresh combine v3.6.6
Fresh walkdir v2.2.7
error: failed to run custom build command for `backtrace-sys v0.1.28`
process didn't exit successfully: `C:\Users\My Username\CLionProjects\my_project\target\release\build\backtrace-sys-3bfde344967f80f2\build-script-build` (exit code: 101)
--- stdout
cargo:rustc-cfg=rbt
TARGET = Some("aarch64-linux-android")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-pc-windows-msvc")
CC_aarch64-linux-android = None
CC_aarch64_linux_android = None
TARGET_CC = None
CC = None
CFLAGS_aarch64-linux-android = None
CFLAGS_aarch64_linux_android = None
TARGET_CFLAGS = None
CFLAGS = None
running: "aarch64-linux-android-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "src/libbacktrace" "-I" "C:\\Users\\My Username\\CLionProjects\\my_project\\target\\aarch64-linux-android\\release\\build\\backtrace-sys-5aff8725b1b77839\\out" "-fvisibility=hidden" "-DBACKTRACE_ELF_SIZE=64" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktrace_close=__rbt_backtrace_close" "-Dbacktrace_open=__rbt_backtrace_open" "-Dbacktrace_print=__rbt_backtrace_print" "-Dbacktrace_simple=__rbt_backtrace_simple" "-Dbacktrace_qsort=__rbt_backtrace_qsort" "-Dbacktrace_create_state=__rbt_backtrace_create_state" "-Dbacktrace_uncompress_zdebug=__rbt_backtrace_uncompress_zdebug" "-o" "C:\\Users\\My Username\\CLionProjects\\my_project\\target\\aarch64-linux-android\\release\\build\\backtrace-sys-5aff8725b1b77839\\out\\src/libbacktrace\\alloc.o" "-c" "src/libbacktrace/alloc.c"
--- stderr
thread 'main' panicked at '
Internal error occurred: Failed to find tool. Is `aarch64-linux-android-clang` installed? (see https://github.com/alexcrichton/cc-rs#compile-time-requirements for help)
', C:\Users\My Username\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.28\src\lib.rs:2314:5
stack backtrace:
0: std::sys::windows::backtrace::set_frames
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\sys\windows\backtrace\mod.rs:104
1: std::sys::windows::backtrace::set_frames
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\sys\windows\backtrace\mod.rs:104
2: std::sys_common::backtrace::_print
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\sys_common\backtrace.rs:71
3: std::sys_common::backtrace::_print
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\sys_common\backtrace.rs:71
4: std::panicking::default_hook::{{closure}}
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:211
5: std::panicking::default_hook
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:227
6: std::panicking::rust_panic_with_hook
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:476
7: std::panicking::continue_panic_fmt
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:390
8: std::panicking::begin_panic_fmt
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:345
9: cc::Tool::to_command
10: cc::Build::compile
11: core::ptr::drop_in_place
12: std::fs::File::create
13: std::rt::lang_start_internal::{{closure}}
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\rt.rs:59
14: std::rt::lang_start_internal::{{closure}}
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\rt.rs:59
15: panic_unwind::__rust_maybe_catch_panic
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libpanic_unwind\lib.rs:102
16: std::panicking::try
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:289
17: std::panicking::try
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:289
18: std::panicking::try
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:289
19: main
20: invoke_main
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
21: invoke_main
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
22: BaseThreadInitThunk
23: RtlUserThreadStart
My .cargo/config file:
[target.aarch64-linux-android]
ar = "C:/NDK/arm64/bin/aarch64-linux-android-ar"
linker = "C:/NDK/arm64/bin/aarch64-linux-android-clang"
[target.armv7-linux-androideabi]
ar = "C:/NDK/arm/bin/arm-linux-androideabi-ar"
linker = "C:/NDK/arm/bin/arm-linux-androideabi-clang"
[target.i686-linux-android]
ar = "C:/NDK/x86/bin/i686-linux-android-ar"
linker = "C:/NDK/x86/bin/i686-linux-android-clang"
[target.x86_64-linux-android]
ar = "C:/NDK/x86_64/bin/x86_64-linux-android-ar"
linker = "C:/NDK/x86_64/bin/x86_64-linux-android-clang"

I have to use .bat instead of .exe file
[target.aarch64-linux-android]
ar = "C:/NDK/arm64/bin/aarch64-linux-android-ar"
linker = "C:/NDK/arm64/bin/aarch64-linux-android-clang.cmd"
also env variables:
SET CC=C:\NDK\arm64\bin\aarch64-linux-android-clang.cmd
SET AR=C:\NDK\arm64\bin\aarch64-linux-android-ar

Related

Difference between debug=1 and debug=2

As I was testing this, I ran a test program with the Cargo setting:
[profile.release]
debug = 1
I got exactly the same stacktrace as if with debug = 2:
$ RUST_BACKTRACE=1 cargo run --release
Finished release [optimized + debuginfo] target(s) in 0.02s
Running `target/release/an`
Error: param not big enough!
Stack backtrace:
0: an::bb
at ./src/main.rs:18:5
an::aa
at ./src/main.rs:13:2
an::main
at ./src/main.rs:6:2
1: core::ops::function::FnOnce::call_once
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/ops/function.rs:227:5
std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/sys_common/backtrace.rs:123:18
2: std::rt::lang_start::{{closure}}
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:145:18
3: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/ops/function.rs:259:13
std::panicking::try::do_call
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:406:40
std::panicking::try
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:370:19
std::panic::catch_unwind
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panic.rs:133:14
std::rt::lang_start_internal::{{closure}}
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:128:48
std::panicking::try::do_call
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:406:40
std::panicking::try
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:370:19
std::panic::catch_unwind
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panic.rs:133:14
std::rt::lang_start_internal
at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:128:20
4: main
5: __libc_start_main
6: _start
Why?
The doc says:
The valid options are:
0 or false: no debug info at all
1: line tables only
2 or true: full debug info
So I expected only line numbers would be present in the stack trace with debug = 1.
(BTW the binary file size with debug = 2 was considerably bigger than with debug = 1, so obviously there is some difference somewhere...)

error: linking with `cc` failed: exit code: 1 while running cargo test --all

Os: macOS Big Sur
I'm facing the following error while running cargo tests while the build is succeeding.
Package: https://github.com/RustPython/RustPython
Command:
cargo test --all
Command cargo build doesn't throw any exception.
Error logs:
Compiling libffi v1.0.1
Compiling rustpython-jit v0.1.2 (/Users/hardikkhandelwal/Projects/rust/RustPython/jit)
Compiling rustpython v0.1.2 (/Users/hardikkhandelwal/Projects/rust/RustPython)
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-arch" "arm64" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.10ibwvzv3e49l775.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1253x86kfkxgqh2w.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.13gd08t800tm784s.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.14p9wnwl9pam5ujl.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.15e17o6bveg5koa6.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.17mujewb6k10id8k.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1a67xs61sj229iqf.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1ci2h9qeeeje0ik6.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1cmzqy3ro43zgsl5.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1dnexk54p6bq143f.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1e31m0nqihdfx5hb.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1e4tavcm7ugscqrd.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1emikuttnt1xip9x.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1eta79f60kanxjws.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1hayr2iv232dnoi6.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1huzgcxsirhwd331.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1jdul1odse6arzjz.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1kp92h8yxzzu0eov.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1m55byjo8aqq49zc.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1plr2gut2q06gwqk.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1r0h19gy6b54q79f.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1s8j2h2qxafcf3x8.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1satlrt2jdoiv4ey.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1vvhoeukrpxmv0pq.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1xe49efr9otpprwn.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.229y1orco2m4dyj8.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.22i642me58xe478c.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.22yxg2lkpcwbwqx.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.23c3y5v0ibs1r2fq.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2478bzefed036zcv.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.24xhig5xkqgjnv7a.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.258jwdtpk3n29ru2.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.262rgc3v6z28qtsq.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.26mjhrskh3ru1tk9.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.276t6e8c7cnzg6wy.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2bpnidflpn331uqr.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2lboqix6b1cjj0jo.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2m2yba3d9v8p6fyv.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2n6eyp1zj3oa1kui.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2ql5hnz2mtbmb7le.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2rjcm2pt9uke0922.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2s1wzpdirnzygv7e.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2tbf8e6r9yt9czf5.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2ttr38fcx39oazo7.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2umn21lmb3qc9nxr.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2uvshfalguw6hxx8.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2w2ghiqspploxf0f.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2w74b23mfhoia8ir.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2wxy1kmtklu8y0w9.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.2x9iwja4h7bf6esl.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.35fuwnpoy3hc2gi7.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.378v5p8yoyjgyfyz.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.391sxamlpl6a96n9.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.39swqzjb6x4tkvcv.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3botv3568qxh3591.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3dhw8zhduh09e6r1.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3flx495gko7kr9f9.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3h4wy8wkv2xrirsf.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3mm2wawuqp97kb7v.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3ofzhlki1cafpfwl.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3pjsd8hbre1ap5qd.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3rwk183rvg7z9yca.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3srtodjtz7bmdola.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3xlrku5wblas6gnr.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3yy87npargho7bsd.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3z5naev9k6lae39q.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3z9gvqp1n32fcpsx.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3zjs7qt7onoigcne.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.3zyfqkyu7djvtze2.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.423bys4dlvrx8mvq.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.426c4cdyhetxwb5w.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.42kzw8c6fadp0tby.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.44bge1cbwp7t2tkx.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.49gtvrz6zpsigsfc.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.49lpjq6zqkjbvmne.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4gi8gsjxezpv3s06.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4gilgzakkbsi3l3e.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4iwdwkt6d9cng8m2.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4jodrvbiqg7w437z.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4kybga5bhkscrs8c.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4lekp20xf8bz0r94.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4m0obk2qh4uzuwsj.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4nlx000cuo8jnqlt.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4ofwdpd0cukslkz0.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4q725i3d0yxgop7v.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4qo1sfh57tihaadg.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4rh1b2hcqpcdq3a3.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4s2ymju7it0okdeb.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4ust4yu9nvanfhdf.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4vfd4l254fl8v4dd.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4xc7hv9qb2t7d616.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4xqxqqk3fs5kqtfz.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4y6jbmqopamez3c.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.4yhh8wqcvrop0hx3.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.54jq72kupaotxmzo.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.56zmipy278cdawgn.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.58zht470tb0hjgt1.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.5dzonsas4ynzribc.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.5g4vw0c8dqjw8h37.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.5gh4c861meudgewi.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.6bjt88zjkzd9tt3.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.7as0apovcqc5gub.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.cae7y3juuwiitl1.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.ifacragtyfrbb42.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.jz4h5hg9g0tz6mi.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.kmvxofl9saiovs2.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.nhc3hxxj09rktbm.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.prm338a1k8u52l1.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.q4rx7xjh7rujfgy.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.rztn7f71t7dz6pf.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.ygusbdg7fggss41.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.ykouej5rwx3lr5s.rcgu.o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5.1jyvo8pa9soqa56a.rcgu.o" "-L" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps" "-L" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/build/libffi-sys-652628ec5b194c33/out/libffi-root/lib" "-L" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/build/libffi-sys-652628ec5b194c33/out/libffi-root/lib64" "-L" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libapprox-30ccea96c4acf95a.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libtest-06ff11d645105e2b.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libterm-f05ecaeca66814e6.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgetopts-6ad0d034fc8e15c7.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunicode_width-c4beacdc35405cb8.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_std-fc0f4647def297a8.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/librustpython_jit-2e831fdd027df713.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblibffi-fd0ec330aa459432.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libabort_on_panic-caaa79ca88d47ba3.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblibffi_sys-5863f41be7d2bccd.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_jit-2c55f3ef4f39d959.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libregion-197ded681c450d8b.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libmach-a93a18ecabd99da0.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liberrno-0a3c0f746fd85f07.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblibc-66d4f3764ade8a61.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_native-08015c03c8f0902a.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_module-0691469284a7b208.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libanyhow-ef3e763f417c2d7a.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift-032d6c244a218970.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_frontend-5ce9f83164bb63c5.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_codegen-7362291990ed24ba.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libregalloc-57353d751727d8ce.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/librustc_hash-ab040f1fd6a07e95.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libsmallvec-99a5132b3a108cbf.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libtarget_lexicon-abfb03971829d1d1.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_codegen_shared-453aa55f38698ce1.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libthiserror-53c05dc94aa30ff9.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblog-3f8f67c165fe661d.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcfg_if-c71a5d33f98d84bb.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_bforest-b2a7cbdbbb4b7b2e.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libcranelift_entity-5d71031a19adbb58.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/librustpython_bytecode-44e562fca4e24da9.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libbincode-7a343aa511b2a28b.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblz4_flex-99575d661e0f318f.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libnum_complex-fde276a77140cb97.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libnum_bigint-a611dddfa4c568f4.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libnum_integer-7f325eb6a21e8c2e.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libnum_traits-4df9bc95fb47d436.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libitertools-886b111642563542.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libeither-3e64107fd8334906.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libbstr-c7fc013625c0f979.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblazy_static-d1f48f17eb43777c.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libregex_automata-21a890d37c6a8dcc.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libserde-2ae11beb1fcdc4df.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libmemchr-53a80abe7ced0f1a.rlib" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/libbitflags-9f56f92ce6089ce7.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-000cdec9267bfd7b.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-2669f3cbce8358f4.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-86461a1c60728ccb.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-f17574752cb5ddba.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-3bb606c936cc0d28.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-8139a4b0cda20184.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-ea0823eca3e9abf9.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-4f19e1259f6028e7.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-435daca85b8e10b5.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-d73085abefd284c6.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-e6a09ca0044b34e5.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e07333f48f53c71e.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-2a49b0d9fbc7a459.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-b66dda66aafe36c9.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-34d0b58da984bf31.rlib" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-01275baa20724171.rlib" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/hardikkhandelwal/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/integration-59c3340cf4710de5" "-Wl,-dead_strip" "-nodefaultlibs"
= note: ld: warning: directory not found for option '-L/Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/build/libffi-sys-652628ec5b194c33/out/libffi-root/lib64'
ld: in /Users/hardikkhandelwal/Projects/rust/RustPython/target/debug/deps/liblibffi_sys-5863f41be7d2bccd.rlib(closures.o), archive member 'closures.o' with length 17440 is not mach-o or llvm bitcode for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `rustpython-jit`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Static Linking Cursive/ncurses in Rust

I am trying to create a statically linked executable for a rust project that uses Cursive (with ncurses as backend). I installed the libraries for ncurses-devel, ncurses-static, ncurses-lib as well as did
rustup target add x86_64-unknown-linux-musl
When I try to compile the project using:
RUSTFLAGS='-C link-arg=-s' cargo build --release --target x86_64-unknown-linux-musl
cargo fails with the error:
error: failed to run custom build command for `ncurses v5.101.0`
Caused by:
process didn't exit successfully: `/vagrant_data/rust-cli-example/target/release/build/ncurses-9d002170cebb3401/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=NCURSESW5_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=NCURSESW_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-musl
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_musl
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rustc-link-lib=ncursesw
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-musl")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-musl = None
CC_x86_64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-unknown-linux-musl = None
CFLAGS_x86_64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
--- stderr
/vagrant_data/rust-cli-example/target/x86_64-unknown-linux-musl/release/build/ncurses-7d3468c31a087559/out/chtype_size.c:6:10: fatal error: ncurses.h: No such file or directory
6 | #include <ncurses.h>
| ^~~~~~~~~~~
compilation terminated.
thread 'main' panicked at 'assertion failed: command.status().expect(\"compilation failed\").success()', /home/vagrant/.cargo/registry/src/github.com-1ecc6299db9ec823/ncurses-5.101.0/build.rs:105:5
Can someone please guide me in what needs to be done to get this to compile?

Failed building the Rust documentation: The system cannot find the path specified

I'm on Windows, trying to build the Rust documentation.
I cloned the Rust repository, copied the config.toml.example under the name config.toml and executed ./x.py doc but here is the error I get (with the RUST_BACKTRACE environment variable set to full):
~\source\repos\rust [master ≡]> ./x.py doc
~\source\repos\rust [master ≡]> Updating only changed submodules
Submodules updated in 0.08 seconds
Finished dev [unoptimized + debuginfo] target(s) in 0.41s
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with The system cannot find the path specified. (os error 3)', src\bootstrap\doc.rs:243:21
stack backtrace:
0: 0x7ff7a88e481f - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
1: 0x7ff7a88e481f - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ff7a88e481f - std::sys_common::backtrace::_print_fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:67
3: 0x7ff7a88e481f - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:46
4: 0x7ff7a89029da - core::fmt::write
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\core\src\fmt\mod.rs:1110
5: 0x7ff7a88df148 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\io\mod.rs:1588
6: 0x7ff7a88e8356 - std::sys_common::backtrace::_print
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:49
7: 0x7ff7a88e8356 - std::sys_common::backtrace::print
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:36
8: 0x7ff7a88e8356 - std::panicking::default_hook::{{closure}}
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:208
9: 0x7ff7a88e7e39 - std::panicking::default_hook
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:225
10: 0x7ff7a88e89b5 - std::panicking::rust_panic_with_hook
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:622
11: 0x7ff7a88e85a1 - std::panicking::begin_panic_handler::{{closure}}
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:519
12: 0x7ff7a88e513f - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:141
13: 0x7ff7a88e84f9 - std::panicking::begin_panic_handler
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:515
14: 0x7ff7a890ad7c - std::panicking::begin_panic_fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:457
15: 0x7ff7a8166b14 - bootstrap::doc::{{impl}}::run
at C:\Users\jerome\source\repos\rust\src\bootstrap\doc.rs:243
16: 0x7ff7a8349024 - bootstrap::builder::Builder::ensure<bootstrap::doc::TheBook>
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:1563
17: 0x7ff7a81661a0 - bootstrap::doc::{{impl}}::make_run
at C:\Users\jerome\source\repos\rust\src\bootstrap\doc.rs:200
18: 0x7ff7a80eff44 - bootstrap::builder::StepDescription::maybe_run
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:181
19: 0x7ff7a80f0402 - bootstrap::builder::StepDescription::run
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:202
20: 0x7ff7a80f42b9 - bootstrap::builder::Builder::run_step_descriptions
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:610
21: 0x7ff7a80f3f7d - bootstrap::builder::Builder::execute_cli
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:590
22: 0x7ff7a7f25950 - bootstrap::Build::build
at C:\Users\jerome\source\repos\rust\src\bootstrap\lib.rs:620
23: 0x7ff7a7f11773 - bootstrap::main
at C:\Users\jerome\source\repos\rust\src\bootstrap\bin\main.rs:33
24: 0x7ff7a7f127eb - core::ops::function::FnOnce::call_once<fn(),tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\core\src\ops\function.rs:227
25: 0x7ff7a7f126db - std::sys_common::backtrace::__rust_begin_short_backtrace<fn(),tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\sys_common\backtrace.rs:125
26: 0x7ff7a7f11101 - std::rt::lang_start::{{closure}}<tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\rt.rs:49
27: 0x7ff7a88e8f0a - core::ops::function::impls::{{impl}}::call_once
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\core\src\ops\function.rs:280
28: 0x7ff7a88e8f0a - std::panicking::try::do_call
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:401
29: 0x7ff7a88e8f0a - std::panicking::try
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:365
30: 0x7ff7a88e8f0a - std::panic::catch_unwind
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panic.rs:434
31: 0x7ff7a88e8f0a - std::rt::lang_start_internal
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\rt.rs:34
32: 0x7ff7a7f110df - std::rt::lang_start<tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\rt.rs:48
33: 0x7ff7a7f11d66 - main
34: 0x7ff7a8909ac4 - invoke_main
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
35: 0x7ff7a8909ac4 - __scrt_common_main_seh
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
36: 0x7fff5ee37034 - BaseThreadInitThunk
37: 0x7fff5f302651 - RtlUserThreadStart
Build completed unsuccessfully in 0:00:02
I tried under Ubuntu with WSL but I get the same error.
I tried Googling this error but found nothing and the Rust Readme is saying nothing special except the command I ran
Could you please tell me what am I missing and how to build the documentation?
I'd like to end up with Markdown files so I can read the book on my phone while being offline.
Thanks for your answer
I checked the remote branches and saw a stable branch which I checked out.
I tried running again the command ./x.py doc and this time it worked well.
I saw they don't have any develop branch and all the Pull Requests on Github have the master as target branch. So it seems their master branch is what I usually call the develop branch at my work.
As of today the master branch seems a bit broken since building the documentation doesn't work but using the stable branch worked like a charm.

Unable to compile Actix on macOS Mojave due to "ar crs" "malformed object (unknown load command 1)"

I'm unable to compile a basic example using Actix. I suspect I might be missing some libraries but I have no clue of what it could be. I also upgraded to Mojave a few days ago, but I'm not sure if this is related.
It seems to complain about ar crs and about an internal error happening in ranlib when running this command.
main.rs:
extern crate actix_web;
use actix_web::{server, App, HttpRequest};
fn index(_req: &HttpRequest) -> &'static str {
"Hello world!"
}
fn main() {
server::new(|| App::new().resource("/", |r| r.f(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run();
}
Cargo.toml:
actix-web = "0.7.8"
Backtrace I obtain:
mbp-de-matthieu:hello-world matthieu$ RUST_BACKTRACE=1 cargo build
Compiling backtrace-sys v0.1.24
Compiling miniz-sys v0.1.10
Compiling brotli-sys v0.3.2
Compiling ring v0.13.2
Compiling tokio-current-thread v0.1.3
error: failed to run custom build command for `miniz-sys v0.1.10`
process didn't exit successfully: `/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-dc81523acb01e9e7/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/miniz.o" "-c" "miniz.c"
exit code: 0
AR_x86_64-apple-darwin = None
AR_x86_64_apple_darwin = None
HOST_AR = None
AR = None
running: "ar" "crs" "/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/libminiz.a" "/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/miniz.o"
cargo:warning=/usr/local/Cellar/cctools/855/bin/ranlib: object: /Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/libminiz.a(miniz.o) malformed object (unknown load command 1)
cargo:warning=ar: internal ranlib command failed
exit code: 1
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "ar" "crs" "/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/libminiz.a" "/Users/matthieu/Documents/Rust/actix/hello-world/target/debug/build/miniz-sys-d59b36acd5b3db67/out/miniz.o" with args "ar" did not execute successfully (status code exit code: 1).
The complete backtrace is too large to include on Stack Overflow.
It seems to work after installing cctools through MacPorts.
For some reason, installing it through brew didn't seem to work.
I had the same error.
When I replaced cctools 855 with 921 from this tap then cargo build worked: https://github.com/dgsga/homebrew-cctools
brew unlink cctools
brew tap dgsga/cctools
brew install dgsga/cctools/mtoc
Mojave 10.14.3, Rust 1.33.0, actix-web 0.7.18

Resources