包含调试信息,我的二进制文件大约变为400 MB。发生这种情况是因为Rust包含所有依赖项的调试信息。有什么办法只为我的代码包括调试信息吗?
[package]
name = "app"
version = "0.7.1"
edition = "2018"
[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"
[profile.release]
debug = true
Run Code Online (Sandbox Code Playgroud)
如果您愿意在每晚的工具链中使用不稳定的货物功能,则可以通过货物档案依赖项功能来实现,如下所示:
cargo-features = ["profile-overrides"]
[package]
name = "app"
version = "0.7.1"
edition = "2018"
[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"
[profile.release]
debug = true
// disable debug symbols for all packages except this one
[profile.release.package."*"]
debug = false
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
123 次 |
| 最近记录: |