From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GWWaB353xV9aRwAA0tVLHw (envelope-from ) for ; Mon, 30 Nov 2020 22:51:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QGHjAn53xV99WwAAB5/wlQ (envelope-from ) for ; Mon, 30 Nov 2020 22:51:42 +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 5CD6C94042C for ; Mon, 30 Nov 2020 22:51:41 +0000 (UTC) Received: from localhost ([::1]:53368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjs1B-0007vO-9r for larch@yhetil.org; Mon, 30 Nov 2020 17:51:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjrpr-0004AY-Gj for help-guix@gnu.org; Mon, 30 Nov 2020 17:39:55 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:36162) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjrpo-0000jY-Jr for help-guix@gnu.org; Mon, 30 Nov 2020 17:39:55 -0500 Received: by mail-pl1-x632.google.com with SMTP id r2so7339030pls.3 for ; Mon, 30 Nov 2020 14:39:51 -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; bh=bdVVsGPXouJmLOsv1gWqtlrnZ71v/RqKPQFmQQ50OvE=; b=GexRMDMLV41r/FOWXgrz9bhvRdRgZy0/l/oO0Of6gdrSklYNfAZ2oT+4bi8IDyrmfk PIW6IMAroM3m7WXse6tRJu0YQ2WizhOcbRuljTQM97kux4c6uKqknWdihGL3Tgpekyl8 QeIMjoJbiKUpklkJiqXKvK0W8GwvCBsqQKb2BY+u0sUw09b4ux+gDyjtSueJXecZjXI4 Goax5rappsYdriBFsDdx9x6ZurH8wWhw+qGmFJntdP8xDOgK6xIqlsfm4fluBbhRU9Hs 3z3ZZIPLKIWwpCNKA8dzEiomol2wkmudu+zG2e5PShVPcHfaOH8G2mhQr57gbLlLpvCa CDxg== 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; bh=bdVVsGPXouJmLOsv1gWqtlrnZ71v/RqKPQFmQQ50OvE=; b=UITJCCl2UJFzrqpocnxJL6gm0y6OEfyrAPRiBIbwghWSiFtWJpsPyTZrmoVSwz2fQw C8NXM3pyTljvCBui9Ba4mqH8ruAffNweAjWpba+zwy8up0wj76KNoVLEmCA84iKDO9xV BYKeRWUwMYhP1o+ae5TqIDby0sbeJsX5DlNB9X8ixKKBnCSrevV/oXRrVrHw6+ZMslbw kbu/t3T3HDaFLH8t+iNQnQRXUSYAQnyuUCR5auJM9fwQZQ5P3YuuLO2jcwfCQOL+1HMs FEBSEr3cwP/YX+2wz4E3GI9xdtNIBngXkepMYFiDu4oA33jMyKjrM+tlklRqaQYU6xwX gp6A== X-Gm-Message-State: AOAM530DwISpOC84pV7vEG1JAzCYBEVi0OGFUmF89fRYVYmEDXOXNLCd dYIMZPEiSnqrqWxTmhuxgYTVT4goip0= X-Google-Smtp-Source: ABdhPJyy7FQr6avtRbf3mNo+Lt+vXjE69A8cByTlpZvThNxHSHIKu53dw+kawzKQkuatrd+mSvjpWg== X-Received: by 2002:a17:902:74cc:b029:da:9287:2b4 with SMTP id f12-20020a17090274ccb02900da928702b4mr2485984plt.9.1606775990706; Mon, 30 Nov 2020 14:39:50 -0800 (PST) Received: from branjam-ASM100 ([2601:601:1980:1a40:ccee:479c:6c02:453a]) by smtp.gmail.com with ESMTPSA id h32sm7947pgl.36.2020.11.30.14.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 14:39:49 -0800 (PST) From: Brandon Ellington To: zimoun , help-guix@gnu.org Subject: Re: Reproducing a Python project environment (using guix inferiors) In-Reply-To: <86sg8rvwgr.fsf@gmail.com> References: <87czzw6hid.fsf@branjam-ASM100.i-did-not-set--mail-host-address--so-tickle-me> <86sg8rvwgr.fsf@gmail.com> Date: Mon, 30 Nov 2020 14:39:49 -0800 Message-ID: <875z5m5v0q.fsf@branjam-ASM100.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=branjam4@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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-Mailman-Approved-At: Mon, 30 Nov 2020 17:51:25 -0500 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.99 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=GexRMDML; 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: 5CD6C94042C X-Spam-Score: -1.99 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: 1Tj5Dzlhwlkc --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks for replying simon! zimoun writes: > I am not sure to understand what you are naming =E2=80=9Cinferior=E2=80= =9D here. Sorry for the ambiguity, was not being self-deprecating. I meant attempts to use certain guix inferiors as described in the guix manual failed (from Package Management > Inferiors): > Sometimes you might need to mix packages from the revision of Guix > you=E2=80=99re currently running with packages available in a different > revision of Guix. Guix =E2=80=9Cinferiors=E2=80=9D allow you to achieve = that by > composing different Guix revisions in arbitrary ways. So answering your questions about what I did: >> [4] >> | 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 | > 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. > 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. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=guix-inferiors.scm Content-Description: python-cna-guix-inferiors.scm (define-module (cna-manifests guix-inferiors) #:use-module (guix inferior) #:use-module (guix channels)) (define python-matplotlib-channel ;; This is the old revision from which we want to ;; extract python-matplotlib. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "7e06086522")))) (define-public python-matplotlib-inferior ;; An inferior representing the revision for python-matplotlib. (inferior-for-channels python-matplotlib-channel)) (define python-pandas-channel ;; This is the old revision from which we want to ;; extract python-pandas. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "ce2cfcabfc")))) (define-public python-pandas-inferior ;; An inferior representing the revision for python-pandas. (inferior-for-channels python-pandas-channel)) (define python-networkx-channel ;; This is the old revision from which we want to ;; extract python-networkx. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "269f100330")))) (define-public python-networkx-inferior ;; An inferior representing the revision for python-networkx. (inferior-for-channels python-networkx-channel)) (define python-numpy-channel ;; This is the old revision from which we want to ;; extract python-numpy. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "4d6ed794dd")))) (define-public python-numpy-inferior ;; An inferior representing the revision for python-numpy. (inferior-for-channels python-numpy-channel)) (define python-scipy-channel ;; This is the old revision from which we want to ;; extract python-scipy. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "02ddafef55")))) (define-public python-scipy-inferior ;; An inferior representing the revision for python-scipy. (inferior-for-channels python-scipy-channel)) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> [3] >> #+begin_example scheme >> In current input: >> 12:3 12 (_) >> In guix/store.scm: > > [...] > >> 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 >> But how would I know what a "good" guix inferior commit is for all of >> these packages? > > Let=E2=80=99s fix ideas and let=E2=80=99s say you are interested by the p= ackage > python-foo at the version 1.2.3. This package depends on python-bar at > version x.y.z available at commit range 12345-67890 and on python-baz at > version m.n available at commit range ABCDE-FGHIJ. > > Then there is no commit where python-bar *and* python-baz are both at > the correct versions (resp. x.y.z and m.n.). In other words, the 2 > commit ranges 12345-67890 and ABCDE-FGHIJ do not overlap. > > Is it your use case? 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. > 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 seems= 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. >> Believing guix could more faithfully/cleanly reproduce the environment >> from the book than my former approach using pip, I: >> + imported/wrote definitions for packages not in guix > > Usually, this is done via the option =E2=80=9C--load-path=E2=80=9D or Cus= tom Channels. > > True, I have older generations with my repo as a channel: #+BEGIN_EXAMPLE bash cna-python 35290a1 repository URL: https://github.com/branjam4/cna-python.git branch: master commit: 35290a12d09ad528babba6052d37bcd09bd4c9a4 guix 0e1b095 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 0e1b0958bde5ccc34a4fed9a09cf949d5f9c9519 #+END_EXAMPLE 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. >> + wrote inferiors for older versions of packages that were in guix. > > You might be interested by this Channel: > > > I see. First looked at this channel a few days ago, but went straight to its package definitions and only skimmed the readme (which at the beginning mentioned using software from ten years ago, throwing me off from accepting it for my use case). Under the "Hacking" section it says: > It makes most sense to add software dating back to before 2019, around > the time where time travel became possible. The packages I'm trying to reproduce would have been current in mid 2017. Does that mean neither guix inferiors nor guix time-machine will work reliably for commits in that year? > BTW, a tool to find the range of commit where one specific version is > available is the Data Service. Give a look at: > > > Thanks, this definitely seems more robust than my git log grepping! > I have tried to write a script for my personal needs running via =E2=80= =9Cguix > repl=E2=80=9D. It fetches the JSON file from the Data Service, which giv= e the > commit range for the required version per package. Then I have not > finished it (yet) but the idea was to be able to spot out the commit > providing all the packages at the required versions, i.e., the > intersection. Pieces of the necessary material is in guix/git.scm. > > Ah, definitely intriguing. While I was on my grepping expedition I wondered whether I could use one or two old guix commits instead of five, so I like this concept. > Being on a foreign distro does not change. The main difference between > between foreign and native is only about services, not packages. Figured, thank you for confirming. --Brandon --=-=-=--