!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

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

Load older messages


SenderMessageTime
12 Sep 2023
@atalii:matrix.org@atalii:matrix.org
In reply to @msanft:matrix.org
Hey, I'm currently trying to build a static binary of a Go module which uses CGO. However, the local header file I'm trying to include in my main.go is not being picked up. I struggle to find the definition of buildGoModule to see what happens exactly. In my understanding, the header file should be included since src = ./.
i'm not too experienced with CGO/nix/etc, but i'll take a stab in the dark - if ./. is a git repository, nix will ignore any file that isn't indexed; you can git add -N $your_header_file if that is the issue
01:14:01
@msanft:matrix.orgMoritz Sanft Hey oren :) Thanks for your reply! Actually, I think I inevitably need a static binary. I don't know if it will even work out in the end, but I'm trying to compile a CGo-using Go app for an embedded RISCV device which requires static binaries from my x86 builder device. Quite unusual I guess :D 05:31:01
@msanft:matrix.orgMoritz SanftGod, yes. I didn't notice I had not checked in this file. Thank you so much!05:32:20
@chrispickard:matrix.orgchrispickard removed their display name chrispickard.17:38:32
13 Sep 2023
@jsla:matrix.orgjsla joined the room.07:35:55
15 Sep 2023
@mfikejs:fikejs.comMichal Fikejs joined the room.00:07:20
@farcaller:matrix.orgfarcaller what's the best way to run go test on a go module that has a bunch of cgo deps pulled from flakes? I guess, i"m mostly curious how to run checks only via buildGoModule or something, given the module doesn't have any binary outputs. 19:38:18
16 Sep 2023
@katexochen:matrix.orgPaul Meyer (katexochen) changed their display name from katexochen to Paul Meyer (katexochen).08:20:12
21 Sep 2023
@kidsan:matrix.orgkidsanAre we able to buildGoModule using go version 1.21 currently? 11:45:12
@qbit:tapenet.org@qbit:tapenet.org Yes 12:09:06
@kidsan:matrix.orgkidsanYeah I worked out the required override just now, thanks!12:09:46
@dedmunwalk:matrix.orgdedmunwalk joined the room.23:06:59
24 Sep 2023
@mib:kanp.aimib 🥐 joined the room.12:21:01
25 Sep 2023
@katexochen:matrix.orgPaul Meyer (katexochen)Why is buildGoModule using vendoring instead of relying on go.mod/go.sum?05:06:06
@artturin:matrix.orgArtturin
In reply to @katexochen:matrix.org
Why is buildGoModule using vendoring instead of relying on go.mod/go.sum?
vendoring would be copying those files to the nixpkgs repo
05:12:26
@artturin:matrix.orgArtturinand they're not05:13:14
@katexochen:matrix.orgPaul Meyer (katexochen)The builder has a field vendorHash, that's what I'm talking about. As far as I understand, it creates a intermediate derivation with the vendored dependencies.05:14:32
@artturin:matrix.orgArtturinI consider vendoring copying files to the repo05:15:10
@katexochen:matrix.orgPaul Meyer (katexochen)* The builder has a field vendorHash, that's what I'm talking about. As far as I understand, it creates an intermediate derivation with the vendored dependencies.05:15:11
@artturin:matrix.orgArtturinthe vendorHash thingy is just for a fod05:15:25
@artturin:matrix.orgArtturinso the deps can be fetched05:15:29
@katexochen:matrix.orgPaul Meyer (katexochen)fod?05:18:44
@artturin:matrix.orgArtturinfixed output derivation05:18:52
@artturin:matrix.orgArtturinonly those and impure derivations have access to network05:19:00
@katexochen:matrix.orgPaul Meyer (katexochen)Sure, makes sense to separate those derivations. But couldn't it use the go.sum file instead of its own hash? How would I validate the vendorHash actually is the hash of the dependencies in the go.sum file? 05:22:52
@artturin:matrix.orgArtturin
In reply to @katexochen:matrix.org
Sure, makes sense to separate those derivations. But couldn't it use the go.sum file instead of its own hash? How would I validate the vendorHash actually is the hash of the dependencies in the go.sum file?
Using a file from inside the derivation would be ifd
05:26:48
@artturin:matrix.orgArtturinImport from derivation05:26:55
@artturin:matrix.orgArtturinWhich isn't allowed in nixpkgs05:27:14
@artturin:matrix.orgArtturinFiles would have to be downloaded during evaluation05:27:25
@katexochen:matrix.orgPaul Meyer (katexochen)Got it, thanks for explaining. So dynamic derivations could potentially fix this in nixpkgs?05:29:43

Show newer messages


Back to Room ListRoom Version: 9