Go packages, buildGoPackage #6119

Merged
merged 22 commits into from Feb 7, 2015

Projects

None yet

6 participants

@lethalman
Member

Based on PR #4222 , also ported ngrok, didn't test it but the binaries run. cc @iElectric are you fine with this kind of build?

@ehmry I've added $makeFlags to go install call, maybe improper but it's ok for now I think. Also added go13Packages and go14Packages. Removed the crypto package, confirming it's broken with recent go versions.

Build with nix-build -A ngrok.

Packages to port:

  • bosun
  • pond
  • gox
  • etcdctl
  • gocode
  • golint
  • gotags
  • go-repo-root
  • packer (uses gox)
  • consul (uses ruby in the build)
  • etcd
  • influxdb-backup
  • nsq
  • serfdom
  • go-mtpfs
  • go-bindata
  • ngrok
  • flannel
  • syncthing
  • kubernetes (quite custom build)
ehmry and others added some commits Jan 31, 2015
@ehmry @lethalman ehmry new Go support function 'buildGoPackage'
add a setupHook to the Go compiler that builds a GOPATH
new buildGoPackage function that overides the phases of stdenv
faa5dcc
@lethalman lethalman buildGoPackage: add $makeFlags to go install call b3dd66d
@domenkozar
Member

Looks good. Might wanna delete old ngrok expression.

@ehmry
Member
ehmry commented Feb 3, 2015

👍
I can't say I think go.crypto is very well maintained, so its not a supprise to me.

@lethalman
Member

@ehmry as a result I've also dropped cjdcmd, sorry. At a later attempt maybe :)

@ehmry
Member
ehmry commented Feb 3, 2015

Thats ok, it was a test.

@domenkozar
Member

Awesome!

@lethalman
Member

Also cc @cstrahan , retained as maintainer. I've decided to keep ngrok in its own directory instead of under goPackages. Now working on porting the other software.

@offlinehacker
Contributor

Nice, the last thing we would need is go2nix fixed for a new format.

@lethalman
Member

@offlinehacker what should go2nix do? I personally don't want packages to be auto updated.

@lethalman
Member

Just ported pond, which required crypto. So @ehmry it seems to work, it's a different hash though, but at least compiles with go 1.3 :)

@ehmry ehmry added a commit to ehmry/nixpkgs that referenced this pull request Feb 4, 2015
@ehmry ehmry nix-generate-go-package: new utility to generate expressions
Issue: #6119
db0ebbd
@ehmry
Member
ehmry commented Feb 4, 2015

@lethalman I'll check it out.

I also think that auto-updating packages would be trouble, but a tool to generate the package expressions would be very useful.

I had a quick and dirty shell script to do that but I don't know how it compares to go2nix.

@lethalman
Member

I'm resolving conflicts between package names using the repo name. E.g. rcrowley.go-metrics and armon.go-metrics.

@ehmry
Member
ehmry commented Feb 4, 2015

Good call

@lethalman
Member

@ehmry indeed giving a repo path and automatically creating the nix expression is handy. I just don't like the way npm packages are updated, for example.

@lethalman
Member

cc @bennofs ported go-mtpfs, hope it's ok for you :)

@lethalman
Member

So packer uses gox, and consul also uses ruby in the build. I would leave them as is for now.

@lethalman
Member

Also I wouldn't touch kubernetes either.

@lethalman
Member

@matejc I've ported syncthing to buildGoPackage, does it look fine to you?

@bennofs
Member
bennofs commented Feb 5, 2015

@lethalman no problem, as long as it works :)

@lethalman
Member

Ok so I'm going to merge this in a few days, I will do a quick test of all the packages again. That said, if a ported package doesn't work we can always bring the older version back.

Also I think I'm going to add a flag, like dontInstallSrc to avoid installing the src for packages where it makes sense to only ship executables.

@offlinehacker offlinehacker referenced this pull request Feb 7, 2015
Merged

Add consul alerts #6032

@lethalman
Member

OK let's merge this and see :)

@lethalman lethalman merged commit 8b236f2 into NixOS:master Feb 7, 2015

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details
@domenkozar
Member

I'm using $ nix-build -A packer|&grep "cannot find package" | sed -E 's/cannot find package "(.*)" in any of:/\1/'| cut -d " " -f 2|sort|uniq to get a list of buildInputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment