!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

216 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.46 Servers

Load older messages


SenderMessageTime
21 May 2024
@frederic:scs.ems.hostFrédéric Christ changed their display name from Frédéric Christ 🌴 17.05. to Frédéric Christ.06:41:53
22 May 2024
@bullet-bending-koala:matrix.org@bullet-bending-koala:matrix.org joined the room.03:26:46
@bullet-bending-koala:matrix.org@bullet-bending-koala:matrix.org

Hey! I'm new to the nix build game and trying to get over an error I'm having when attempting to build a go project. I've already posted on the discord with no response(just impatient), but thought to post here as well:

I just started running into an issue referenced here: https://github.com/nix-community/gomod2nix/issues/98

I'm on go 1.22 and not sure how to resolve this issue during the buildPhase. Here is a snippet of how I'm running my phases:

            preBuild = ''
              go work sync
              go vet server/
              go vet infra/
            '';

            buildPhase = ''
              go build -v -o $out/bin/bin_result .
              chmod +x $out/bin/bin_result
            '';

            checkPhase = ''
              go test -v server/
              go test -v infra/
            '';

I've been trying different ways of getting it build such as vendoring prior and generating and having no real success. Here's the error:

Running phase: buildPhase
go: inconsistent vendoring in /private/tmp/nix-build-my-project-0.1.0.drv-1/v94xsm9rfafqgqhmf975928jbhfwyz4b-source:
github.com/jmoiron/sqlx@v1.4.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/pulumi/pulumi-azure-native-sdk/resources/v2@v2.42.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

I've already synced, deleted cache, re-vendored and added the -mod=vendor flags when running commands. This is the first time trying out a build step using nix, so any help would be really appreciated.

There are a few things which I just might not be cognisant of when it comes to behaviour - such as what happens during the preBuild and buildPhase for it error out like that and that even though I'm synced, it still prompts this error

03:32:41
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:25:59
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:28:13
@drupol:matrix.org@drupol:matrix.org joined the room.16:18:39
@drupol:matrix.org@drupol:matrix.org How can I have the binary godotenv available through nativeBuildInputs ? 16:19:04
@drupol:matrix.org@drupol:matrix.orgContext: https://github.com/NixOS/nixpkgs/pull/31371316:19:57
@drupol:matrix.org@drupol:matrix.orgNever mind ;) got it working I think16:56:15
23 May 2024
@jrick:zettaport.comjrickwhat is the buildGoModule way of making a race-enabled build?17:08:42
@jrick:zettaport.comjricki think adding to go build flags would work.. but that seems deprecated and will be removed later17:09:03
@jrick:zettaport.comjrickoh, i guess ldflags = [ '-race' ]17:27:57
@jrick:zettaport.comjrickeven though it's not a a linker flag, ugh17:28:03
@katexochen:matrix.orgPaul Meyer (katexochen) You can use GOFLAGS for that. 17:34:05
@katexochen:matrix.orgPaul Meyer (katexochen) * jrick: You can use GOFLAGS for that. 17:34:20
@jrick:zettaport.comjrickthanks, that sounds more reasonable17:38:11
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.17:43:37
24 May 2024
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.01:49:06
26 May 2024
@faust403:matrix.org@faust403:matrix.orgimage.png
Download image.png
12:58:19
@faust403:matrix.org@faust403:matrix.orgHey guys, when trying to build go package getting this error 12:58:19
@faust403:matrix.org@faust403:matrix.orgAs far as I understand I need to input a certain package hidapi, but it doesn't work12:58:49
@diamondburned:matrix.orgdiamond (it/its) what's your go build command and your CC? 20:48:21
28 May 2024
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.20:20:34
29 May 2024
@nscnt:matrix.org@nscnt:matrix.org joined the room.15:11:51
30 May 2024
@olaf_freund:matrix.orgOlaf Krasicki Freund joined the room.18:52:14
31 May 2024
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.09:32:02
2 Jun 2024
@bumperboat:matrix.org@bumperboat:matrix.org changed their display name from bumperboat (UTC+7) to bumperboat (UTC+1).05:29:04
4 Jun 2024
@hexa:lossy.networkhexahttps://groups.google.com/g/golang-announce/c/XbxouI9gY7k20:13:37
5 Jun 2024
@katexochen:matrix.orgPaul Meyer (katexochen)
  • re-post from contributors channel, where there weren't any reactions *

Should we deprecate buildGoPackage for 24.11? Go modules, released 6y ago, are now widely adopted in the ecosystem. Most remaining (~30) packages in nixpkgs using buildGoPackage weren't touched in years. I think most of these can be easily migrated to modules by adding the mod file downstream (or should be removed anyway as their upstream is unmaintained).

07:44:42
@katexochen:matrix.orgPaul Meyer (katexochen) *

* re-post from contributors channel, where there weren't any reactions *

Should we deprecate buildGoPackage for 24.11? Go modules, released 6y ago, are now widely adopted in the ecosystem. Most remaining (~30) packages in nixpkgs using buildGoPackage weren't touched in years. I think most of these can be easily migrated to modules by adding the mod file downstream (or should be removed anyway as their upstream is unmaintained).

07:44:59

Show newer messages


Back to Room ListRoom Version: 9