From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ZDyyKLe6r2FIAAEAgWs5BA (envelope-from ) for ; Tue, 07 Dec 2021 20:49:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AAW5I7e6r2GZbQAA1q6Kng (envelope-from ) for ; Tue, 07 Dec 2021 19:49:11 +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 5981D14A7F for ; Tue, 7 Dec 2021 20:49:08 +0100 (CET) Received: from localhost ([::1]:38666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mugSZ-0002kw-Ch for larch@yhetil.org; Tue, 07 Dec 2021 14:49:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugSU-0002kf-OT for guix-patches@gnu.org; Tue, 07 Dec 2021 14:49:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mugSU-000513-HI for guix-patches@gnu.org; Tue, 07 Dec 2021 14:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mugSU-00019L-7i for guix-patches@gnu.org; Tue, 07 Dec 2021 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51845] Using =?UTF-8?Q?=E2=80=98native-inputs=E2=80=99?= and =?UTF-8?Q?=E2=80=98inputs=E2=80=99?= for Cargo packages? Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 51845@debbugs.gnu.org Received: via spool by 51845-submit@debbugs.gnu.org id=B51845.16389064924354 (code B ref 51845); Tue, 07 Dec 2021 19:49:02 +0000 Received: (at 51845) by debbugs.gnu.org; 7 Dec 2021 19:48:12 +0000 Received: from localhost ([127.0.0.1]:38682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mugRf-00018A-Mi for submit@debbugs.gnu.org; Tue, 07 Dec 2021 14:48:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mugRd-00017w-Ey for 51845@debbugs.gnu.org; Tue, 07 Dec 2021 14:48:10 -0500 Received: from [2001:470:142:3::e] (port=55596 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugRX-0004v9-TH; Tue, 07 Dec 2021 14:48:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=tUapdr+uTly3gtKwOnqqjY9RRRiFftpfcB9gVY94RBI=; b=KzjiLtgvXUssdD0gB0M8 dg3vQOWZp58NgXlpeW9eYR5WYCoUFE9fsuC2KDNutieTtz5u+CMUIbjNrvp8nmEyhAqG7pyM1j632 xfna0ksj8wgsJpV7WXFLXFSOEzKWFlpGj5CR70E/0iIzsdzyYpzTFG8Ug5zXwlx2Z5RTMk3KHKTkb F6poi7DHY7g8UUMcoXlcL10Rp5C7CGmH8L4w5bDS1tFPrYZKh3s2JjzGGYZWuyHpVf7SOocXzZx4U 3+QdiFFM6VXeLC348ZRTM7RAfTAdW3A99Ol9DB8Cl9/SnVBlB1JIFy8jsOseDJH/JY0hsncmfl+mx M4qYVPcgmYZ2rw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37112 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mugRX-0004qL-MX; Tue, 07 Dec 2021 14:48:04 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87zgpend04.fsf@gnu.org> <87wnkhlmfb.fsf@gnu.org> <405F2D9A-C0E6-42EC-9F81-F52F305B723C@flashner.co.il> <878rwxl6no.fsf_-_@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= 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: Tue, 07 Dec 2021 20:48:00 +0100 In-Reply-To: (Efraim Flashner's message of "Tue, 7 Dec 2021 12:11:04 +0200") Message-ID: <87a6hci4cv.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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638906548; 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=tUapdr+uTly3gtKwOnqqjY9RRRiFftpfcB9gVY94RBI=; b=Gtoks2w/h9V0bGffyE4Tci3vR0hy/650sTFQPiKllSmKz2NSXs9uDGgIbCKay9vB6FUIry 8rLlfosQHtKaMOiEabmupydm1ruEKe7bcMTYZjDhL8Qi+lpb5rTwij8chMHpaWNvpZwMcq NIQBfkw0rDA3CNaesvzZrucFLZQz/YtEimMLtnJRSGVx3MhdXNsRcXtU1j422mghAIfAb5 je0qF6bEfGGGs2vUxmugKOWb3I1Xjrhj4hs6XX/q5rlVASZq/2DUV0wnn+zbDUFadRaZcT 2bqP9U3O2TFzwGU9OtATNiUbptE8ATwlu5GU+ouPgENe34WBQyq6qctXuar7Pw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638906548; a=rsa-sha256; cv=none; b=ePf9UUje+5R2/LpX+lHJfQgv7wCJech0xi4z/Q/k36IX/2Mz7wnhnacZRvVtHq7/yixLPi UKWjyjw/G4KqVHWNEC4CGdGRSSrf2F9I6DnxQDdtei9poD+Sjsh2g58If+SJ3q+3n51jgD J8r7u/vy6uy3A8r3LGae5Akg1XZwEVON1osmgKQncSI5T7H7u2nQp0LY2tTbUAYDKs3naY ZioGckTU/C2pPOHjEZIdhp+4TZgSzP0nGjmEAIQquDwNTj4XwPOk8C+wNcK5lOkDNxLBSo OptJiGxBPlGUgHRCqgA1oh4aK/4osZvNX1MSIFcisUmvrjsnuhsn2dTQxABi5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KzjiLtgv; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -3.95 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KzjiLtgv; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 5981D14A7F X-Spam-Score: -3.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: tEjcpPq+REYH Howdy! Efraim Flashner skribis: > On Mon, Dec 06, 2021 at 11:17:47PM +0100, Ludovic Court=C3=A8s wrote: [...] >> With the minimal changes to (guix build-system cargo) below, one can use >> either the current style or pass =E2=80=9Cdevelopment inputs=E2=80=9D as= =E2=80=98native-inputs=E2=80=99 >> and other dependencies as =E2=80=98inputs=E2=80=99. Source transitivity= is preserved >> but you can write packages the normal way. >>=20 >> I modified some of the dependencies of librsvg to use >> native-inputs/inputs and you can see when applying this part of the >> patch that the librsvg derivation is unchanged. Good thing is that >> =E2=80=98guix graph=E2=80=99 and =E2=80=98guix refresh -l=E2=80=99 work = for these packages. >>=20 >> Is this a direction we want to take? > > I like the way it works out, and has Guix do the magic to give us the > crates in the graph. On the other hand I tried changing the cargo-inputs > from librsvg to regular inputs, and after 2.5 minutes of trying to run > `guix show librsvg` I still wasn't seeing the dependencies and my RAM > usage was still increasing. Also gnu/packages/gnome.scm didn't fail to > compile, so there was no notice of the loop. Notice that the dependency cycle, as discussed on IRC, breaks things like =E2=80=98guix show=E2=80=99 (?) and =E2=80=98guix graph=E2=80=99, but = doesn=E2=80=99t break actual package builds because it=E2=80=99s a cycle that vanishes once packages a= re lowered to bags and derivations. Regardless, it would be nice not to have cycles in the first place. [...] > So to summarize, between your diff to treat inputs built using > cargo-build-system as cargo-inputs and my changes to save previous > crates for the next input we reach a place where we can start to change > the crates over to use inputs and native-inputs instead of cargo-inputs > and cargo-development-inputs without needing to flip everything at once. What are the =E2=80=9Cchanges to save previous crates for the next input=E2= =80=9D? > So I'd go with it's good, but I'm not sure it directly works to fix the > problem we're having with librsvg. No no, it=E2=80=99s completely unrelated to the librsvg issue, which is why= I changed subject lines. :-) I think it=E2=80=99d be nice to have anyway. >> +(define (cargo-input? input) >> + (match input >> + ((label (? package? p)) >> + (eq? cargo-build-system (package-build-system p))) >> + (_ #f))) >> + > > I would've sorted based on the name starting with 'rust-'. OK. [...] >> (define (package-cargo-inputs p) >> - (apply >> - (lambda* (#:key (cargo-inputs '()) #:allow-other-keys) >> - cargo-inputs) >> - (package-arguments p))) >> + (match (member #:cargo-inputs (package-arguments p)) >> + (#f (filter cargo-input? (package-inputs p))) >> + ((_ inputs . _) inputs))) >>=20=20 >> (define (package-cargo-development-inputs p) >> - (apply >> - (lambda* (#:key (cargo-development-inputs '()) #:allow-other-keys) >> - cargo-development-inputs) >> - (package-arguments p))) >> + (match (member #:cargo-development-inputs (package-arguments p)) >> + (#f (filter cargo-input? (package-native-inputs p))) >> + ((_ inputs . _) inputs))) > > I see we don't get rid of #:cargo-inputs or #:cargo-development-inputs. > So even if applying the style change to all the crates causes circular > dependency problems we can fall back to the current method. I ran into > problems once I hit all the rust-bindgen crates. Right. Support for #:cargo-development-inputs and #:cargo-inputs is here so we could have a smooth =E2=80=9Cupgrade=E2=80=9D without breaking c= ompatibility. Anyway, I think the priority is to get =E2=80=98core-updates-frozen=E2=80= =99, which probably involves either pinning librsvg dependencies or using the bundled libraries as you showed at the beginning of this thread. We can resume work on prettified Rust packages after that; it=E2=80=99ll be useful to be able to use =E2=80=98guix refresh -l=E2=80=99. Ludo=E2=80=99.