Does anyone know if there is some reason for that?
Because for the go linker -s and -w respectively are for:
Omit the symbol table and debug information.
Omit the DWARF symbol table.
And my understanding is that fixupPhase is supposed to do that during builds.
This means that dontFixup and dontStrip do not work as expected, which is a poor user experience.
If there is no reasons, I would suggest the idea that we update affected packages and add some check/warning to prevent those linker flags from being passed in. edit: And that we remove those flags from the docs too.
During the package build but after the go build command.
I think this is a general problem in any build system, as we don’t enforce that packages can’t do stripping on their own, so the problem is not just limited to golang.
A warning as in checking via nix code or via shellcode? Via nix code we would first need to remove them from all packages, otherwise ofborg will trip over them. Via shellcode is probably a bit pointless since no one looks at logs if things build fine.
I did a quick comparison on a random go program and seemingly the difference between go strip and our strip is very very tiny
Right, I am just interested in Golang at the moment, this is more of an exercise for myself then anything else.
As a warning in nix code: i.e in there check if args.ldflags have "-s" or "-w" and, if it does, say that stripping is controlled by the fixup phase. Same for …/go/package.nix.
I think that’s fine if we have to remove them first, it will have to be automated anyway, rollout sounds like:
Write Nix code to walk through the package set to get affected packages;
Figure out some sed or awk incantations to fix affected nix files;
Submit those changes;
Add warning;
Repeat the first two steps for stuff that got in while step 3 was in progress.
Wdyt?
Sweet, I didn’t even realize that could yield a different result.
Hello Jörg, as we cross paths, I wanna take the opportunity to thank you for your work: your dotfiles have been super instrumental to my Nix onboarding, as well as sops-nix. What’s being cooked at clan.lol looks pretty interesting too.
Cargo-culting has also been my guess, which is why I want to remove those flags from the docs, and I just opened this PR.