Re: [Nix-dev] conflicting packages / priority values

2017-06-17 Thread Layus
When you get too many such conflicts, you are probably looking for 
virtual environments.
These are provided by nix-shell, and allow to temporarilly override the 
set of available, installed applications.


Looking at your example, a clash between two different git's at the same 
version is very weird...


-- Layus.

On 17/06/17 05:14, Roger Qiu wrote:
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" > 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@lists.science.uu.nl 
https://mailman.science.uu.nl/mailman/listinfo/nix-dev




___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] conflicting packages / priority values

2017-06-17 Thread Roger Qiu
Yes something like that but without too much fanfare. A standard nix
function encapsulating this aliasing logic and expose it to user space with
nix-env too.

On 17 Jun 2017 16:25, "James Cook"  wrote:

> Roger, I'm not sure what you're suggesting. Do you mean that the user's
> configuration would explicitly say "include pkgs.someAlternateGitVersion in
> my profile, but rename /bin/git to /bin/gitB"?
>
> As a starting point, I guess you could do that manually by making a new
> expression with a build script like cp -r "$git" "$out"; mv "$out/bin/git"
> "$out/bin/gitB".
>
> On 17 June 2017 at 03:14, Roger Qiu  wrote:
>
>> 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"  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@lists.science.uu.nl
>>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>>
>>>
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] conflicting packages / priority values

2017-06-17 Thread James Cook
Roger, I'm not sure what you're suggesting. Do you mean that the user's
configuration would explicitly say "include pkgs.someAlternateGitVersion in
my profile, but rename /bin/git to /bin/gitB"?

As a starting point, I guess you could do that manually by making a new
expression with a build script like cp -r "$git" "$out"; mv "$out/bin/git"
"$out/bin/gitB".

On 17 June 2017 at 03:14, Roger Qiu  wrote:

> 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"  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@lists.science.uu.nl
>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] conflicting packages / priority values

2017-06-16 Thread Roger Qiu
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"  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@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] conflicting packages / priority values

2017-06-16 Thread Roni Choudhury
>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@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev