buildGoPackage: move goDeps from JSON to nix#17254
buildGoPackage: move goDeps from JSON to nix#17254kamilchm wants to merge 5 commits intoNixOS:masterfrom
goDeps from JSON to nix#17254Conversation
|
@kamilchm, thanks for your PR! By analyzing the annotation information on this pull request, we identified @zimbatm, @carlsverre and @vrthra to be potential reviewers |
pkgs/tools/text/sift/deps.nix
Outdated
There was a problem hiding this comment.
x/crypto is duplicated in this deps file -- might want to check elsewhere for similar issues
There was a problem hiding this comment.
thx, I'll try find all duplcates and fix it
|
I am down with the goals of this change. By having go-binaries reference their dependencies + versions it will assist with keeping go-binaries working. I feel that this change calls into question the purpose of Are there any docs that should be updated with this change? Specifically docs which reference go2nix and/or how to write a go-binary package. Also - question for @kamilchm - Are the versions of go dependencies the same as those in |
|
The Current docs http://hydra.nixos.org/build/36798894/download/1/nixpkgs/manual.html#sec-language-go needs to be updated if we agree on this change. All
|
|
Nice, thanks for pushing this! Looking forward to it becoming the new way to manage go packages. LGTM |
|
FYI: would be nice, if go2nix would be able handle |
|
@avnik you can't generate |
|
On Mon, Jul 25, 2016 at 11:07:50AM -0700, Kamil Chmielewski wrote:
@kamilchm It solely about packaging convinience, so I actually need download all stuff twice, firstly with |
After NixOS#16017 there were a lot of comments saying that `nix` would be better than `JSON` for Go packages dependency sets. As said in NixOS#16017 (comment) > Because of the content-addressable store, if two programs have the > same dependency it will already result in the same derivation in the > store. Git also has compression in the pack files so it won't make > much difference to duplicate the dependencies on disk. And finally > most users will just use the binary builds so it won't make any > differences to them. This PR removes all `deps.json` and `libs.json` files by replacing it witth standard `deps.nix` dependecy set files that can be generated by `go2nix`.
|
What if the dependencies are fetched over mercurial or bazaar? With that approach the user need to coordinate the import inherited variables with what deps.nix needs. Maybe make the arguments in the deps.nix open-ended (eg: |
|
@zimbatm in the current form you need to make sure that proper If I understand you correctly you want [
{
goPackagePath = "bitbucket.org/ww/goautoneg";
rev = "75cd24fc2f2c2a2088577d12123ddee5f54e0675";
sha256 = "19khhn5xhqv1yp7d6k987gh5w5rhrjnp4p0c6fyrd8z6lzz5h9qi";
}
{
goPackagePath = "golang.org/x/crypto";
rev = "1f22c0103821b9390939b6776727195525381532";
sha256 = "1acy12f396sr3lrnbcnym5q72qnlign5bagving41qijzjnc219m";
}
]and make an utility in
So build of a Go package will have to call a site and parse HTML to know code location and make proper The most important question for me here is if we want to replace |
goDeps from JSON to nixgoDeps from JSON to nix
|
could go2nix also use |
|
It's doable. Could you provide some examples in
|
|
I'll be out of the github from the next week till september. So if the maintainers have any comments that can move this forward to the master I can try to get it merged if I manage to do it this week. |
|
👍 i'm for merging this. improvements can come later. |
|
@kamilchm sorry for the late reply. I think we should try to avoid changing the deps format too much. Having the tooling produce the wrong format is going to be confusing otherwise. I think we all agree that the Regarding the deps format, I think it would be best to keep in NIXON format (aka: only the data bits). How hard would it be to output the exact same JSON data structure but in Nix instead? (and maybe add a version format key so we can evolve the schema) |
|
@zimbatm do you have an example where and how can I place a version? |
|
I'll try to get rid of the @zimbatm if I convert current I also showed more pure version before in this comment that will require a lot more stuff to be done as nix utility function. |
|
I am agreed, that NIXON will be much better, and cleaner. |
|
What we need is someone from maintainers who can say what would be a desired state and what steps needs to be done to get there. Someone who can then merge subsequent PRs into master if we do the work. @avnik as for the adding new packages now, I think I can migrate any package and I'll do this in every following PR. BTW. I'll be out from tomorrow till september. |
|
@kamilchm sorry for the delay.
If you can just convert the existing JSON data structures to NIXON and replace the {
version = 1;
srcs = [ # the usual
];
} |
|
If anyone missed it, there is a new effort and committee for Go package management https://groups.google.com/d/msg/golang-nuts/bErS3fDwIgU/DRSUfnS1FQAJ |
|
Any progress on this? It would be good to get this merged before 16.09 so that we don't have to support that JSON craziness forever. |
|
One concern here is the use of |
|
I'll have time on friday to create new PR with JSON converted to NIXON (#17254 (comment)) with corresponding go2nix version. |
|
PR with all deps in pure NIXON form -> #18487 |
#17254 (comment) * update docs to describe `deps.nix` * include goDeps in nix-shell GOPATH * NixOS 16.09 rel notes about replacing goPackages
#17254 (comment) * update docs to describe `deps.nix` * include goDeps in nix-shell GOPATH * NixOS 16.09 rel notes about replacing goPackages (cherry picked from commit 914e0e5) Conflicts: pkgs/servers/etcd/deps.json
NixOS#17254 (comment) * update docs to describe `deps.nix` * include goDeps in nix-shell GOPATH * NixOS 16.09 rel notes about replacing goPackages
NixOS#17254 (comment) * update docs to describe `deps.nix` * include goDeps in nix-shell GOPATH * NixOS 16.09 rel notes about replacing goPackages (cherry picked from commit 914e0e5) Conflicts: pkgs/servers/etcd/deps.json
Motivation for this change
After #16017 there was a lot of comments saying that
nixwould be betterthan
JSONfor Go packages dependency sets.As said in #16017 (comment):
This PR removes all
deps.jsonandlibs.jsonfiles by replacingit witth standard
deps.nixdependecy set files that can begenerated by
go2nix.TODOs:
go2nixupdateThings done
(nix.useChroot on NixOS,
or option
build-use-chrootinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)CC: @zimbatm @offlinehacker @groxxda @rushmorem @lethalman @edolstra @chris-martin @dguibert @bjornfor @obadz