From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22629: Channels! Date: Tue, 28 Aug 2018 17:16:29 +0200 Message-ID: <87pny2iks2.fsf@gnu.org> References: <87vb5vsffd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fufjt-0005m4-Me for bug-guix@gnu.org; Tue, 28 Aug 2018 11:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fufjq-0008H9-Hm for bug-guix@gnu.org; Tue, 28 Aug 2018 11:17:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fufjq-0008Gc-8y for bug-guix@gnu.org; Tue, 28 Aug 2018 11:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fufjq-0000EJ-28 for bug-guix@gnu.org; Tue, 28 Aug 2018 11:17:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87vb5vsffd.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 11 Feb 2016 11:35:18 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 22629@debbugs.gnu.org Hi Guix! ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > =E2=80=A2 Have a =E2=80=9Cchannel=E2=80=9D mechanism, similar to =E2=80= =98nix-channel=E2=80=99, that would > allow users to have several Guix variants available in parallel > instead of just =E2=80=9Clatest=E2=80=9D. Could work like this: > > guix channel add latest git://git.sv.gnu.org/guix.git master > guix channel add stable git://git.sv.gnu.org/guix.git stable > guix channel pull latest > guix channel set latest > # here i see the latest versions of everything > guix channel set stable > # and here everything is old but super stable ;-) The patches that follow implement this last bit, though in a slightly different way. Users would now have the option to provide ~/.config/guix/channels.scm along these lines: (cons (channel (name 'guix-hpc) (url "https://gitlab.inria.fr/guix-hpc/guix-hpc.git") (branch "origin/master")) %default-channels) =E2=80=98guix pull=E2=80=99 then pulls both from =E2=80=98%default-channels= =E2=80=99, a one-element list containing our Savannah repo, and from that =E2=80=98guix-hpc=E2=80=99 repo= . It builds both Guix itself and the modules in =E2=80=98guix-hpc=E2=80=99, with a depe= ndency on the just-built Guix. The ~/.config/guix/current profile then contains two entries: --8<---------------cut here---------------start------------->8--- $ guix pull -l [=E2=80=A6] Generacio 18 Aug 27 2018 09:54:40 guix 1ca5499 repository URL: https://git.savannah.gnu.org/git/guix.git branch: origin/master commit: 1ca54999db34b0197e6c7fa3f0a852fc0d193e70 10 new packages: avogadro, emacs-git-annex, find-circ, guile-aa-tree, lep= ton-eda, r-a3, r-abcanalysis, r-manipulatewidget, r-miniui, r-slam 43 packages upgraded: byobu@5.127, cpupower@4.18.5, darcs@2.14.1, drumkv1= @0.9.2, duplicity@0.7.18, emacs-recent-addresses@0.1-1.afbbfdc, font-gnu-unifont@11.0.02, freefal= l@4.18.5, gdb-arm-none-eabi@8.1.1, gdb@8.1.1, ghc-integer-logarithms@1.0.2.1, ghc-optparse-applicative@0.1= 4.2.0, ghc-quickcheck-instances@0.3.18, ghc-scientific@0.3.6.2, ghc-smallcheck@1.1.5, ghc-zlib@0.6.2, guile-lib= @0.2.6.1, guile2.0-lib@0.2.6.1, guile2.2-lib@0.2.6.1, keepassxc@2.3.4, libgig@4.1.0, libx11@1.6.6, linu= x-libre-arm-generic@4.18.5, linux-libre-arm-omap2plus@4.18.5, linux-libre@4.18.5, ncmpc@0.29, opens= sh@7.8p1, padthv1@0.9.2, parallel@20180822, perf@4.18.5, qjackctl@0.5.3, r-car@3.0-1, r-catools@= 1.17.1.1, r-devtools@1.13.6, r-digest@0.6.16, r-dplyr@0.7.6, r-rcpp@0.12.18, r-synchronicity@1.3.5, = r-trimcluster@0.1-2.1, samplv1@0.9.2, synthv1@0.9.2, tuxguitar@1.5.2, yubico-piv-tool@1.6.1 Generacio 19 Aug 27 2018 16:20:48 guix d894ab8 repository URL: file:///home/ludo/src/guix branch: origin/wip-channels commit: d894ab8e9bfabcefa6c49d9ba2e834dd5a73a300 guix-hpc dd3df5e repository URL: file:///home/ludo/src/guix-hpc branch: origin/wip-channel-test commit: dd3df5e2c8818760a8fc0bd699e55d3b69fef2bb 11 new packages: chameleon, eztrace, fxt, litl, maphys, pastix, simgrid, = starpu, starpu, starpu-fxt, starpu-simgrid 4 packages upgraded: capstone@3.0.5-rc2, emacs-racket-mode@0.0.2-2.1b7882= 7, python-capstone@3.0.5-rc2, python2-capstone@3.0.5-rc2 --8<---------------cut here---------------end--------------->8--- GUIX_PACKAGE_PATH is no longer needed (though it=E2=80=99s still supported): ~/.config/guix/current/bin/guix automatically finds packages defined in the =E2=80=98guix-hpc=E2=80=99 channel. The only missing bit for this patch series is documentation for channels (including a prominent disclaimer about API compatibility). I=E2=80=99ll w= rite it if people agree with the overall approach. Implementation ~~~~~~~~~~~~~~ (guix channels) implements the =E2=80=9Cchannel=E2=80=9D and =E2=80=9Cchann= el instance=E2=80=9D abstractions. It provides tools to get the latest instance of channel and to build a list of instances. There must always be a channel called =E2=80=98guix=E2=80=99, which all other instances depend on. (guix scripts pull) now does little more than implementing the CLI, while (guix channels) does all the heavy lifting. Limitations ~~~~~~~~~~~ Currently third-party channels are expected to provide nothing but package modules. Those package modules should live at the root of the repository; for example, the modules/ directory at https://gitlab.inria.fr/guix-hpc/guix-hpc doesn=E2=80=99t work, you have to =E2=80=9Cgit mv modules/inria .=E2=80=9D for things to work. Both limitations could be lifted by honoring a special meta-data file in repositories. But I think that can come later. Third-party channels currently all implicitly depend on the =E2=80=98guix= =E2=80=99 channel, but it=E2=80=99s not possible to express dependencies among channe= ls. It may be useful, but it can probably come later, too. If a channel fails to build, the user gets a backtrace and it=E2=80=99s up = to them to figure out what to do. May need to be improved. :-) Not really a limitation, but (guix describe) relies on argv[0] to find channel meta-data. I=E2=80=99m not a fan of that but it works in practice. More importantly, it=E2=80=99s the only way I could think of to retrieve =E2=80=9Csilent=E2=80=9D meta-data (repo URL, commit, etc.) as well as chan= nel directories where packages should be searched for. Future work ~~~~~~~~~~~ With (guix channels) we=E2=80=99ll be able to implement things like =E2=80= =9Copen an inferior corresponding to commit X=E2=80=9D. In turn, that means we can su= pport commit IDs in manifests, and then =E2=80=9Cguix package -m manifest.scm=E2= =80=9D will open an inferior for the requested commit ID and instantiate the thing. With (guix describe) we can, of course, implement a =E2=80=98guix describe= =E2=80=99 command. We can also improve provenance tracking, for instance by storing as a manifest entry property the channel instance an installed package comes from. Thoughts? Ricardo? Thanks in advance for your feedback! Ludo=E2=80=99.