New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildGoModule: backport the new Go infrastructure to release 19.03 #57805
buildGoModule: backport the new Go infrastructure to release 19.03 #57805
Conversation
This change moves buildGoPackage from pkgs/development/go-modules to pkgs/development/go-packages, so we can have buildGoModule at pkgs/development/go-modules. (cherry picked from commit a0d835e)
The function buildGoModule builds Go programs managed with Go modules. It builds a Go module through a two phase build: - An intermediate fetcher derivation. This derivation will be used to fetch all of the dependencies of the Go module. - A final derivation will use the output of the intermediate derivation to build the binaries and produce the final output. (cherry picked from commit 28435e4)
@GrahamcOfBorg build jx pet hugo gotools terminal-parrot todoist hetzner-kube mod |
Why would we need to backport this? It's a breaking change that AFAIU doesn't fix any major functionality or security bugs. |
@lheckemann it's not a breaking change, but instead a new feature. It does make packaging Go modules a lot easier than it currently is. The legacy |
@kalbasit for the backport it might be better to skip migration of existing packages and only backport the function/documentation itself. |
(cherry picked from commit 832eb25)
a339da7
to
a456b83
Compare
@Mic92 sure, I've rebased my pull request and left only commits directly related to |
Thanks! |
Motivation for this change
This pull request backports #57080 into release 19.03. #57080 provides a new infrastructure for packaging Go modules without the need to manually package the dependencies. It relies instead on Go's module reproducibility and versioning to compute the dependencies in the early stage of the build.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)cc @NixOS/backports