!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

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

Load older messages


SenderMessageTime
15 May 2024
@raboof:matrix.orgraboof github.com/aws/aws-sdk-go-v2/aws/protocol/xml indeed isn't in go.sum, even after go mod tidy 12:36:45
@katexochen:matrix.orgkatexochen
In reply to @raboof:matrix.org
github.com/aws/aws-sdk-go-v2/aws/protocol/xml indeed isn't in go.sum, even after go mod tidy
Well, that's not a module but a package, right? https://github.com/aws/aws-sdk-go-v2/tree/v1.26.1/aws/protocol/xml
Seems to belong to the module github.com/aws/aws-sdk-go-v2
12:46:41
@raboof:matrix.orgraboofgotcha - sorry, my go is rusty (no pun intended 😆). that's a good lead, digging further.13:05:20
@raboof:matrix.orgraboofhttps://github.com/nix-community/gomod2nix/pull/158 🎉14:07:48
16 May 2024
@frederic:scs.ems.hostFrédéric Christ changed their display name from Frédéric Christ to Frédéric Christ 🌴 17.05..14:30:07
@anjoletto:matrix.org@anjoletto:matrix.org left the room.21:04:56
17 May 2024
@hexa:lossy.networkhexadoes the go builder have an interface for disabling tests?08:21:48
@hexa:lossy.networkhexaI've usually gone and just yeeted individual test files, which seems rather coarse08:22:04
@katexochen:matrix.orgkatexochenhttps://nixos.org/manual/nixpkgs/unstable/#ssec-skip-go-tests08:22:47
@katexochen:matrix.orgkatexochenNot really, but letting Go skip test cases is slightly cleaner and less error prone than removing test files.08:23:48
@katexochen:matrix.orgkatexochenAlready thought about moving that into an input, but not sure it is worth it.08:24:44
@katexochen:matrix.orgkatexochen * hexa: https://nixos.org/manual/nixpkgs/unstable/#ssec-skip-go-tests 08:25:06
@hexa:lossy.networkhexaah neat, thanks for pointing that out08:25:32
@hexa:lossy.networkhexaand yeah, if that code is well tested, port it into the builder08:36:40
@hexa:lossy.networkhexamakes people less likely to apply crude hacks08:37:06
@hexa:lossy.networkhexa in python we have pytestFlagsArray and on top of that disabledTests and disabledTestsPath fwiw 08:37:44
@hexa:lossy.networkhexa that would map to checkFlags and skippedTests 08:37:58
18 May 2024
@easel:matrix.orgeasel set a profile picture.12:27:42
20 May 2024
@kamillaova:matrix.orgKamilla 'ova joined the room.23:24:04
21 May 2024
@bumperboat:matrix.org@bumperboat:matrix.org changed their display name from bumperboat (UTC+8) to bumperboat (UTC+7).04:34:16
@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

Show newer messages


Back to Room ListRoom Version: 9