Is it possible to use separateDebugInfo with crate2nix?
I can't figure out how to use separateDebugInfo.
I guess I would need something like:
{
extraRustcOpts = ["-g"];
separateDebugInfo = true;
}
and I think I would like that enabled for all my dependencies so I tried to add it to Cargo.nix:
in
buildRustCrateForPkgsFunc pkgs
(
crateConfig // {
src = crateConfig.src or (
pkgs.fetchurl rec {
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";
# https://www.pietroalbini.org/blog/downloading-crates-io/
# Not rate-limited, CDN URL.
url = "https://static.crates.io/crates/${crateConfig.crateName}/${crateConfig.crateName}-${crateConfig.version}.crate";
sha256 =
assert (lib.assertMsg (crateConfig ? sha256) "Missing sha256 for ${name}");
crateConfig.sha256;
}
);
extraRustcOpts = ["-g"];
separateDebugInfo = true;
inherit features dependencies buildDependencies crateRenames release;
}
);
but I get:
error: builder for '/nix/store/7vfp7gpmyp6gwsjblccbjvglmhzl3x7b-rust_ahash-0.4.7.drv' failed to produce output path for output 'debug' at '/nix/store/7vfp7gpmyp6gwsjblccbjvglmhzl3x7b-rust_ahash-0.4.7.drv.chroot/nix/store/h1phr8m7pqpx64nhfz9mg7r8zkcq8i9g-rust_ahash-0.4.7-debug'
I'm guessing some crates don't produce symbols or something.
My goal is to send all my symbols to sentry.
- There is a
releaseargument that you can set tofalsebut I doubt it will generate separate debug info. - This feature probably needs support of
buildRustCrateinnixpkgs. https://github.com/NixOS/nixpkgs/tree/master/pkgs/build-support/rust/build-rust-crate
I'm revisiting this.
This feature probably needs support of buildRustCrate in nixpkgs. https://github.com/NixOS/nixpkgs/tree/master/pkgs/build-support/rust/build-rust-crate
Adding separateDebugInfo = true; to Cargo.nix seems to work. I guess this mean that buildRustCrate already support it.
Could we get a new argument to be able to set it :pray:?