From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Uu/ZKhdVsmAO0AAAgWs5BA (envelope-from ) for ; Sat, 29 May 2021 16:52:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sEerJRdVsmBXRgAAbx9fmQ (envelope-from ) for ; Sat, 29 May 2021 14:52:07 +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 C122A21888 for ; Sat, 29 May 2021 16:52:06 +0200 (CEST) Received: from localhost ([::1]:35428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln0Jp-0000el-MP for larch@yhetil.org; Sat, 29 May 2021 10:52:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln0Jl-0000eO-Ta for guix-patches@gnu.org; Sat, 29 May 2021 10:52:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ln0Jl-0002Tq-Ls for guix-patches@gnu.org; Sat, 29 May 2021 10:52:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ln0Jl-0006au-JG for guix-patches@gnu.org; Sat, 29 May 2021 10:52:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47869] [PATCH core-updates] =?UTF-8?Q?=E2=80=98which=E2=80=99?= looks in PATH, incorrect when cross-compiling Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 29 May 2021 14:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47869 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 47869@debbugs.gnu.org Received: via spool by 47869-submit@debbugs.gnu.org id=B47869.162229986625280 (code B ref 47869); Sat, 29 May 2021 14:52:01 +0000 Received: (at 47869) by debbugs.gnu.org; 29 May 2021 14:51:06 +0000 Received: from localhost ([127.0.0.1]:57533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln0Ir-0006Zg-SJ for submit@debbugs.gnu.org; Sat, 29 May 2021 10:51:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln0In-0006Z6-KL for 47869@debbugs.gnu.org; Sat, 29 May 2021 10:51:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45066) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln0Ii-0001gS-6j; Sat, 29 May 2021 10:50:56 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40280 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln0Ih-00071U-D1; Sat, 29 May 2021 10:50:55 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <0892bdfbc097b07631190c8526a41d57b456d343.camel@telenet.be> <87v97f7oll.fsf_-_@gnu.org> <343ead490dec84fec8694d2411963d3a80d27166.camel@telenet.be> Date: Sat, 29 May 2021 16:50:53 +0200 In-Reply-To: <343ead490dec84fec8694d2411963d3a80d27166.camel@telenet.be> (Maxime Devos's message of "Tue, 18 May 2021 23:25:28 +0200") Message-ID: <87wnrha90y.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622299926; 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; bh=loQq5TFHM0UjhH5WnPI9lKlkI/lJYocupFFqaeTfW1M=; b=BbV0ixjercqVFJyw9hQ5qTGJ4RqhwfyTv96Q4kXGKWqYq5RG7cednmmB7kyz+deQJhjFw+ ttY/CST9p9sT/PCChJ9Vbsl9C4UIHKIz7xvxflF7e1EO4ZNhrFo9Lb4nOya9SOwQ/8ucgH joH0645O+PsuQnaKgu1DugypT+eqSkiSMmrSGTAfdgYWj97lwlJ8Awj9r/HySLMFokcN0r q9iCgWea6soHH04vENo3slAGbjVTL5k5kuRcJSkcR89DbniIze6OAHczR4Az8Nt/vbH62m OStFxYruAqTEZVYUQ+iLGmJtoXTPX+vWErUKuNOpzvswkI4t01rQ77CgkMSflw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622299926; a=rsa-sha256; cv=none; b=N1+EuS4K9tX5Pf2KUWckVune5r5LO8DenrLAaN5zDmmiEqkvv/Sj7FZUdt5GGY8b/rNaO6 UeqdOZ7dxlpxQe/jN+ur/h++5IcYf7vqUDbFzgdo4MkbcmWR4quCooxs42gOVp/5GkliYz y+ax0NW6BWRB9OIKbxcNh5sVeI0eu4p83UfIHU7ILfVEBFJ/pIcNkB/5Z1y0HSilMn5Rxp JDq7soB2hlL0IR6NIEjEtf+CHwePyxivReDD7eDfGre7iyey/5qQIphMNiMRLMBGpChh/P CtFL2szU8IY09MNQ/5hlf1EgjAfAymVxPP85ad4zjBJhC6NdYGP9AMQtdOvJRg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C122A21888 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: M6JaU/h4Wx/n Hi Maxime, Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op di 18-05-2021 om 22:51 [+0200]: [...] >> The =E2=80=9Ccorrect=E2=80=9D way we do it right now is like >> this: >>=20 >> (lambda* (#:key outputs inputs #:allow-other-keys) >> (let ((out (assoc-ref outputs "out")) >> (curl (assoc-ref inputs "curl"))) >> (wrap-program (string-append out "/bin/akku") >> `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib= ")))) >> #t)) >>=20 >> Here, when cross-compiling, (assoc-ref inputs "curl") returns the target >> cURL. > > This is something that can be fixed on 'core-updates', right? Yes, it=E2=80=99s a good time for this! For now, we can even afford world rebuilds on =E2=80=98core-updates=E2=80=99. >> > From e78d2d8651d5f56afa7d57be78c5cccccebb117a Mon Sep 17 00:00:00 2001 >> > From: Maxime Devos >> > Date: Sun, 18 Apr 2021 20:44:28 +0200 >> > Subject: [PATCH 3/7] build: utils: Make inputs of 'wrap-script' explic= it. >> >=20 >> > Previously, 'wrap-script' used (which "guile") to determine where to l= ocate >> > the guile interpreter. But this is incorrect when cross-compiling. W= hen >> > cross-compiling, this would locate the (native) guile interpreter that= is >> > in the PATH, while a guile interpreter for the target is required. >> >=20 >> > Remove the optional #:guile argument which is only used in tests and r= eplace >> > it with a required 'inputs' argument and adjust all callers. Write a = new >> > test verifying a guile for the target is located, instead of a native = guile. >>=20 >> I think the #:guile argument was a fine interface: clear and >> to-the-point. The problem IMO is just that it=E2=80=99s not use where it >> should. :-) > > It should be used practically everywhere, no? So making it optional doesn= 't > make much sense to me when we want to support cross-compilation. Yes, and I agree that=E2=80=99s a difficulty. >> > (add-after 'install 'wrap-executables >> > - (lambda* (#:key outputs #:allow-other-keys) >> > + (lambda* (#:key inputs outputs #:allow-other-keys) >> > (let ((out (assoc-ref outputs "out"))) >> > - (wrap-script (string-append out "/bin/carla") >> > + (wrap-script (string-append out "/bin/carla") inputs >> > `("GUIX_PYTHONPATH" ":" prefix (,(getenv = "GUIX_PYTHONPATH")))) >>=20 >> This would become: >>=20 >> (wrap-script (string-append out "/bin/carla") >> `(=E2=80=A6) >> #:guile (assoc-ref inputs "guile")) >> >> WDYT? > > Ok, this looks a good interface to me, though I think > 'wrap-script' will need to be modified. IIRC, #:guile > must be the full file name of the guile binary and not > simply /gnu/store/[...]-guile-$VERSION. Good point. I think one could write: (wrap-script =E2=80=A6 #:guile (search-input-file inputs "/bin/guile")) which is more reasonable. > That should help with the verbosity. The previous code becomes > > (wrap-program (string-append libexec "/dhclient-script") > `("PATH" =E2=80=A6) > #:sh (search-input-file inputs "bin/sh")) > > which isn't overly verbose. > > This procedure 'search-input-file' would return #f if the input > was not found, right? I would rather it raises an exception instead. > There have been some bugs where "#f" was silently written into some file, > which is unlikely to work well. Agreed, let=E2=80=99s have =E2=80=98search-input-file=E2=80=99 raise an exc= eption if the file isn=E2=80=99t found. > For the few cases were the input binary is truly optional, > we can define a 'search-optional-input-file' procedure. Let=E2=80=99s ignore that until the problem shows up. >> > -@c TODO document wrap-program >> > +@deffn {Scheme Procedure} wrap-program @var{prog} @var{inputs} @var{v= ars} >> > +Make a wrapper for @var{prog}. @var{vars} should look like this: >> > + >> > +@lisp >> > + '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES) >> ^ >> You can remove indentation and use @var instead of capital letters. > > @var can be used inside @lisp? Didn't know that. Yes. Sorry for the delay, and thanks again! Ludo=E2=80=99.