From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mFNoKZal9mMBtwAAbAwnHQ (envelope-from ) for ; Thu, 23 Feb 2023 00:30:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IK53KJal9mOQeAAAG6o9tA (envelope-from ) for ; Thu, 23 Feb 2023 00:30:30 +0100 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 1704665B6 for ; Thu, 23 Feb 2023 00:30:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUyYt-0002If-WB; Wed, 22 Feb 2023 18:30:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUyYl-00023p-Aj for guix-patches@gnu.org; Wed, 22 Feb 2023 18:30:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUyYl-0005xb-0I for guix-patches@gnu.org; Wed, 22 Feb 2023 18:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUyYk-0002FD-RE for guix-patches@gnu.org; Wed, 22 Feb 2023 18:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61701] [PATCH] doc: Propose new cookbook section for reproducible research. Resent-From: Kyle Andrews Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Feb 2023 23:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61701 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier Cc: 61701@debbugs.gnu.org Received: via spool by 61701-submit@debbugs.gnu.org id=B61701.16771085868573 (code B ref 61701); Wed, 22 Feb 2023 23:30:02 +0000 Received: (at 61701) by debbugs.gnu.org; 22 Feb 2023 23:29:46 +0000 Received: from localhost ([127.0.0.1]:60659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUyYU-0002ED-66 for submit@debbugs.gnu.org; Wed, 22 Feb 2023 18:29:46 -0500 Received: from mout02.posteo.de ([185.67.36.66]:58897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUyYQ-0002Dx-3N for 61701@debbugs.gnu.org; Wed, 22 Feb 2023 18:29:45 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AF72F2405EC for <61701@debbugs.gnu.org>; Thu, 23 Feb 2023 00:29:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677108575; bh=oPX0RbyxQuk9ZYjrDpvfEPJgk5DF/fNfdzSEA/m7248=; h=From:To:Cc:Subject:Date:From; b=MgNdXe0G5jd368qwERCDonAH0vBtRgI8FXLiwtvMRQ58bEiZug50gGfzsMeqoQ3lf 2pQXjik6F/8wbCcP84WBCPbZAOW8bLtwvTeXbC8G4zRaQ2Mnvca3kGQF9yF9wVKWmy Y9mUQYTXuaXk8/PlUTHKWbUwNxlm2ZGPCF17Z/9fAyrezKV2XHVPIJXcqVp1qDDB4j ZuRH3egjtJh+hPCfv1rRT8n6YpqYtyulWmSmMbm9jnsbZNAeIuNGCbnLe/di00nJmz VKclpjmWr/ZE6ZJSDoicWZ66glw9C6vy+2Y9WxfqrPncgQocafTTMNmz9pKHSY/WMx P+oklgwXSwfXQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PMXRv6qsJz6tmB; Thu, 23 Feb 2023 00:29:30 +0100 (CET) References: <3ffea5b37541a6f3409299f3e8e6200bc1c9aef6.1677043049.git.kyle@posteo.net> <86h6vet1j8.fsf@gmail.com> From: Kyle Andrews Date: Wed, 22 Feb 2023 23:21:02 +0000 In-reply-to: <86h6vet1j8.fsf@gmail.com> Message-ID: <87a615wa7b.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677108630; a=rsa-sha256; cv=none; b=MCx9NVpHqrmzaLoqWrWe0yy4N0aRfpoYojGATuH5rcQsTO/zaxA0+Z0ZlUv76g/hbtZhaX PBCKFZKYj3NGpTk4ukoA3+BMqHWdGBlm3TwUnZOe9PTA9tguQGWEEjTfQHfMT1dlUC9OMT 41FIIANELrRr2JNzp2pcX7vfcW7luoUsGE7aXIWo195ymQDbewQfWljFVUx2oMboAZuuo8 mC+S5fi6jrDpTzOx+Wp4seK6v9QOMklYF9JSP7Y3jp7AD8KrR/SgTQbJ/zSgb3GfCHgqHL VBkLWdFEdbs7g/Bhy+xQXth9EzuNV/ucRSRwR4Ya8I2Vf4w7VHLxmo5AgbM2Yg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=MgNdXe0G; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677108630; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4doB9ePfB8dt0f0ojkaA6OT8+0QzZRIO9TY5aUIuUJo=; b=cK73elDemKcUddYwvUpVNH5HSuecHCwIYoH0N17u6oAjkPESucmbhjSSt01QzhPc5qJWwu A8WZdpwQzVrRstYqr5PWWUYnwdI7h1MLCNLicEavnMmdBoXjNDyHT3nchgaHa5poc72Dhy A1Sysy++WKJNFhEJsCmv234n2u7rAz6RLTVHIMhtdtKP575W482nwdbDWnoCZcald4GbBp 0BcUJVy4eINgagxoLRRpQdbdNpq+onsw8xNuOtDjW1kwhVtBHGJnLqlbhsa1PKWlVNpeQ3 /ze6tb6shlvH2KQqvLi0rMOtVZZMNsNJ3/u/FZdAzyk1ZnZfBruqnu8+6utcuw== X-Migadu-Spam-Score: 5.64 X-Spam-Score: 5.64 X-Migadu-Queue-Id: 1704665B6 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=MgNdXe0G; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none) X-TUID: sikjeWqjrxmX Simon Tournier writes: >> +(define python-apted >> + (package >> + (name "python-apted") >> + (version "1.0.3") >> + (source (origin >> + (method url-fetch) >> + (uri (pypi-uri "apted" version)) >> + (sha256 >> + (base32 >> + "1sawf6s5c64fgnliwy5w5yxliq2fc215m6alisl7yiflwa0m3ymy")))) >> + (build-system python-build-system) >> + (home-page "https://github.com/JoaoFelipe/apted") >> + (synopsis "APTED algorithm for the Tree Edit Distance") >> + (description "APTED algorithm for the Tree Edit Distance") >> + (license expat))) >> + >> +(define last-guix-with-python-3.6 >> + (list >> + (channel >> + (name 'guix) >> + (url "https://git.savannah.gnu.org/git/guix.git") >> + (commit >> + "d66146073def03d1a3d61607bc6b77997284904b")))) >> + >> +(define connection-to-last-guix-with-python-3.6 >> + (inferior-for-channels last-guix-with-python-3.6)) > > Why do you need an inferior? Is it to avoid the =E2=80=9Cguix time-machi= ne=E2=80=9D? > Ah, no the answer below. :-) > >> +(define first car) >> + >> +(define python-3.6 >> + (first >> + (lookup-inferior-packages >> + connection-to-last-guix-with-python-3.6 "python"))) >> + >> +(define python3.6-numpy >> + (first >> + (lookup-inferior-packages >> + connection-to-last-guix-with-python-3.6 "python-numpy"))) >> + >> +(define included-packages >> + (list r r-reticulate)) >> +=20 >> +(define inferior-packages >> + (list python-3.6 python3.6-numpy)) >> + >> +(define package-with-python-3.6 >> + (package-with-explicit-python python-3.6 >> + "python-" "python3.6-" 'python3-variant)) >> +=20 >> +(define custom-variant-packages >> + (list (package-with-python-3.6 python-apted))) >> + >> +(concatenate-manifest >> + (map packages->manifest >> + (list >> + included-packages >> + inferior-packages >> + custom-variant-packages))) > > While this is cool, I would not recommend it as some practise. This > kind of mix can lead to various annoyances, IMHO. First, it will scale > poorly if you add more inferiors. Second, the probability that the > resulting computational environment works well decreases. After experiencing the resulting compile time, I agree. I just don't know the best way to get a working python variant. I experimented today with: ``` (use-modules (guix profiles) (guix packages) (gnu packages) (ice-9 regex) (gnu packages python) (guix base32)) (define (origin-nix-hash source) (bytevector->nix-base32-string (content-hash-value (origin-hash source)))) (define-public (change-source source new-uri new-hash new-patches) (origin (inherit source) (uri new-uri) (sha256 (base32 new-hash)) (patches new-patches))) (define (python-distribution-uri version) (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) (define-public python-3.6.8 (define v "3.6.8") (package (inherit python-3) (version v) (source (change-source (package-source python-3.9) (python-distribution-uri v) "14qi6n5gpcjnwy165wi9hkfcmbadc95ny6bxxldknxwmx50n4i1m" (filter=20 (lambda (patch) (not (string-match "fix-tests|hurd" patch))) (origin-patches (package-source python-3.9))))))) (packages->manifest (list python-3.6.8)) ``` However, I ran into issues applying patches which I don't yet understand how to deal with. It would be really cool if Guix had a command which showed the state at each step in the process of creating a store object. Whatever the workflow and tacit knowledge you use to debug these things, I don't grasp it yet. >> diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm >> index c8f04b2298..d4aaab906d 100644 >> --- a/guix/build-system/python.scm >> +++ b/guix/build-system/python.scm >> @@ -36,6 +36,7 @@ (define-module (guix build-system python) >> #:use-module (srfi srfi-1) >> #:use-module (srfi srfi-26) >> #:export (%python-build-system-modules >> + package-with-explicit-python >> package-with-python2 >> strip-python2-variant >> default-python > > Maybe this could be a separated patch. That's a good idea. I suppose I could wrap it a bit with e.g. package-with-python3-variant.