!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

153 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.41 Servers

Load older messages


SenderMessageTime
25 Aug 2024
@r_i_s:matrix.orgris_awesome. yeah it looks like it's always going to be a tricky one to introduce12:57:28
26 Aug 2024
@qbit:tapenet.orgqbit is there A Way™ to fetch the vendorHash without running nix build? 14:38:46
@diamondburned:matrix.orgDiamond (it/she) you can use gomod2nix or do what Tailscale did with their nardump 14:56:19
27 Aug 2024
@katexochen:matrix.orgPaul Meyer (katexochen)
In reply to @qbit:tapenet.org
is there A Way™ to fetch the vendorHash without running nix build?
Given proxyVendor = false you can clone the repo, run go mod vendor and nix hash path vendor/
06:18:38
@qbit:tapenet.orgqbitMm, thanks, I could make that work I think10:25:25
@oliver.falvai:oliverfalvai.xyzoliver.falvai joined the room.10:52:02
@mat:matrix.matmoa.xyzmat joined the room.13:24:08
28 Aug 2024
@sem:one.ems.hostsem joined the room.10:18:17
29 Aug 2024
@artur:glasgow.social(artur 'manuel) joined the room.05:51:15
@cleverca22:matrix.orgcleverca22 joined the room.05:56:32
@cleverca22:matrix.orgcleverca22 has anybody had to deal with the new blst package in go? its causing build failures for me when i try to update blockbook 15:48:21
@cleverca22:matrix.orgcleverca22
[root@amd-nixos:~]# ls -ltrh /tmp/nix-build-blockbook-0.4.0.drv-0/source/vendor/github.com/supranational/
total 512
dr-xr-xr-x 3 nixbld1 nixbld 4 Aug 29 13:21 blst

[root@amd-nixos:~]# ls -ltrh /tmp/nix-build-blockbook-0.4.0.drv-0/source/vendor/github.com/supranational/blst/
total 5.0K
-r--r--r-- 1 nixbld1 nixbld 12K Aug 29 13:21 LICENSE
dr-xr-xr-x 3 nixbld1 nixbld   3 Aug 29 13:21 bindings

[root@amd-nixos:~]# ls -ltrh /tmp/nix-build-blockbook-0.4.0.drv-0/source/vendor/github.com/supranational/blst/bindings/
total 8.5K
dr-xr-xr-x 2 nixbld1 nixbld 12 Aug 29 13:21 go

[root@amd-nixos:~]# ls -ltrh /tmp/nix-build-blockbook-0.4.0.drv-0/source/vendor/github.com/supranational/blst/bindings/go/
total 57K
-r--r--r-- 1 nixbld1 nixbld 2.8K Aug 29 13:21 README.md
-r--r--r-- 1 nixbld1 nixbld 3.3K Aug 29 13:21 rb_tree.go
-r--r--r-- 1 nixbld1 nixbld 3.6K Aug 29 13:21 generate.py
-r--r--r-- 1 nixbld1 nixbld   20 Aug 29 13:21 cgo_server.c
-r--r--r-- 1 nixbld1 nixbld   22 Aug 29 13:21 cgo_assembly.S
-r--r--r-- 1 nixbld1 nixbld  14K Aug 29 13:21 blst.tgo
-r--r--r-- 1 nixbld1 nixbld  19K Aug 29 13:21 blst_px.tgo
-r--r--r-- 1 nixbld1 nixbld 7.2K Aug 29 13:21 blst_misc.tgo
-r--r--r-- 1 nixbld1 nixbld  18K Aug 29 13:21 blst_minpk.tgo
-r--r--r-- 1 nixbld1 nixbld  77K Aug 29 13:21 blst.go
16:33:41
@cleverca22:matrix.orgcleverca22 it looks like go mod vendor is deleting 90% of the source for blst 16:33:56
@cleverca22:matrix.orgcleverca22 and the answer was in module.nix the whole time:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/go/module.nix#L27-L31
16:47:51
@cleverca22:matrix.orgcleverca22https://github.com/NixOS/nixpkgs/pull/338233 and PR is ready!17:27:49
30 Aug 2024
@artur:glasgow.social(artur 'manuel) changed their display name from Artur Manuel (old email was lost, migrating) to (lambda (u) (format nil "~A lost their email!" u)) "Artur Manuel".03:53:11
1 Sep 2024
@niklaskorz:korz.devNiklas Korz joined the room.18:29:20
3 Sep 2024
@nazarewk:matrix.orgnazarewk joined the room.21:23:09
@nazarewk:matrix.orgnazarewk

How can I build a statically linked (portable) Go program on amd64 for armv6 architecture using Nix?

  • this doesn't work https://github.com/nazarewk-iac/nix-configs/commit/454b1cbd6729d1c6183b4e1b1cadbf4343797ba9
  • running GOARM=6 GOARCH=arm CGO_ENABLED=0 go build -o netbird ./client inside source repo seems to work fine
21:26:19
@jrick:zettaport.comjrickare you using pkgsStatic?21:29:37
@jrick:zettaport.comjrickwhat is it still linking to?21:30:34
@jrick:zettaport.comjrickoh it's a cross compile, yeah i haven't figured that out yet21:31:16
@nazarewk:matrix.orgnazarewkI just want to "quickly" compile patched versions while debugging, it's quite tedious to manually patch the source repo each time21:32:18
@nazarewk:matrix.orgnazarewkI'm going to sleep now, building it non-nix way using https://github.com/nazarewk-iac/nix-configs/commit/b716351243bca4a0a57a38f34a8d939d86984bce21:53:38
@nazarewk:matrix.orgnazarewk * I'm going to sleep now, built it non-nix way using https://github.com/nazarewk-iac/nix-configs/commit/b716351243bca4a0a57a38f34a8d939d86984bce21:53:49
4 Sep 2024
@booxter:matrix.orgIhar Hrachyshka joined the room.23:41:27
8 Sep 2024
@diamondburned:matrix.orgDiamond (it/she)
In reply to@nazarewk:matrix.org

How can I build a statically linked (portable) Go program on amd64 for armv6 architecture using Nix?

  • this doesn't work https://github.com/nazarewk-iac/nix-configs/commit/454b1cbd6729d1c6183b4e1b1cadbf4343797ba9
  • running GOARM=6 GOARCH=arm CGO_ENABLED=0 go build -o netbird ./client inside source repo seems to work fine
you can try something like this https://github.com/diamondburned/gotk4-nix/blob/main/build-cross-package.nix#L72-L76
08:24:29
10 Sep 2024
@frederic:scs.ems.hostFrédéric Christ changed their display name from Frédéric Christ to Frédéric Christ 🌴 16.09. - 30.09..05:21:12
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (u) (format nil "~A lost their email!" u)) "Artur Manuel" to Artur Manuel (on break).17:32:30
@artur:glasgow.social(artur 'manuel) changed their profile picture.17:34:53

Show newer messages


Back to Room ListRoom Version: 9