Subject: Non-pull ‘guix’ should know its channels

From: Ludovic Courtès <[email-masked]>
Date: Fri, 15 Jan 2021 18:51:14 +0100

Related to <https://issues.guix.gnu.org/45895>, we have the problem that
the ‘guix’ command coming from the ‘guix’ package doesn’t know its
provenance: ‘guix describe’ errors out.

We should fix it by storing a meta-data file within the ‘guix’ package.

Likewise, on foreign distros, /usr/local/bin/guix may point to a ‘guix
pull’-guix, but because of the symlink, ‘guix describe’ won’t work:

--8<---------------cut here---------------start------------->8---
$ type -P guix
/home/ludo/.config/guix/current/bin/guix
$ guix describe
Generacio 171	Jan 11 2021 11:38:39	(nuna)
  guix 458cb25
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 458cb25b9e7e7c954f468023abea2bebb5d8c75b
$ ln -s $(type -P guix) /tmp
$ /tmp/guix describe
guix describe: error: failed to determine origin
hint: Perhaps this `guix' command was not obtained with `guix pull'? Its
version string is 458cb25b9e7e7c954f468023abea2bebb5d8c75b.
--8<---------------cut here---------------end--------------->8---

We should probably store proper provenance info directly in the ‘guix’
output, just like we store the commit ID in (guix config).

Ludo’.