| 10 Jul 2025 |
jrick | the issue with building static pie executables is that you need the target platform's ld.so and essentially embed it into the final binary | 20:57:05 |
jrick | it works if you have the file and can set the appropriate go flags to link with it | 20:57:45 |
jrick | but makes cross compiling a nightmare | 20:57:49 |
kdn | I'd love to, but the team uses goreleaser to build for few-teen targets including different architectures, containers & operating systems | 20:58:28 |
diamond (it/its) | hm ic | 21:00:36 |
kdn | I just wanted to adjust my local build to whatever they're running so I can make a proper entrypoint | 21:01:08 |
diamond (it/its) | i mean in terms of building containers for usage, whether it's Nix-built or FROM alpine Dockerfile-built doesn't matter too much | 21:02:58 |
diamond (it/its) | i mean the whole point of OCI containers is that it has that level of portability | 21:03:06 |
diamond (it/its) | i was gonna say if this tool is just dragged into the container as a build step then you can definitely have it build an image and use that in Dockerfile i think? | 21:03:40 |
diamond (it/its) | but idrk what you're doing | 21:03:47 |
kdn | I've no clue either how the whole thing is set up, my guess is that the binary artifact is somewhat carried over from previous steps in the CI/GoReleaser | 21:05:55 |
| 11 Jul 2025 |
| @aerunakai:matrix.org removed their profile picture. | 16:40:26 |
| @aerunakai:matrix.org removed their display name aerunakai. | 16:40:31 |
| @aerunakai:matrix.org left the room. | 16:40:39 |
| elitewhale75 joined the room. | 17:39:15 |
| elitewhale75 changed their display name from Vignesh Guruswami to elitewhale75. | 17:39:46 |
| elitewhale75 set a profile picture. | 17:39:56 |
| 12 Jul 2025 |
| plan9better joined the room. | 11:06:12 |
| sleroq left the room. | 14:02:56 |
| 19 Jul 2025 |
| xgwq joined the room. | 18:06:28 |
xgwq | Hi, I currrently try to package a go package that fetches the version from Buildinfo like this
func GetVersion() (ret string) {
if b, ok := debug.ReadBuildInfo(); ok && len(b.Main.Version) > 0 {
ret = b.Main.Version
} else {
ret = "unknown"
}
return
}
Building that with nix gets (devel) as version, how can I set the version to the real package version?
| 18:12:15 |
diamond (it/its) | you could look into fetchgit with preserving .git | 22:14:48 |
diamond (it/its) | https://discourse.nixos.org/t/keep-git-folder-in-when-fetching-a-git-repo/8590 | 22:15:04 |
diamond (it/its) | https://pkg.go.dev/cmd/go -buildvcs=true will also enforce this | 22:21:49 |
diamond (it/its) | which you should have that set | 22:21:52 |
xgwq | This seems to go in the right direction but does not find the tag to get its version from and instead results in v0.0.0-20250719172851-d68c15f4dc17+dirty. | 23:52:25 |
xgwq | Adding preBuild = "git tag v${version}"; adds the right version but still keeps the +dirty. | 23:55:46 |
| 20 Jul 2025 |
diamond (it/its) | fetchTags = true i think | 03:29:11 |
diamond (it/its) | although that dirty seems to be because nix patches the package maybe? | 03:29:19 |
diamond (it/its) | it's doing something w the repo | 03:29:27 |