| 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
|