Open tosiara opened 7 months ago
@tosiara thanks for the detailed report!
Indeed, Nosey Parker's build process is more brittle than those of pure Rust projects. In particular, the Vectorscan dependency is a large C++ codebase that uses CMake for its build. It looks like something in there goes wrong when cross-compiling via cargo
.
It might be a small CMake change to make cross-compiling work. But before investigating that, it would be good to upgrade the Vectorscan dependency to the latest version, which has had a number of CMake-related changes (#79).
In the meantime, natively compiling (not cross-compiling) on both ARM64 and X86_64 should work. Also, cross-compiling a Docker image also works.
See also https://github.com/praetorian-inc/noseyparker/issues/100#issuecomment-1854278243: it may be possible to cross-compile using the cross
tool and/or the RUSTFLAGS="-C target-features=+crt-static"
flag, which statically links the C runtime.
Describe the bug Unable to cross compile for x86_64 on an ARM64 host (docker Apple M2)
To Reproduce
Expected behavior Cross compile process should succeed
Additional context Docker image:
rust:1.71-bullseye
Hardware: Macbook Pro M2