GNU bug report logs - #70227
[PATCH 0/2] Improving composer import.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Nicolas Graves <ngraves@HIDDEN>; Keywords: patch; dated Sat, 6 Apr 2024 02:05:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 70227 <at> debbugs.gnu.org:


Received: (at 70227) by debbugs.gnu.org; 18 Jul 2024 09:21:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 18 05:21:33 2024
Received: from localhost ([127.0.0.1]:36916 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sUNKP-000799-1r
	for submit <at> debbugs.gnu.org; Thu, 18 Jul 2024 05:21:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1sUNKN-00078u-46
 for 70227 <at> debbugs.gnu.org; Thu, 18 Jul 2024 05:21:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1sUNK9-0008RE-Rc; Thu, 18 Jul 2024 05:21:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=RzlWJZBI+3Sh6+FGXMVZIhXkD+pgXEcmpkr0BWILmNI=; b=lRLHIL4gWLiGhaxc+y5d
 1e5guvw5/kqW1mzs6GQ00nOAZqS/kwRPqaysHB0jT7K+jRIDd/pNuidxeM9YIlM4f9jtfvAOuaAp9
 ryUI+oWPW1rl6A73vsWZRagvHk6a9NetXX8KYwkXVz3W/e/8NxcaUK/yjfOqRmiLPrdjLRfRQJIBK
 V+3zJduVQt01OuEKZjDWmJCZha4015QEFlzabaiqd9kI/5ixOMIOwBBvTTrSlb13Vdfu3OGmeVEVD
 aJIRrw//0WILI1FNCjkOFj7MRidAys4gKYn2E4wxDA77ZDghytep+SkJqi8eKlSZa9uwj7wWN6hlk
 /FaT48JoGi2z/A==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: jgart <jgart@HIDDEN>
Subject: Re: [PATCH 0/2] Improving composer import.
In-Reply-To: <87le25e7f5.fsf@HIDDEN> (jgart@HIDDEN's message of "Sat, 
 13 Jul 2024 08:41:02 -0500")
References: <87le25e7f5.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Primidi 1 Thermidor an 232 de la =?utf-8?Q?R=C3=A9vo?=
 =?utf-8?Q?lution=2C?= jour de =?utf-8?Q?l'=C3=89pautre?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 18 Jul 2024 11:21:14 +0200
Message-ID: <87v813vywl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70227
Cc: Nicolas Graves <ngraves@HIDDEN>, 70227 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

jgart <jgart@HIDDEN> skribis:

> Feel free to send a v2 if you find the time with ludo's suggestions.

Oh yes, we were close to the finish line!

(Thanks jgart for following up on these forgotten issues; much
appreciated.)

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.

Message received at 70227 <at> debbugs.gnu.org:


Received: (at 70227) by debbugs.gnu.org; 13 Jul 2024 13:41:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 13 09:41:14 2024
Received: from localhost ([127.0.0.1]:55321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sSczy-0001Mj-99
	for submit <at> debbugs.gnu.org; Sat, 13 Jul 2024 09:41:14 -0400
Received: from mx2.dismail.de ([159.69.191.136]:20275)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jgart@HIDDEN>) id 1sSczw-0001MU-8z
 for 70227 <at> debbugs.gnu.org; Sat, 13 Jul 2024 09:41:13 -0400
Received: from mx2.dismail.de (localhost [127.0.0.1])
 by mx2.dismail.de (OpenSMTPD) with ESMTP id c4caae5e;
 Sat, 13 Jul 2024 15:41:05 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc
 :subject:in-reply-to:date:message-id:mime-version:content-type;
 s=20190914; bh=So9qDRXcJIv/h9lm2yLK3ytZmr12MSNTtWLjrdB3yKU=; b=
 F0OsA/EF1n89kx2HrPDomgTqiu2naQ6WkTj3XXHXYfGDM/lbd5/d6OqtgrefwWiO
 V2BJKV8y+zXsvRo3RGXsSztrq//ohIeFKeyAKWRQKdamXtuZZJD1w+5EgeqNKsQU
 NXBMleyUz7rkt7NMtyO4CH24eLcImHMoVI7zbRp4f5BtYZs8RYboQKC4s/T/OGT8
 D+9qtXMuI0INzdipN02lSCE6i2UzV42IkF4aYa5XckGTW2s7kheNHhSQfvCOJsBB
 4jLKLeZ4ydUBA2zXItkzr2FCcR+9/xv27TpEpAYRTT6oRIbJDoTLV6kTJaqAQlgc
 9mLnInfRP2R9UrJJOkNxqQ==
Received: from smtp1.dismail.de (<unknown> [10.240.26.11])
 by mx2.dismail.de (OpenSMTPD) with ESMTP id b69bbede;
 Sat, 13 Jul 2024 15:41:05 +0200 (CEST)
Received: from smtp1.dismail.de (localhost [127.0.0.1])
 by smtp1.dismail.de (OpenSMTPD) with ESMTP id 1f3b6460;
 Sat, 13 Jul 2024 15:41:05 +0200 (CEST)
Received: by dismail.de (OpenSMTPD) with ESMTPSA id 10e8ebd0
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sat, 13 Jul 2024 15:41:04 +0200 (CEST)
From: jgart <jgart@HIDDEN>
To: 70227 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/2] Improving composer import.
In-Reply-To: <87wmofzwl3.fsf@HIDDEN>
Date: Sat, 13 Jul 2024 08:41:02 -0500
Message-ID: <87le25e7f5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70227
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Nicolas Graves <ngraves@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Hi Nicolas,

Are you still working on this ticket?

Feel free to send a v2 if you find the time with ludo's suggestions.
-- 
all the best,
jgart




Information forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.

Message received at 70227 <at> debbugs.gnu.org:


Received: (at 70227) by debbugs.gnu.org; 29 Apr 2024 21:30:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 17:30:18 2024
Received: from localhost ([127.0.0.1]:58825 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1YZl-0003TA-W0
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 17:30:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1s1YZi-0003T0-Gz
 for 70227 <at> debbugs.gnu.org; Mon, 29 Apr 2024 17:30:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1s1YZH-0002mq-Bp; Mon, 29 Apr 2024 17:29:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=YrABkmJyjx/v5bMOef0TQQEg7Di2/c5CGFCuPXm9L2c=; b=H1r0LiKezLyn61UIi7Px
 p5iA7rn1ldR8QcBH+74oSpxeICVRKQlWR0H3VrKcpmdwhjyfYzwiKFlyxGER3/IG+XZWchf669Aax
 INEvUDBXcQp1noreu17h9CJUcozfflI7x5aowGhhVeRBEY6rma1FgM8Wnm99xWZ6tScg8N7aUrxoj
 Spc9kf0Pes1ukP2N1zoisofz5iO66iJ6qQkQxj49+WvHTxJPpwYmeroGa22YcWjzzD9+Z5AX17oTP
 hdvqGJZQZWVOtvvu6HXud0HSf7l1Q28bgT6DUlUBu47WKQZ1nSheRC0qhiiKqNPxI4Izr5HV216Xu
 WRptUaNfSvQcvw==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Nicolas Graves <ngraves@HIDDEN>
Subject: Re: [bug#70227] [PATCH 2/2] guix: import: composer: Implement
 recursive package refresh.
In-Reply-To: <20240406020852.15996-2-ngraves@HIDDEN> (Nicolas Graves's
 message of "Sat, 6 Apr 2024 04:08:51 +0200")
References: <20240406020852.15996-1-ngraves@HIDDEN>
 <20240406020852.15996-2-ngraves@HIDDEN>
Date: Mon, 29 Apr 2024 23:29:44 +0200
Message-ID: <87wmofzwl3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70227
Cc: 70227 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Nicolas Graves <ngraves@HIDDEN> skribis:

> * guix/import/composer.scm
>  (composer-fetch): Replace reduce by fold to correct version selection
>  logic.
>  (latest-release): Implement recursive package refresh. Rename to
>  import-release.
>  (import-release): New function, formerly known as latest-release.

Nice, glad to see this feature put to good use.  :-)


[...]

> +(define* (import-release package #:key (version #f))
> +  "Return an <upstream-source> for VERSION or the latest release of PACK=
AGE."
>    (let* ((php-name (guix-package->composer-name package))
>           (composer-package (composer-fetch php-name #:version version)))
>      (if composer-package
> -        (upstream-source
> -         (package (composer-package-name composer-package))
> -         (version (composer-package-version composer-package))
> -         (urls (list (composer-source-url
> -                      (composer-package-source composer-package)))))
> +        (let* ((guix-name (composer-package-name composer-package))
> +               (inputs
> +                (append
> +                 (map (lambda (dep)
> +                        (upstream-input
> +                         (name php-name)
> +                         (downstream-name guix-name)
> +                         (type 'regular)))
> +                      (composer-package-require composer-package))
> +                 (map (lambda (dep)
> +                        (upstream-input
> +                         (name php-name)
> +                         (downstream-name guix-name)
> +                         (type 'native)))

Shouldn=E2=80=99t it be:

  (upstream-input
    (name dep)
    (downstream-name (php-package-name dep))
    (type =E2=80=A6))

?

As a slight improvement, since the =E2=80=98inputs=E2=80=99 field of <upstr=
eam-source>
is delayed (wrapped in a promise, so that its computation only happens
when it=E2=80=99s needed), you could arrange to replace the =E2=80=98inputs=
=E2=80=99 variable
above like so:

  (define (dependency->input dependency type)
    (upstream-input =E2=80=A6))

  (upstream-source
    ;; =E2=80=A6
    (inputs (append (map (cut dependency->input <> 'regular) =E2=80=A6)
                    (map (cut dependency->input <> 'native) =E2=80=A6))))

I hope this makes sense.

Thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.

Message received at 70227 <at> debbugs.gnu.org:


Received: (at 70227) by debbugs.gnu.org; 6 Apr 2024 02:09:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 05 22:09:14 2024
Received: from localhost ([127.0.0.1]:37882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rsvUX-00085S-Qb
	for submit <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:09:14 -0400
Received: from 7.mo561.mail-out.ovh.net ([46.105.57.200]:36971)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1rsvUU-000856-He
 for 70227 <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:09:11 -0400
Received: from director3.ghost.mail-out.ovh.net (unknown [10.109.139.217])
 by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4VBJgg1Q3Zz1Mfl
 for <70227 <at> debbugs.gnu.org>; Sat,  6 Apr 2024 02:09:03 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-p9bpr (unknown [10.110.168.159])
 by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 053541FD43;
 Sat,  6 Apr 2024 02:09:02 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.102])
 by ghost-submission-6684bf9d7b-p9bpr with ESMTPSA
 id dnUFOr6uEGYDrQIADCYBAg
 (envelope-from <ngraves@HIDDEN>); Sat, 06 Apr 2024 02:09:02 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-102R00462e35e1e-cec0-4859-8cdd-c3807333bc31,
 864EC9CA9318039CF6D4BAE14C4DDD6D93296F2D) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 90.110.172.34
From: Nicolas Graves <ngraves@HIDDEN>
To: 70227 <at> debbugs.gnu.org
Subject: [PATCH 2/2] guix: import: composer: Implement recursive package
 refresh.
Date: Sat,  6 Apr 2024 04:08:51 +0200
Message-ID: <20240406020852.15996-2-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20240406020852.15996-1-ngraves@HIDDEN>
References: <20240406020852.15996-1-ngraves@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 12591783085524509410
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeguddgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddruddutddrudejvddrfeegpdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtddvvdejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70227
Cc: ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/import/composer.scm
 (composer-fetch): Replace reduce by fold to correct version selection
 logic.
 (latest-release): Implement recursive package refresh. Rename to
 import-release.
 (import-release): New function, formerly known as latest-release.

Change-Id: I8f629b4d1da866f5986d39b4e159f2b44af9ee49
---
 guix/import/composer.scm | 34 +++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 75419ca63e..e2a60969aa 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -113,7 +113,7 @@ (define* (composer-fetch name #:key (version #f))
          (if version
              (assoc-ref packages version)
              (cdr
-              (reduce
+              (fold
                (lambda (new cur-max)
                  (match new
                    (((? valid-version? version) . tail)
@@ -243,16 +243,32 @@ (define (php-package? package)
    (eq? (package-build-system package) composer-build-system)
    (string-prefix? "php-" (package-name package))))
 
-(define* (latest-release package #:key (version #f))
-  "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an <upstream-source> for VERSION or the latest release of PACKAGE."
   (let* ((php-name (guix-package->composer-name package))
          (composer-package (composer-fetch php-name #:version version)))
     (if composer-package
-        (upstream-source
-         (package (composer-package-name composer-package))
-         (version (composer-package-version composer-package))
-         (urls (list (composer-source-url
-                      (composer-package-source composer-package)))))
+        (let* ((guix-name (composer-package-name composer-package))
+               (inputs
+                (append
+                 (map (lambda (dep)
+                        (upstream-input
+                         (name php-name)
+                         (downstream-name guix-name)
+                         (type 'regular)))
+                      (composer-package-require composer-package))
+                 (map (lambda (dep)
+                        (upstream-input
+                         (name php-name)
+                         (downstream-name guix-name)
+                         (type 'native)))
+                      (composer-package-dev-require composer-package)))))
+          (upstream-source
+           (package guix-name)
+           (version (composer-package-version composer-package))
+           (urls (list (composer-source-url
+                        (composer-package-source composer-package))))
+           (inputs inputs)))
         (begin
           (warning (G_ "failed to parse ~a~%") php-name)
           #f))))
@@ -262,7 +278,7 @@ (define %composer-updater
    (name 'composer)
    (description "Updater for Composer packages")
    (pred php-package?)
-   (import latest-release)))
+   (import import-release)))
 
 (define* (composer-recursive-import package-name #:optional version)
   (recursive-import package-name
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.

Message received at 70227 <at> debbugs.gnu.org:


Received: (at 70227) by debbugs.gnu.org; 6 Apr 2024 02:09:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 05 22:09:11 2024
Received: from localhost ([127.0.0.1]:37880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rsvUV-00085E-91
	for submit <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:09:11 -0400
Received: from 6.mo561.mail-out.ovh.net ([188.165.43.173]:50387)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1rsvUS-00084z-Di
 for 70227 <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:09:10 -0400
Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.148.65])
 by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4VBJgc6YK9z1LDx
 for <70227 <at> debbugs.gnu.org>; Sat,  6 Apr 2024 02:09:00 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-dmdhw (unknown [10.110.178.161])
 by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 97E611FD5D;
 Sat,  6 Apr 2024 02:09:00 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.109])
 by ghost-submission-6684bf9d7b-dmdhw with ESMTPSA
 id WweFIbyuEGYRYA0AUrkRxw
 (envelope-from <ngraves@HIDDEN>); Sat, 06 Apr 2024 02:09:00 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-109S00371c7ceb8-b3a7-4d0e-9a85-c90810f78b1e,
 864EC9CA9318039CF6D4BAE14C4DDD6D93296F2D) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 90.110.172.34
From: Nicolas Graves <ngraves@HIDDEN>
To: 70227 <at> debbugs.gnu.org
Subject: [PATCH 1/2] guix: import: composer: Handle parsing failures.
Date: Sat,  6 Apr 2024 04:08:50 +0200
Message-ID: <20240406020852.15996-1-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 12590938660711686882
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeguddgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdeltddruddutddrudejvddrfeegpdefjedrheelrddugedvrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtddvvdejseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70227
Cc: ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/import/composer (latest-release): Handle parsing
failures. Rename package to composer-package for clarity.

Change-Id: I57f6fba7b05122b031177681e76cf0b5c9547736
---
 guix/import/composer.scm | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 1ad608964b..75419ca63e 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -243,16 +243,19 @@ (define (php-package? package)
    (eq? (package-build-system package) composer-build-system)
    (string-prefix? "php-" (package-name package))))
 
-(define (latest-release package)
+(define* (latest-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((php-name (guix-package->composer-name package))
-         (package (composer-fetch php-name))
-         (version (composer-package-version package))
-         (url (composer-source-url (composer-package-source package))))
-    (upstream-source
-     (package (package-name package))
-     (version version)
-     (urls (list url)))))
+         (composer-package (composer-fetch php-name #:version version)))
+    (if composer-package
+        (upstream-source
+         (package (composer-package-name composer-package))
+         (version (composer-package-version composer-package))
+         (urls (list (composer-source-url
+                      (composer-package-source composer-package)))))
+        (begin
+          (warning (G_ "failed to parse ~a~%") php-name)
+          #f))))
 
 (define %composer-updater
   (upstream-updater
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Apr 2024 02:04:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 05 22:04:44 2024
Received: from localhost ([127.0.0.1]:37874 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rsvQC-0007jg-Jy
	for submit <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:04:44 -0400
Received: from lists.gnu.org ([2001:470:142::17]:60606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1rsvQ7-0007il-Fu
 for submit <at> debbugs.gnu.org; Fri, 05 Apr 2024 22:04:43 -0400
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 <ngraves@HIDDEN>)
 id 1rsvPv-0001SA-RA
 for guix-patches@HIDDEN; Fri, 05 Apr 2024 22:04:27 -0400
Received: from 4.mo550.mail-out.ovh.net ([46.105.76.26])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>)
 id 1rsvPt-0005Ru-92
 for guix-patches@HIDDEN; Fri, 05 Apr 2024 22:04:27 -0400
Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.176.101])
 by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4VBJZD6c1yz1BBF
 for <guix-patches@HIDDEN>; Sat,  6 Apr 2024 02:04:20 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-cpk2g (unknown [10.111.182.166])
 by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 95C541FD0F;
 Sat,  6 Apr 2024 02:04:20 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.106])
 by ghost-submission-6684bf9d7b-cpk2g with ESMTPSA
 id 1yY7HKStEGYRJwQAMM2uZg
 (envelope-from <ngraves@HIDDEN>); Sat, 06 Apr 2024 02:04:20 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-106R0067e2b7e93-1152-45b5-82c7-638e653213c9,
 864EC9CA9318039CF6D4BAE14C4DDD6D93296F2D) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 90.110.172.34
From: Nicolas Graves <ngraves@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Improving composer import.
Date: Sat,  6 Apr 2024 04:04:15 +0200
Message-ID: <20240406020415.9360-1-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 12512125664780804834
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudeguddgheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdeltddruddutddrudejvddrfeegpdefjedrheelrddugedvrddutdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheehtddpmhhouggvpehsmhhtphhouhht
Received-SPF: pass client-ip=46.105.76.26; envelope-from=ngraves@HIDDEN;
 helo=4.mo550.mail-out.ovh.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

This patch series superseeds former patches 67895, 67897 and 67906.
It fixes bugs, handles parsing failures and implements recursive package refresh.

Nicolas Graves (2):
  guix: import: composer: Handle parsing failures.
  guix: import: composer: Implement recursive package refresh.

 guix/import/composer.scm | 41 +++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 11 deletions(-)

-- 
2.41.0





Acknowledgement sent to Nicolas Graves <ngraves@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#70227; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 18 Jul 2024 09:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.