!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

235 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.48 Servers

Load older messages


SenderMessageTime
16 Dec 2025
@azahi:azahi.cc@azahi:azahi.cc joined the room.22:03:26
19 Dec 2025
@frederic:scs.ems.hostFrédéric Christ 🌴 29.04.-13.05. changed their display name from Frédéric Christ to Frédéric Christ (back on 02.01.).15:15:21
23 Dec 2025
@sudoforge:matrix.orgsudoforge joined the room.22:42:06
@sudoforge:matrix.orgsudoforge there seems to be a significant lack of documentation for cross-compiling for platform targets that are not the builder host using buildGoModule. i know that pkgsCross is probably the recommended approach, but there isn't a 1:1 mapping of supported cross-compilation targets in nixpkgs to golang's supported targets. assuming i want to build for every target that golang supports, does anybody have examples for how to cross-compile using buildGoModule, without assuming that pkgsCross can be used? 23:48:52
24 Dec 2025
@sudoforge:matrix.orgsudoforge *

there seems to be a significant lack of documentation for cross-compiling for platform targets that are not the builder host using buildGoModule. i know that pkgsCross is probably the recommended approach, but there isn't a 1:1 mapping of supported cross-compilation targets in nixpkgs to golang's supported targets. assuming i want to build for every target that golang supports, does anybody have examples for how to cross-compile using buildGoModule, without assuming that pkgsCross can be used?

i should note that setting env.{GOOS, GOARCH} isn't sufficient, and this is the only other approach i've seen talked about on the forums.

00:10:38
@sudoforge:matrix.orgsudoforge *

there seems to be a significant lack of documentation for cross-compiling for platform targets that are not the builder host using buildGoModule. i know that pkgsCross is probably the recommended approach, but there isn't a 1:1 mapping of supported cross-compilation targets in nixpkgs to golang's supported targets. assuming i want to build for every target that golang supports, does anybody have examples for how to cross-compile using buildGoModule, without assuming that pkgsCross can be used?

i should note that setting env.{GOOS, GOARCH} isn't sufficient, and this is the only other approach i've seen talked about on the forums (from posts that are 3+ years old).

00:10:53
@genadij.udarov:matrix.orggenadij.udarovWhy isnt setting these env vars sufficient? I was going to suggest that. 🫣CGO_ENABLED=0 might be missing? I don't recall if go supports cross-compiling cgo.08:05:49
@genadij.udarov:matrix.orggenadij.udarov * 08:06:42
@faust403:matrix.orgVladislav Vasilev changed their display name from Vladislav Vasilev to vfaust403.16:44:32
@faust403:matrix.orgVladislav Vasilev changed their profile picture.16:44:46
@faust403:matrix.orgVladislav Vasilev left the room.16:45:11
@amadaluzia:unredacted.orgamadaluzia changed their profile picture.16:52:55
26 Dec 2025
@isabel:isabelroses.comisabel changed their profile picture.11:38:03
27 Dec 2025
@pinpox:matrix.orgpinpox changed their display name from pinpox to pinpox [DECT: 7479].12:01:48
28 Dec 2025
@azahi:azahi.cc@azahi:azahi.cc left the room.23:09:57
30 Dec 2025
@k900:0upti.meK900
nixpkgs staging-next
❯ nix-build -A carapace
these 2 derivations will be built:
  /nix/store/xas6d0aw2x3vsmchldlhlg0s9hz2vfrg-carapace-1.5.7-go-modules.drv
  /nix/store/hglsssrqmdxfhbnpxgmg166w6vdb9whf-carapace-1.5.7.drv
building '/nix/store/xas6d0aw2x3vsmchldlhlg0s9hz2vfrg-carapace-1.5.7-go-modules.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/39b3cp4s5darpq60n4nspsiz02ldwcnw-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
Running phase: buildPhase
go: inconsistent vendoring in /build/source:
        github.com/carapace-sh/carapace@v1.10.3: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/carapace-sh/carapace-bridge@v1.4.10: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/carapace-sh/carapace-selfupdate@v0.0.10: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/carapace-sh/carapace-shlex@v1.1.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/carapace-sh/carapace-spec@v1.4.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/pelletier/go-toml@v1.9.5: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/spf13/cobra@v1.9.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/spf13/pflag@v1.0.9: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        golang.org/x/mod@v0.27.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        gopkg.in/ini.v1@v1.67.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        gopkg.in/yaml.v3@v3.0.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/inconshreveable/mousetrap@v1.1.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/kevinburke/ssh_config@v1.4.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/stretchr/testify@v1.8.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/spf13/pflag: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/kevinburke/ssh_config: is replaced in go.mod, but not marked as replaced in vendor/modules.txt

        To ignore the vendor directory, use -mod=readonly or -mod=mod.
        To sync the vendor directory, run:
                go mod vendor
08:18:12
@k900:0upti.meK900Can someone explain this08:18:16
@k900:0upti.meK900Does this mean Go FOD hashes changed with the Go update on staging-next08:19:39
@k900:0upti.meK900OK never mind it's also broken on master, reverting11:30:36
@antifuchs:asf.computerantifuchsI had a similar issue on unstable recently, but it resolved itself for some reason? Didn’t dig, but it looked pretty similar11:54:09
1 Jan 2026
@amadaluzia:unredacted.orgamadaluzia changed their display name from amadaluzia to amadaluzia (happy new year!).00:17:11
@pinpox:matrix.orgpinpox changed their display name from pinpox [DECT: 7479] to pinpox.00:27:02
2 Jan 2026
@amadaluzia:unredacted.orgamadaluzia changed their display name from amadaluzia (happy new year!) to amadaluzia.04:47:02
5 Jan 2026
@goodtab:matrix.orggoodtab joined the room.08:22:33
@frederic:scs.ems.hostFrédéric Christ 🌴 29.04.-13.05. changed their display name from Frédéric Christ (back on 02.01.) to Frédéric Christ.11:53:16
6 Jan 2026
@sudoforge:matrix.orgsudoforge

i didn't have a lot of time to debug it, but will be re-tackling this in the coming days. from what i recall seeing, the buildGoModule was overwriting GOOS and GOARCH, and i couldn't set them using an override.

sorry this isn't too informative, i should have more info tomorrow :)

19:39:43
@sudoforge:matrix.orgsudoforge *

i didn't have a lot of time to debug it, but will be re-tackling this in the coming days. from what i recall seeing, buildGoModule was overwriting GOOS and GOARCH, and i couldn't set them using an override.

sorry this isn't too informative, i should have more info tomorrow :)

19:40:02
10 Jan 2026
@eihqnh:mozilla.orgeihqnh joined the room.04:58:40
@eihqnh:mozilla.orgeihqnh set a profile picture.05:04:37
11 Jan 2026
@ivank:matrix.orgivan joined the room.01:46:11

Show newer messages


Back to Room ListRoom Version: 9