[Nix-dev] git svn and how to install it please?

Jeevakan Suresh Jeevakan.Suresh at macquarie.com
Thu Jun 11 06:24:04 CEST 2009


I think this will solve your problem (add this to your config.nix file)
{
    git = { svnSupport = true; };
    subversion = { perlBindings = true; };
}

A longer explanation of why you need both lines (and a possible fix) is below:

If you look at the file pkgs/applications/version-management/git-and-tools/default.nix - you will notice the following line
  svnSupport = getConfig ["git" "svnSupport"] false;

Lines like this are scattered throughout the nixexpr tree, and basically mean 'look this value up in the config file'

However, at the top of pkgs/applications/version-management/git-and-tools/git/default.nix, there is the following line:
    assert svnSupport -> (subversion != null && perlLibs != [] && subversion.perlBindings);

This is basically stating that subversion needs to be installed with perl bindings, for git svn to work. Now if we look at the default derivation for subversion (in pkgs/top-level/all-packages.nix) the value for perlBindings is the following:
    perlBindings = getConfig ["subversion" "perlBindings"] false;

So naturally, the assert in git will fail.

For this reason, you need to turn on both subversion perl bindings and svnSupport in git for git-svn to work. I think a better fix would be to ensure the subversion passed into the git derivation always has perl bindings turned on (a major feature of nix is explicit dependency injenction after all) - would anyone be adverse to this change?


-----Original Message-----
From: nix-dev-bounces at cs.uu.nl [mailto:nix-dev-bounces at cs.uu.nl] On Behalf Of Tony White
Sent: Thursday, 11 June 2009 12:23 PM
To: Lluís Batlle
Cc: nix-dev
Subject: Re: [Nix-dev] git svn and how to install it please?

2009/6/10 Lluís Batlle <viriketo at gmail.com>:
> Additionally to the nixos config, there is the nixpkgs config.
> Usually it's at $HOME/.nixpkgs/config.nix
>
> the beginning of top-packages.nix has the config management.
>
> the file config.nix should have attributes set like this, as a quick guide:
> {
>   git = {
>       svnSupport = true;
>   };
> }
>
> The evaluation of any other nixpkgs expression will take into account 
> your config.nix file.
> You will see in top-packages.nix that you can override the path of the 
> nixpkgs config file with the environment variable NIXPKGS_CONFIG.
>
> Regards,
> Lluís.
>
> 2009/6/10 Tony White <tonywhite100 at googlemail.com>:
>> Hi,
>> I'd like to use git svn which is a perl module, it's specified in 
>> /etc/nixos/nixpkgs/pkgs/applications/version-management/git-and-tools
>> /default.nix, however I can't see how to install it.
>> I've got :
>>
>>          environment = {
>>          extraPackages = [
>>          pkgs.git
>>          ];  };
>>
>> In configuration.nix and git is there and I can use it from a 
>> konsole, however if I try to use git svn in a konsole, it complains 
>> about it the missing perl module.
>>
>> Can't locate SVN/Core.pm in @INC
>>
>> I can see :
>>
>> svnSupport = getConfig ["git" "svnSupport"] false; # for git-svn 
>> support
>>
>> in 
>> /etc/nixos/nixpkgs/pkgs/applications/version-management/git-and-tools
>> but how do I specify to install it or have I found a problem?
>>
>> My first thought was that it was something like :
>>
>>          pkgs.git.svnSupport
>>
>> That's obviously wrong though.
>>
>> Thanks,
>> Tony
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at cs.uu.nl
>> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>>
>

Hi Luis and Marc,
Thanks for the info Lluís, unfortunately I've not been able to activate the svnSupport switch yet.

Because I want it system wide, I found :

export NIXPKGS_CONFIG=/nix/etc/config.nix

in /etc/nixos/nixos/etc/bashrc.sh

/nix/etc/config.nix did not exist, so I created it and added :

{
  git = {
      svnSupport = true;
  };
}

to it and then used a sudo nixos-rebuild switch.
Nothing changed and the error when trying to use git svn still occurs.

Marc, the problem is that there are two ways to call git svn either :

git svn
or
git-svn

If they are two different things, I do not know. I do know that git svn (No dash) Is how you call the git-svn executable according to the documentation.

So git-svn or git-svn --help results in the message you have quoted (Even after it has been set to true) :

git-svn not supported, reinstall with config git = { svnSupport = true } set

but git svn --help opens the git-svn manpage in vi and just git svn results in :

Can't locate SVN/Core.pm in @INC (@INC contains:
/nix/store/fi89ps92826jr4mc6p904l1jyslf7kch-git-1.6.1.3/lib/perl5/site_perl/5.10.0/i686-linux-thread-multi
/nix/store/fi89ps92826jr4mc6p904l1jyslf7kch-git-1.6.1.3/lib/perl5/site_perl/5.10.0
/nix/var/nix/profiles/per-user/tony/profile/lib/perl5/site_perl
/nix/var/nix/profiles/per-user/tony/profile/lib/site_perl
/nix/var/nix/profiles/default/lib/perl5/site_perl
/nix/var/nix/profiles/default/lib/site_perl
/nix/store/d9k73hs12g1ihbs1312fdhq2p0caxf14-perl-5.10.0/lib/perl5/5.10.0/i686-linux-thread-multi
/nix/store/d9k73hs12g1ihbs1312fdhq2p0caxf14-perl-5.10.0/lib/perl5/5.10.0
/nix/store/d9k73hs12g1ihbs1312fdhq2p0caxf14-perl-5.10.0/lib/perl5/site_perl/5.10.0/i686-linux-thread-multi
/nix/store/d9k73hs12g1ihbs1312fdhq2p0caxf14-perl-5.10.0/lib/perl5/site_perl/5.10.0
.) at /nix/store/fi89ps92826jr4mc6p904l1jyslf7kch-git-1.6.1.3/libexec/git-core//git-svn
line 29.

I hope this info helps, there's obviously something a little odd happening or maybe I don't understand. If I could understand the expression a little bit better, I would re-write it to just be able to use pkgs.git.svnSupport in configuration.nix, or even just make it default, seeing as it is part of git.

I can't really be sure what to try now other than write a new git expression here, the git expressions are a little too complex for me to understand yet.

Thanks,
Tony
_______________________________________________
nix-dev mailing list
nix-dev at cs.uu.nl
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited.




More information about the nix-dev mailing list