[Nix-dev] conflicting packages / priority values

Roger Qiu roger.qiu at matrix.ai
Sat Jun 17 05:14:06 CEST 2017


I wonder in other programming languages, name clashes are usually resolved
through aliasing. Would it be possible for nix to install packages while
aliasing their outputs to a different name to avoid clashes like this?

On 17 Jun 2017 09:07, "Roni Choudhury" <aichoudh at gmail.com> wrote:

> From time to time I see an error message like this:
>
> collision between ‘/nix/store/qs8fq5ld2shc0i3fvbs6n0g0k8fypndm-git-2.13.0/bin/git’ and ‘/nix/store/64fjdb4whkf2r5x8xyqf9kkljnk6w59b-git-2.13.0/bin/git’; use ‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of one of the conflicting packages
>
> I understand what causes it (two packages competing to place the same,
> e.g., binaries in my profile), but I’ve never understood how to resolve it.
> Usually I just guess priority numbers until it works; more lately I’ve
> simply removed the offending package from my environment before repeating
> the failing install command. Obviously, neither approach is healthy or
> correct :)
>
> The man page for nix-env contains the following:
>
> If there are multiple derivations matching a name in args that have the
> same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the
> highest priority is used. A derivation can define a priority by declaring
> the meta.priority attribute. This attribute should be a number, with a
> higher value denoting a lower priority. The default priority is 0.
>
> But I’m still not sure what this means for my error situation. How do I
> know what the priorities are for the different packages? The default value
> is 0, which is the highest priority; what does that mean exactly, for the
> default priority to be the highest priority?
>
> Is there a more intuitive way to resolve this sort of conflict? For
> instance, is there a way to tell nix-env to force the issue by treating
> the requested package as higher priority than any existing ones?
>
> Thanks!
>
> roni
>>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170617/af770099/attachment.html>


More information about the nix-dev mailing list