!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

237 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.49 Servers

Load older messages


SenderMessageTime
25 Mar 2024
@qbit:tapenet.org@qbit:tapenet.org no need to go install it 18:52:35
@stv0ge:matrix.orgstv0gThe issue is that the version in nixpkgs might not match the version in my go.mod18:52:55
@stv0ge:matrix.orgstv0gSame is true for other Go tools like protoc-gen-go18:53:19
@qbit:tapenet.org@qbit:tapenet.orgseems you would have the same problem with that approach 18:54:06
@stv0ge:matrix.orgstv0gI've tried to reuse the vendor'ed modules by buildGoModule and then run "go install" with pkgs.runCommand18:54:30
@qbit:tapenet.org@qbit:tapenet.orgi guess it will bump the go.mod file?18:54:30
@stv0ge:matrix.orgstv0gI guess by using the vendored modules, I am actually ignoring the go.mod already because its only used to build the goModules derivation18:55:21
@qbit:tapenet.org@qbit:tapenet.org mmm, you might be able to use the FOD modules stuff via GOCACHE 18:55:42
@qbit:tapenet.org@qbit:tapenet.orgnothing's gonna be ideal (at least that I can think of)18:56:09
@qbit:tapenet.org@qbit:tapenet.orgmaybe vendor your deps, then just build the code locally?18:59:18
@qbit:tapenet.org@qbit:tapenet.orgthat'd probably be the cleanest 18:59:24
@stv0ge:matrix.orgstv0g

I think I got it working with:

            pkgs.runCommand "ginkgo" {
              nativeBuildInputs = [
                pkgs.go
              ];
            } ''
              export HOME=$(pwd)
              export GO111MODULE=off
              export GOPATH=/build

              ln -s ${packages.go-babel.goModules} src

              go build -o $out/bin/ginkgo github.com/onsi/ginkgo/v2/ginkgo
            '';
18:59:54
@qbit:tapenet.org@qbit:tapenet.orgi'd make it grep the ginkgo version from go.mod and explicitly build the version 19:00:57

There are no newer messages yet.


Back to Room ListRoom Version: 9