Subject: [bug#28531] [PATCH] gnu: Add vcsh.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 25 Sep 2017 11:50:55 +0200

Hi,

Stefan Reichör <[email-masked]> skribis:

> Thanks for the explaination. I see the benefit of the static binding.
> The good thing is that the package versions are reproducable.
> However, I am used to the way it works on other systems. There is almost
> always the search path used to start other programs.
>
> And to make it even more complicated, I still use Ubuntu and install
> some tools using Guix. So it is even possible that I use vcsh from Guix
> and git from Ubuntu.

Indeed.  From a reproducibility viewpoint, it’s something we’d like to
avoid, because then vcsh might behave completely differently depending
on what the underlying distro is, and that’s clearly not what we expect
from Guix.

> I took a look at the vcsh script. git is hardcoded in many places there.
> Patching it to have static binding seems to be complicated. The only
> sane solution would be to change the script and make git configurable
> and try to make this change upstream. However I am not really keen on
> doing this kind of work...
>
> Or do you have another idea how the static binding should be accomplished?

I think it might be enough to do a regexp substitution matching all
“git” commands in the script:

  (substitute* "vcsh"
    (("\\<git ([a-z-]+)" _ sub-command)
     (string-append (assoc-ref inputs "git") "/bin/git "
                    sub-command)))

Could you give it a try?

Thanks,
Ludo'.