Repository navigation
Conversation
This is required to disable optimizations and produce binaries that can
be debugged with delve, e.g.:
pkgs.caddy.overrideAttrs (final: prev: {
# upstream ldflags have "-s" "-w" and we don't want that:
ldflags = [ "-X "github.com/caddyserver/caddy/v2.CustomVersion=${prev.version}" ];
gcflags = [ "all=-N -l" ];
dontStrip = true;
dontFixup = true;
});
7debc63 to
8d22588
Compare
|
I've already rebased the PR but for future reference: CONTRIBUTING.md#rebasing-between-branches-ie-from-master-to-staging |
|
Thank you for doing that @zowoq, sorry I missed the part about mass rebuilds, would love to have your input on #274503#issuecomment-1872322299. |
|
I am not sure to understand why the checks are failing. Is there value for me to run https://github.com/Mic92/nixpkgs-review ? |
|
Could GOFLAGS = [
"-gcflags='all=-N -l'"
];should have the same effect, shouldn't it? On the general matter: I'm a fan of using the Go "-s -w" flags for stripping, but I agree that this shouldn't be done on the package level. Maybe we could move it into the builder, set it by default and remove it when |
|
Hello @katexochen, thanks for the idea, it works though you have to use caddy = pkgs.caddy.overrideAttrs (final: prev: {
# upstream ldflags have "-s" "-w" and we don't want that:
ldflags = [ "-X ${importPath}.CustomVersion=${prev.version}" ];
GOFLAGS = prev.GOFLAGS ++ [ "'-gcflags=all=-N -l'" ];
dontStrip = true;
dontFixup = true;
}); |
|
I would be happy if I saved some (horrible) code to remove the |
|
@lopter can this PR be closed, as it is already covered by |
|
Sure, otoh I am still interested in not setting |
|
I've opened #346380 to discuss the stripping refactoring. |
This is required to disable optimizations and produce binaries that can be debugged with delve, for example:
"-all=-N -l"disables optimization and inlining seego tool compile -help.This is a follow up to #274503.
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.