[Nix-dev] Re: mostly minimal Nixos built using gold ld where possible

Ludovic Courtès ludo at gnu.org
Mon Mar 29 14:12:21 CEST 2010


Hi Rohan,

Rohan Hart <rohan.hart17 at gmail.com> writes:

> 2010/3/20 Ludovic Courtès <ludo at gnu.org>:
>> Actually, things could be committed to ‘trunk’ as long as (1) users can
>> choose between GNU ld and GNU Gold, and (2) the default remains GNU ld.
>>
>> Before committing to ‘trunk’, you’d have to make sure that it won’t
>> cause too many rebuilds, and in particular that it doesn’t affect
>> ‘stdenv’; otherwise that could go to ‘stdenv-updates’.
>>
>> What do you think?
>
> I can do that.  What's the best way to make this configurable easily
> by users?

The easiest way would be via ‘getConfig’, something like:

  binutils =
    if (getConfig [ "binutils" "gold" ] false)
    then binutilsGold
    else binutilsLd;

  binutilsGold = import .../  {
    gold = true;
    ...
  };

  binutilsLd = import .../ {
    gold = false;
    ...
  };

(See ‘all-packages.nix’ for examples.)

Then packages referring to ‘binutils’ don’t have to be changed: they
will refer to the user-selected variant of Binutils.  Users would only
have to set ‘binutils.gold = true’ in ~/.nixpkgs/config.nix (whether on
NixOS or not.)

What do you think?

Thanks,
Ludo’.



More information about the nix-dev mailing list