14 Sep 2025 |
Lun | am I doing something silly with testVersion
> Version string '2.0.8' not found!
> The output was:
> syncthing v2.0.8 "Hafnium Hornet" (go1.25.0 linux-amd64) nix@nix 1980-01-01 00:00:00 UTC [noupgrade]
syncthing-internal = testers.testVersion { package = syncthingTest.overrideAttrs {
ldflags = [ "-buildmode=internal" ];
};
};
| 15:15:43 |
emily | my current thinking is that despite the heritage of Plan 9 compilers that are meant to not be confused about cross, upstream is, sadly, confused about cross | 15:15:44 |
emily | you'll make Alyssa sad with that overrideAttrs | 15:16:28 |
emily | not sure about the failure there | 15:16:36 |
Lun | couldn't find anything in-tree using internal | 15:16:48 |
emily | also it's not a buildmode | 15:17:15 |
emily | it's a linkmode | 15:17:22 |
Lun | oops | 15:17:43 |
emily | I think anything with CGO_ENABLED = 0; right? | 15:18:18 |
emily | since it should default | 15:18:21 |
Lun | ah nice | 15:18:36 |
emily | we want to ensure that those things produce PIEs with the right interpreter | 15:18:44 |
emily | I wonder how those would even work with -buildmode=pie | 15:26:51 |
emily | it seems like either way we'd be producing dodgy executables | 15:26:56 |
emily | probably cross conditional vs. not should just be down to whatever upstream wants there | 15:27:14 |
emily | since they don't really have any non-broken interface | 15:27:24 |
emily | the ultimate tragedy of Nixpkgs is that it is less confused about cross than anything else in the world | 15:27:49 |
emily | also this is scary
# OpenBSD static linking requires PIE
| 15:29:40 |
emily | good thing OpenBSD probably doesn't work very much or we might have to figure out static PIE sooner | 15:29:53 |
Lun | Updated the PR, no more GO_EXTLINK_ENABLED and internal linker seems to work now | 15:55:17 |
emily | I'll take a look | 16:54:09 |
emily | btw i wonder why Go doesn't just produce static PIEs when CGO_ENABLED=0 | 16:54:16 |
emily | I guess they just didn't implement it in their internal linker and don't want to use the external one if they don't have to | 16:54:27 |
emily | the change we're doing is sort of "workflow-breaking" in that previously turning off cgo gave you a static binary with no libc dependency | 16:54:39 |
emily | the ideal would be static PIE if they're not linking to anything and otherwise dynamic PIE but | 16:54:51 |
emily | Lun: what kind of binary does a CGO_ENABLED = 0; package get with your PR? and does pkgsStatic produce static non-PIEs for Go stuff now (both CGO_ENABLED = 0; and not)? | 16:55:21 |
emily | we might have to document "if you want a static Go thing use pkgsStatic ") | 16:55:27 |
emily | * we might have to document "if you want a static Go thing use pkgsStatic " | 16:55:28 |
emily | ah you have a test | 16:58:04 |
emily | can we have a pkgsStatic test too? | 16:58:28 |