Closed svenrademakers closed 3 years ago
What's the use-case for this?
There's [profile.release] in Cargo.toml that you can use to add debug info or use faster optimization settings.
To give some more context, i need to package debug binaries. Since the actual compilation of the binaries is already done in another step in my CI, im run --no-build for deb packaging. i dont want to recompile my project again.
The issue is that cargo-deb is globbing build-paths in
I could work around it to explicitly, in the Cargo.toml file, declare the files for each target triple. But i have quite some and depending if you pass --target to cargo build, the asset path also changes.
The easiest would be to add a test to see if files exists in
I could indeed configure my rust projects in such a way that my release profile matches my debug profile. But i have reasons not having to alter my projects to accommodate for this
Cargo is a bit messy with its naming. target/debug
is for development only (maps to [profiles.dev]
). It's distinguished not by presence of debug information, but by unsuitability for releasing binaries.
"Debug binary" in Debian sense maps to Cargo's --release
build with [profile.release] debug = true
setting.
I haven't tested, but Cargo documents that you can also use CARGO_PROFILE_release_DEBUG = 1
env var instead of modifying Cargo.toml
.
So I'm going to close this pull request. This limitation in cargo-deb
exists on purpose, specifically to stop users from misusing target/debug
for adding debug information to executables.
--no-build assumes that a package is build in release mode. added a flag that will load binaries/libs from the debug path.
You could explicit set the debug path in the "assets" option to work-around cargo-deb looking in the wrong folder. However this doesnt scale nice, if you have a lot of different compile targets. You would have to create a variant for each output target. Instead, pass a flag, --no-release, to look in the /target/debug output-dir.
Chose this solution over an fallback solution. e.g. when files dont exist in the target/release folder, try target/debug