Skip to content

buildGoPackage: updated docs for goPackages after rework#16129

Merged
rushmorem merged 1 commit intoNixOS:masterfrom
kamilchm:rework-go
Jun 11, 2016
Merged

buildGoPackage: updated docs for goPackages after rework#16129
rushmorem merged 1 commit intoNixOS:masterfrom
kamilchm:rework-go

Conversation

@kamilchm
Copy link
Member

Motivation for this change

Stale docs for goPackages on master after #16017

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC: @rushmorem @zimbatm

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @vcunat and @chris-martin to be potential reviewers

</callout>

<screen>
$ nix-build -A goPackages.net
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also explain how to build binaries especially now that we can no longer install by the attribute path in all-packages.nix? Say nix-build -A deis.bin for example...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it turned out packages can be installed with nix-env -i to have bin in the profile. It all about differences of multiple outputs in nix-build and nix-env. #16103 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @vcunat's explanation helped make things clearer. I don't think this is an issue any more. But the documentation around this is seriously lacking IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But is it lacking here or in somewhere between nix-build and multiple outputs? I can mention it here anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reading nix-build shows that this is in fact documented there. It says "If a derivation has multiple outputs, nix-build will build the default (first) output." How about we make "bin" the default instead (https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/go-modules/generic/default.nix#L198)?

Copy link
Contributor

@rushmorem rushmorem Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought the docs say that by convention the default should be dev or out. Thanks again @vcunat!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe we should leave the decision what needs to be build to developer who want to use nix-build and rely on nix-env default for installation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what I think we should do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove all .bin attributes from all-packages then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please, I hadn't realised that we added them for other packages besides go2nix.

@kamilchm kamilchm mentioned this pull request Jun 11, 2016
7 tasks
@rushmorem rushmorem merged commit 4da067b into NixOS:master Jun 11, 2016
@vcunat
Copy link
Member

vcunat commented Jun 11, 2016

Note that changing the order of outputs has impact on the way things work when the package is added into buildInputs. It's described in nixpkgs manual, multiple-output section (not on stable yet).

@kamilchm kamilchm mentioned this pull request Jun 30, 2016
7 tasks
@kamilchm kamilchm mentioned this pull request Jul 21, 2016
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants