-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo failed to run custom build command if strip in m1 mac #11641
Comments
Thanks for the detailed report! This is likely similar to #8913. There are a few ways to help diagnose the issue:
|
I checked all related issue, including #8913 The build processes successfully if I remove In other place, I found that this may be a codesign problem.
So, it seems that somthing is mistakely striped. But when I open libc_build_failed in binary of build-script-build libc_build.zip
So that this seems a 1
2
3
4 |
|
Sorry, it seems that this is my enviroment problem. Thanks for your support!
|
I have also run into this problem recently and the error mode is baffling. It was kind of luck that I managed to trace it back to |
the command strip from MacoS conflict with the one installed by brew from package binutils. that recommended |
Strip debuginfo when debuginfo is not requested ### What does this PR try to resolve? This PR implements [this proposal](#4122 (comment)). It contains a detailed description of the change. As a summary, this PR modifies Cargo so that if the user doesn't set `strip` explicitly, and debuginfo is not enabled for any package being compiled, Cargo will implicitly set `strip = "debuginfo"`, to strip pre-existing debuginfo coming from the standard library. This reduces the default size of release binaries considerably (~4.5 MiB => ~450 KiB for helloworld on Linux x64). Perhaps we could only add the `-Cstrip` option for the leaf/root target (i.e., a binary), but cargo already passes `-Cstrip` to libraries if it's set by `[profile.<...>.package.<lib>]`, so it seems harmless. Fixes: #4122 ### How should we test and review this PR? Best reviewed commit by commit. There is one commit that fixes an existing related test that was using wrong assertion. ### Additional information The implementation of the deferred option was inspired by `DebugInfo`, which already uses a similar concept. ### Unresolved questions Should we also do this on macOS by default? It [seems](#11641) that there can be some issues with `strip` there. If it doesn't work, it basically inhibits compilation in release mode, with no easy way to opt out (unless the user explicitly requests debuginfo, but that's not the same as the previous state).
Problem
cargo faild to run custom build command if
command output
Steps
Cargo.toml
main.rs
then just run
cargo build --release
Possible Solution(s)
No response
Notes
Version
The text was updated successfully, but these errors were encountered: