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 6OtoBBtCD2BIZgAA0tVLHw (envelope-from ) for ; Mon, 25 Jan 2021 22:11:39 +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 cLs4ABtCD2CORwAAB5/wlQ (envelope-from ) for ; Mon, 25 Jan 2021 22:11:39 +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 A450E940480 for ; Mon, 25 Jan 2021 22:11:38 +0000 (UTC) Received: from localhost ([::1]:50804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4A5B-00016Y-IL for larch@yhetil.org; Mon, 25 Jan 2021 17:11:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4A4P-0000X1-68 for guix-devel@gnu.org; Mon, 25 Jan 2021 17:10:49 -0500 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:35629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4A4L-00080c-KL; Mon, 25 Jan 2021 17:10:48 -0500 Received: by mail-qk1-x733.google.com with SMTP id g19so192921qki.2; Mon, 25 Jan 2021 14:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=m4S7YZkFdFC/11OH0nOSGVKwjJWrNJCfpnIM7jL83Jw=; b=ScyWDpCGG7n+2ZtfmEJXj/7GJZhijy5A/Pimsy512GrkfBNlw/4ZCURwCoCZ0keXrc 6gmqnLVZI2gat77LVEPGP+B4K53u5NpAi0YsIMdPh/aMntGk6lm8KiKlKBo90kkPqcFx YmGFiADsU0V2n7NN6AlVL3nJM8O91tV/0yUbKR06c9OlyddMoG2VfYYppHcQN5oRSkZ2 7v4BVfG+htFpVblExrcdabkY/mvp8hzi+y/SMCHjA/+J5NDBWeW8Fk/qfTBlMMnxDPJS 0mf37BfipOLX86kfHD63A7+/CtXgDeGw0mbaW4sMk5dqOs1fHX2v2D61i+p3HVweodGy Oj4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=m4S7YZkFdFC/11OH0nOSGVKwjJWrNJCfpnIM7jL83Jw=; b=QXWpC16gKRroo1Fq+4xOZOKylsKMo0Ly5kij6JK70CR4Zy0hp5yo9yuGhNb/HszGCl 9rj394R4qNTs2jN0EijtZkPjO0++ul6lf1rkCYuXDXm8I9grj31omLYrO842buqYzpaQ 9QaPYlle1AlkYHFttRhgOYtH3uBcSfDNKAs6m79X2xUZev6xeWMRbGz3HcmfWPNsl+Vg etyuyCWUhD8/ChJ90y4JwvFSRwFsFw9Q4qukttDiAjqCD/h5U80jG2/7Vbm97Tyi2env vnozksYnATMuP0kyA+LfjhCgy0E39F5mZlcOedxPhshGENFxGl/WRNYNdV35DqQZ0LtB UVcQ== X-Gm-Message-State: AOAM531qIRHYgIA68v95lvS2ftv+oKUCy4vicX2j3DDUvg/ML2ORdzdy +0bQwwAwksbbh5qjFq8Ti4UWBjtqywQesQ== X-Google-Smtp-Source: ABdhPJyynimYdVbMIZNfA/bEAufD+PrTrL37loLc2FY5ToWmUy1wYpeDgAscBI8t6Rb1I4tSDKdjiw== X-Received: by 2002:a37:bc81:: with SMTP id m123mr3005849qkf.191.1611612643692; Mon, 25 Jan 2021 14:10:43 -0800 (PST) Received: from hurd (dsl-10-132-34.b2b2c.ca. [72.10.132.34]) by smtp.gmail.com with ESMTPSA id b12sm12427142qtt.74.2021.01.25.14.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 14:10:42 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: 03/163: build/python: Add a new guix-pythonpath procedure. References: <20210125070022.22870.17321@vcs0.savannah.gnu.org> <20210125070114.03C0B20E1C@vcs0.savannah.gnu.org> <87czxs3d1i.fsf@gnu.org> Date: Mon, 25 Jan 2021 17:10:41 -0500 In-Reply-To: <87czxs3d1i.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 25 Jan 2021 22:46:33 +0100") Message-ID: <878s8g3bxa.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x733.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: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ScyWDpCG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: A450E940480 X-Spam-Score: -3.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: oXRTSqZ12CW4 Hi Ludovic! Ludovic Court=C3=A8s writes: > Hi! > > guix-commits@gnu.org skribis: > >> apteryx pushed a commit to branch cu/farewell-to-pythonpath >> in repository guix. > > Woow! > >> commit c3c5bdd2b0ea4588ecba424fdbf6df101d967d3d >> Author: Maxim Cournoyer >> AuthorDate: Fri Jan 22 09:34:33 2021 -0500 >> >> build/python: Add a new guix-pythonpath procedure. >>=20=20=20=20=20 >> This procedure will be used in place where the static "PYTHONPATH" s= tring used >> to be. >>=20=20=20=20=20 >> * guix/build/python-build-system.scm (guix-pythonpath): New procedur= e. > > [...] > >> +(define (guix-pythonpath inputs) >> + "Derive the GUIX_PYTHONPATH_X_Y string , with the major and minor ver= sion >> +numbers substituted for X and Y, respectively." >> + (let ((python (assoc-ref inputs "python"))) >> + (string-append "GUIX_PYTHONPATH_" >> + (string-replace-substring (python-version python) ".= " "_")))) > > One pattern used elsewhere, notably for =E2=80=98GUIX_LOCPATH=E2=80=99, i= s to still keep > a single environment variable (that=E2=80=99d be =E2=80=98GUIX_PYTHONPATH= =E2=80=99 here) but to > ensure that only MAJOR.MINOR sub-directories are taken into > consideration. > > IOW, instead of having GUIX_PYTHONPATH_3_8 and GUIX_PYTHONPATH_2_7, > you=E2=80=99d have just GUIX_PYTHONPATH but Python 3.8 would only care ab= out > 3.8/ sub-directories while 2.7 would only care about 2.7/ > sub-directories. > > That=E2=80=99s perhaps easier to document and to deal with generally (you= only > need to look at one specific environment variable). > > Does that make sense? I don=E2=80=99t know if it=E2=80=99s applicable in= this case > though. One of the limitations lifted by this change is the limitation of running a single version of Python per profile. As mentioned in past discussions, it's not trivial ensuring that packages installed won't end up pulling various versions of Python in a same profile, so it's better to prepared for it :-). Using a non-versioned GUIX_PYTHONPATH would not allow for this, unless I'm missing something. Thanks! Maxim