[Nix-dev] NixOS 16.09 stable branch-off is due in ~a month

Tuomas Tynkkynen tuomas.tynkkynen at iki.fi
Sat Aug 27 00:15:33 CEST 2016


2016-08-23 14:27 GMT+03:00 Domen Kožar <domen at dev.si>:
> Reminder: another week left until branch off.
>

Hi nix-dev,

I would like to raise the backwards compatibility concern about
multiple outputs.
The biggest problem IMHO is using antiquotation to build paths in
various scripts,
like '${pkgs.nix}/bin/nix-build ...', or for a concrete example:

https://github.com/NixOS/nixos-channel-scripts/blob/master/default.nix#L27

So the derivation builds fine, except that the paths are broken as they point
to the 'dev' outputs, not 'bin'/'out' where the binaries are.

To fix this, I propose we change the convention of multiple outputs to have
the binaries in the first output (to have '${foo}/bin/bar' always work.
Then, to keep (propagated)BuildInputs working, mkDerivation would
need to be changed to use the dev outputs of packages added to
buildInputs (using the same logic that we already have in place
for systemPackages, i.e. 'environment.systemPackages = [ curl ];'
implicitly refers to 'curl.bin').

Of course, this doesn't resolve all such problems - for instance,
the '-I ${nix}/include/nix' in the above URL will now break instead.
But that failure (and in general, most references that actually want
to refer to 'dev' output) will fail at build time, instead of runtime.

The original WIP pull request for this is at
https://github.com/NixOS/nixpkgs/pull/14766
from some time ago.  Here's how the changes look rebased to current master:
https://github.com/NixOS/nixpkgs/compare/master...dezgeg:shuffle-outputs-v2
So far that branch seems to work fine on both Linux and Darwin, e.g. Gnome 3
and KDE4 tests still build+pass, for instance. So I'm fairly confident that all
the potential breakage could be fixed in time for 16.09.

Thoughts?


More information about the nix-dev mailing list