From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WEwkCh0wxl9FTAAA0tVLHw (envelope-from ) for ; Tue, 01 Dec 2020 11:59:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CEbeBR0wxl/AMgAAbx9fmQ (envelope-from ) for ; Tue, 01 Dec 2020 11:59:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A95ED940253 for ; Tue, 1 Dec 2020 11:59:24 +0000 (UTC) Received: from localhost ([::1]:41374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk4JX-0007H5-L5 for larch@yhetil.org; Tue, 01 Dec 2020 06:59:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk4JK-0007GA-KE for help-guix@gnu.org; Tue, 01 Dec 2020 06:59:10 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:35593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kk4JH-000098-D2 for help-guix@gnu.org; Tue, 01 Dec 2020 06:59:10 -0500 Received: by mail-wm1-x334.google.com with SMTP id e25so4423801wme.0 for ; Tue, 01 Dec 2020 03:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=g5M1O9ymuRoAMeQsuc4APUFSqb+53IBRv98PkM7ZwNw=; b=PTiiqUpqaYgShCZW2ARLtgg9YQCONIRPnVLY5Q675IdUbv8lMoWTXT3NugEmvv2usv 3Fj5Oj0ygfadaxjqGgbMkAso7S9Jk0l3TeJKMexi7tgErfNTWwIjT2F0lhJvmi6Uq1JG qCCIe0WmXMDjrYibX93oO5XvZVSnPM1osoZEEDw1mDb2S835nm5S0gY+wVBNGrTfhGkk yp1q95uUSna0l4g2GNjeWPiXNYfZnpxCgVI1MIRED1vytkBPiBaAF5hrh4I9rWpO76QL lJKKKDdBvsDSd1V51z6V+lOKk7ZGoaQp6rv/Tm70y16AvvtMGIAotFZAbs2aQRIo/4vZ QgzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=g5M1O9ymuRoAMeQsuc4APUFSqb+53IBRv98PkM7ZwNw=; b=R3nqUNrALTL7vDUeEvpGkOzqe1QbBYtMBm76Kat+soUKFLyCDD5lTkguYkOglC7IH6 5K2Ve3dil0/9tEugdliYfvl5xO/DjWfSgD6gG+eZc5SK1mcY/BODvGj3MghxEF0iPu/v Obi+HM1PUupocKvu7+OyQebYqN3+AE+f/8WefAyDL328x3dLhWAHr1c+Tsh67PxOG66B 7XvNytUFYtIurGyvi31fVLfX+xV6OWnQtjTVr5gg7E0eYb80Nr2QuRI/Jt+uv7v3pzvQ fVh9PzrjHsq7S8ddTzcGoYVQE9mwci3NLfxWsyALFok03pWZgfIFhzV8gH+jO8w9nQNB FWpw== X-Gm-Message-State: AOAM531mqGAv+06gBhWU26JfumUKnh5O38sDoklcF6ZWahOvA70C8+N2 l1K+XwnIuNrL9qsoPUL1sfEnvitjgn+vDg== X-Google-Smtp-Source: ABdhPJymYOwoZe6mQNSbAOD3wtyNfuzY/97tF/62MVBpZgKRL9dfukyMCZO+Zagl912JTaM8e3/4bA== X-Received: by 2002:a1c:b082:: with SMTP id z124mr2222159wme.129.1606823945099; Tue, 01 Dec 2020 03:59:05 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u66sm2614141wmg.2.2020.12.01.03.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 03:59:04 -0800 (PST) From: zimoun To: Brandon Ellington , help-guix@gnu.org Subject: Re: Reproducing a Python project environment (using guix inferiors) In-Reply-To: <875z5m5v0q.fsf@branjam-ASM100.i-did-not-set--mail-host-address--so-tickle-me> References: <87czzw6hid.fsf@branjam-ASM100.i-did-not-set--mail-host-address--so-tickle-me> <86sg8rvwgr.fsf@gmail.com> <875z5m5v0q.fsf@branjam-ASM100.i-did-not-set--mail-host-address--so-tickle-me> Date: Tue, 01 Dec 2020 12:50:33 +0100 Message-ID: <86r1o9vj7a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PTiiqUpq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: A95ED940253 X-Spam-Score: -1.92 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: kOIW3lGLmChK Hi, On Mon, 30 Nov 2020 at 14:39, Brandon Ellington wrote: >>> | package of interest | guix commit | status | >>> |---------------------+--------------+--------| >>> | python-matplotlib | "7e06086522" | bad | >>> | python-pandas | ce2cfcabfc | bad | >>> | python-networkx | 269f100330 | good | >>> | python-numpy | 4d6ed794dd | bad | >>> | python-scipy | 02ddafef55 | good | Which version of do you need? >> What do you mean by =E2=80=9Cbad=E2=80=9D? > > For , guix has a definition for it at commit > . When I declare an inferior channel at and > try to build that channel, I note in the column whether it > builds ("good") or I got the [3] message following a backtrace ("bad"). > If it were to build, then I would use (first (lookup-inferior-packages > (<>-inferior))) in a manifest for the > package itself. Because, I think that =E2=80=9Cbad=E2=80=9D commits 7e06086522 (Jan 2018), = ce2cfcabfc (Feb 2018) and 4d6ed794dd (Jan 2018) simply pre-date the introduction of =C2=ABInferior=C2=BB. Therefore, they are not reachable by this mechanism. That=E2=80=99s one of the motivations for the channel =E2=80=9Cguix-past=E2= =80=9D. :-) Basically, the Backtrace should say something as: --8<---------------cut here---------------start------------->8--- ice-9/boot-9.scm:1669:16: In procedure raise-exception: error: %guix-register-program: unbound variable --8<---------------cut here---------------end--------------->8--- >> What did you run? The command and the file(s)? > I attached the file I used to define the channels and inferiors. As for > the command, I just load these definitions piecemeal into the repl. I see. >>> 619:8 4 (_ #(#(#(#) "/gnu=E2=80=A6= " =E2=80=A6) =E2=80=A6)) >>> 626:19 3 (_ #(#(#(#) "/gnu=E2=80=A6= " =E2=80=A6) =E2=80=A6)) >>> 155:9 2 (_ #(#(#(#) "/gnu=E2=80=A6= " =E2=80=A6) =E2=80=A6)) >>> 223:20 1 (proc #(#(#(#) "/=E2=80=A6= " =E2=80=A6) =E2=80=A6)) >>> In unknown file: >>> 0 (%resolve-variable (7 . %guix-register-program) #) >>> #+end_example Ah, that=E2=80=99s the same backtrace message showed above. :-) > I do not think so. I have three different scenarios I'm working with: > 1. python-foo does not exist in guix :: So I use guix import to give me > a package definition and work from there (so far this is okay, but if it > weren't because of its dependencies I see where we might need to follow > your hypothetical). > 2. python-foo does exist in guix, but the desired version is in the past > :: So I (attempt to) use a guix inferior from a channel where it was > defined (this is where I have issues, but I assume that if guix had a > definition for it, then python-bar and python-baz would both be > available in the entire commit range that it defines python-foo). > 3. > python-foo does exist in guix, but I need a newer version :: I inherit > from the old version, changing the necessary fields (like 1. I see where > we would need to follow the hypothetical, but I haven't seen any missing > dependencies errors). > > I successfully made the channel https://github.com/branjam4/cna-python > (with packages from 3. and 1.) when I last worked on this. Hopefully > having a successful channel build isn't deceiving me, but I thought > given the successful build that I got lucky with needing to figure out > dependencies. My primary block is this "unregisted program" error I get > when using guix inferiors that I'd like to add to my manifest. What I will do is: a) fix a Guix version b) create a channel containing all the necessary variants (backporting dependencies if required, i.e., copy/pasting old package definition and fix them if they does not build anymore) to build my short list of . This is more or less the strategy used to feed the channel =E2=80=9Cguix-pa= st=E2=80=9C. And I will not use the inferior mechanism because it adds a lot of complexity and will not solve your problem since old packages are not reachable and/or your need to add old dependencies. >> From my experience, one simple way to start is: >> >> guix time-machine --commit=3D \ >> -- build -L >> >> where is an old Guix commit providing bunch of dependencies used >> by of interest defined in the folder >> . >>=20 >> A channels.scm file with the option =E2=80=99--channels/-C=E2=80=99 seem= s even better. > > Hmm, my end goal is to make /something/ that will be simple for > people with minimal assumed experience in guix (my professor, for > example) to run in a virtual machine with guix and direnv available, so > they can pull a git repository, then follow code examples from the book > without focusing on dependency building (there would be the initial cost > of waiting for things to build the first time, though). Assuming > time-machine works, is it straightforward to make a profile from it (or > something else enabling direnv to understand what I want when I go into > the cna-python directory)? That was something I missed while reading the > time-machine part of the manual. The time-machine is orthogonal with the way to distribute, IMHO. It is simply a easy CLI to fix the Guix version. Usually, I do: guix describe -f channels > channels.scm edit my-manifest.scm # containing =20=20 [.. hack my custom variants ..] [.. backport variant dependencies when I need for these variants ..] guix time-machine -C channels.scm -- build -L /path/to/variants/ -m my-manifest.scm [.. loop hack until it works ..] and then I create what my audience expects, e.g., Docker image: guix time-machine -C channels.scm -- pack -f docker -L /path/to/variants/ -m my-manifest.scm or relocatable tarball (pack -RR) or =E2=80=98system docker-image=E2=80=99 = or whatever. The /path/to/variants is a Git repo and I add the files channels.scm and manifest.scm. And now, it is easy to rebuild everything in the future. > Though with recent guix pulls it fails at that same commit, saying that > syntax has changed. I'm not as concerned about that at the moment > compared with the guix inferior channels issue though. The fail is about your channel. Well, I better understand your initial questions: From what I can gather, inferiors are the recommended way to declare packages defined in older revisions of guix. >From my understanding, the answer is: it depends. For commits after the complete introduction of Inferiors mechanism (~July 2018, please read [1]), it is ok. Be aware that each inferior has a cost and if your package foo depends on X packages coming from inferiors, then it means you are running under the hood X time: =E2=80=98gu= ix pull=E2=80=99 then =E2=80=99guix build =E2=80=99 which could re= quire to also build other dependencies, therefore installing foo could be long. Explicitly, imagine that python-foo depends on python, python-bar and python-baz. Imagine that you use 2 inferiors, one for python-bar and one for python-baz. Now imagine that python-bar and python-baz depends both on the package python. Then, there is a high probability to build 3 times tiny variants of the package python. And maybe the 3 packages python-foo, python-bar and python-baz perfectly works with the same variant of python. And it is worse because that applies to all the implicit dependencies (compilers and so on). For commits before ~July 2018, the strategy is the one of =E2=80=98guix-pas= t=E2=80=99 channel; which I roughly described above. 1: https://guix.gnu.org/en/blog/2018/multi-dimensional-transactions-and-rol= lbacks-oh-my/ But how would I know what a "good" guix inferior commit is for all of these packages? Would using the definitions instead of asking guix to reproduce five different worlds for one package each be an anti-pattern? Now, these questions and the other ones about =E2=80=99guix-past=E2=80=99 a= re answered, right? All the best, simon