dep2nix icon indicating copy to clipboard operation
dep2nix copied to clipboard

Go 1.11 module support

Open benpye opened this issue 7 years ago • 4 comments

Any ideas about support Go 1.11's modules, several projects already seem to have adopted the new way of doing things, for example https://github.com/miniflux/miniflux and it'd be nice to have a good way to build these under NixOS.

benpye avatar Oct 19 '18 21:10 benpye

@benpye no plans yet. if you get funding, we might implment nix support.

at the meantime we use dep for our projects and sometimes i use it to 'easily' generate the deps.nix for projects which don't do dep.

qknight avatar Oct 20 '18 10:10 qknight

I decided to look into this a little bit, it seems Go defined a proxy protocol which can be used to provide the files, see: https://golang.org/cmd/go/#hdr-Module_proxy_protocol . This doesn't really make clear if there is any good way of parsing your go.mod or maybe go.sum and actually fetching the required files.

benpye avatar Oct 20 '18 16:10 benpye

a good way would be to implement a patch to the go programming language where we could generate Gopkgs.lock like file from which we can generate a deps.nix file which would feed into the https://golang.org/cmd/go/#hdr-Module_proxy_protocol you listed.

the most important thing would be to use the dependency resolver which would also be used when using go get or whatever go expects so the dependencies end up beeing the same.

sounds like an interesting project, i wish someone would find it, would love to implement that.

qknight avatar Oct 21 '18 15:10 qknight

The best way to make people aware that this is needed for dep2nix is keeping this issue open.

IMO, a "patch for the go programming language", as you put it, does not sound like that right approach. If anything, we could re-use the dependency resolver used by go get and build our own tool on top of that, similar to how we use dep as a dependency library for dep2nix.

CrushedPixel avatar Oct 21 '18 20:10 CrushedPixel