Open cskeeters opened 2 months ago
Is your Rust toolchain up to date? How did you install it?
You can try commenting out the lto = true
line in Cargo.toml
, but that should not be needed.
I can't help you much more because I am on Linux, and I get a very different error when cross compiling.
I was running rust 1.75.0.
I tried using brew install rust
and then rustup via:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Both installed the latest rust tools (1.78.0) and resulted in the same errors. This appears to be a problem with rust on M1 processors.
I tried Terminal.app and arch -arm64e sh
too and still got the same SIGKILL error.
Commenting out lto = true
had no effect. Commenting out strip = true
had no effect.
What's weird is that the error only occurs in release mode.
You can try overriding each option that is specific to the release profile, until you find the one that causes the error.
My testing shows that debug
must be true
. Also if I change strip
from "none"
(default) to true
(as set by this project's Cargo.toml) it also fails.
@cskeeters I just stumbled upon this issue since I was having a similar problem in another Rust project (thin-edge.io)...so just posting in case it is also helpful for you.
In the end my issue was with the homebrew binutils
package, see the original issue in the rust project which goes into some more details.
To fix it, check which strip
is used by default on your console:
which strip
If you get anything other than /usr/bin/strip
, then you will need to check your PATH
environment variable (maybe remove the binutils
path from it if you did something similar to me).
Afterwards you will have to run cargo clean
, then you should be able to build again.
cargo clean
cargo build --release
@reubenmiller, Thank you for this post. I can confirm that my path was configured to use strip
from binutils. Without this path element, cargo build --release
works fine.
That begs the question: What's going on? Why does gnu strip from binutils break cargo? Is this a bug or incompatibility? If it's a compatibility issue, could cargo not check strip
's version for compatibility before utilization? If it's a bug has a bug been filed? I didn't see one on their bug tracker.
When I use the
--release
flag, I get errors.Without the
--release
flag, it compiles fine.To get more information, I tried the
--verbose
flag and not much more helpful info was provided.I'm new to rust, so this might be a simple skill issue on my part. Please advise.