From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cA/DOjZ26WUBNwAAe85BDQ:P1 (envelope-from ) for ; Thu, 07 Mar 2024 09:09:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cA/DOjZ26WUBNwAAe85BDQ (envelope-from ) for ; Thu, 07 Mar 2024 09:09:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=bzWX1U3k; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709798966; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IPa7o2/nRnS4S7FVxoeUm/zLTIB4UJ7381nRy3MaPjw=; b=aMVP4aqkABwTiHPZ1mk6WuYQU76qOAm14JlDEjpILHUJsqVbRC+8Ocmz6qkJR809be//KL ofCn7RHcI34f1rJ9so9suwf2PS0DdUkhvAMEb5ObTSw2JpdaJboSQFIa7zbXQIP4Jc8834 t58bkca1frNkdaS4aKQ3OhgSYKn1xDFg2TC4qtnfl4tgpRq+V6JsopbokAHnUpXupowIyo k38KtLhQeSenL45zj+D4l+xadDg7xDoCQH7CoA31LY8E7NWCdjlnDPCSXEVlHzrDkcTbbq BC0tqAqSlQIzicE40izqgWuPKf/N+FYaQGqnT0Bat5Xv2qvRNnlDNsB5HbDtJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=bzWX1U3k; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709798966; a=rsa-sha256; cv=none; b=gmi9s/lNX7oKFMO5u9bVwBs4wvnN4cISTT4TG/4NH8m8DW6XhvjS3iLIS7edIeUlNIkxG9 ZpQalMGTp12vwokR5A+QGiBRBr/VzwWAOhPeoV8QqrxTO/DOUIFG7Hn3sgp3FDyou8djXi tx/1DkezUviKRtYfjm4e2PuAKw5KwnZnImIFFU2fcpRdxtr2IEmLdbhv3iBMCEQDW0ON08 hOsJcPnOxCGJF+JcKXQEeMrVpfJwNd9erVbrEUVEvzq1mfos/pMddykowkhTuggXnRfKX7 lLQIy9U9N/pKz5l3b1K+gtDIj5AIORY6pJhrKR57CaOKoswU4G45+FMWqxQjZQ== 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 9621740539 for ; Thu, 7 Mar 2024 09:09:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri8nw-00055a-6D; Thu, 07 Mar 2024 03:08:40 -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 1ri8nt-000556-AQ for guix-devel@gnu.org; Thu, 07 Mar 2024 03:08:37 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ri8nq-0006oA-VZ for guix-devel@gnu.org; Thu, 07 Mar 2024 03:08:37 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-412e784060cso10224825e9.1 for ; Thu, 07 Mar 2024 00:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709798913; x=1710403713; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=IPa7o2/nRnS4S7FVxoeUm/zLTIB4UJ7381nRy3MaPjw=; b=bzWX1U3k1nHDRJylr7NKQpFAK3TTFadeTd3bOeZYFuzwDegONDu3NIeCCOizGfmGb7 RVUNmLkkh8fpLF5zxZCnU845RxbX1Wr8jNXjZEi8oW+QtRSDv4/RCRy1fOlwXs78+dBc O9h78wZgT9df5kcyLAcR/crUgq4vvReFYJcgGxhK9Gdvje4/FOGf1HkrH1DM4HO3rrog hSv8bob4S0qhUWDb9t1r1cqYc+ethok0ESFs3ReXld05KPPIxKwYSJz4IiUgNCoGnub1 5etPj3viqZPz6EBWsATghELUFaxqADffaa67lzJSlHRHuJqeo37yr8ZUUvtQ9DX7KyvP 18vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709798913; x=1710403713; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IPa7o2/nRnS4S7FVxoeUm/zLTIB4UJ7381nRy3MaPjw=; b=nvcESoIa0buv+0YbHjZpmNVy91q0cseqKX/rA6F/kH0Gu5/ff92sGUmO3yx5grrKKy 1rk6cpH7nPJvtu8WBUHOMo1qW0viRc8DA3z4NQOYP2XgIrU0JuT33ecgJ4ZIvtUrKiRu aLd7EIleybQf5RcSnaPKp5ud/OScDKEv+TSLkSnt8AB9TfIIreqOtFWaV90DW63L11DY jksYxqTHrhSuQouc+8CaYcitTqBo6wodwDMCLMnqG0KHTrWaXhlneFEPhAdwbLS4nDeO Oft94zxFCbdms59EQSLo9HG1pbk3Fyo+Hk6l/HxQFkoyI43aQDLqAOn4u2W5w5A0euLb 8Nfg== X-Gm-Message-State: AOJu0YwhzI8SlXTOciT3JV7MeEcg/R0Asqmpju01JfDV6sJDeizjix/r 2DUZd1yr6Tn0pw+KXkWaZKxN2K3e3XSFDX5CNAo+yVU4o1ZSB3As X-Google-Smtp-Source: AGHT+IEV9p42M0ukI+gkZSaBmU3AISmv+51gNkRF4bifn+OPsZmTfL84usVXhf6QSIaTGqMadhBglw== X-Received: by 2002:a5d:4ecb:0:b0:33d:1ece:d618 with SMTP id s11-20020a5d4ecb000000b0033d1eced618mr595176wrv.8.1709798912693; Thu, 07 Mar 2024 00:08:32 -0800 (PST) Received: from localhost ([141.226.12.177]) by smtp.gmail.com with ESMTPSA id l9-20020a056000022900b0033cf2063052sm19447009wrz.111.2024.03.07.00.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 00:08:31 -0800 (PST) Date: Thu, 7 Mar 2024 10:08:30 +0200 From: Efraim Flashner To: Jason Conroy Cc: guix-devel@gnu.org Subject: Re: rust-team branch merged Message-ID: Mail-Followup-To: Jason Conroy , guix-devel@gnu.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="juLTctAFrLP2lj6r" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.87 X-Spam-Score: -6.87 X-Migadu-Queue-Id: 9621740539 X-Migadu-Scanner: mx13.migadu.com X-TUID: q1GU4a4tyEod --juLTctAFrLP2lj6r Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2024 at 12:53:44PM -0500, Jason Conroy wrote: > On Wed, Mar 6, 2024 at 4:06=E2=80=AFAM Efraim Flashner > wrote: >=20 > > On Mon, Feb 26, 2024 at 09:24:29PM -0500, Jason Conroy wrote: > > > Hello Efraim, > > > > > > Thanks for investigating this - a Rust development workflow using only > > > Guix-native crates is something I've been waiting for! > > > > > > I was experimenting with your patches and it seems that they do pull = in > > the > > > source crates for requested packages, but not their dependencies (exa= mple > > > below). Is there something I'm missing? > > > > When you say they pull in the source crates do you mean the sources of > > the other rust packages needed by rust-rand? I didn't test that, but I > > assumed it wouldn't. > > >=20 > That's right, I'm interested in having `guix shell` populate the full set > of transitive dependencies in the registry, similar to what happens when > using `cargo build` in the conventional way (but instead using > Guix-packaged crates). I interpreted your message up-thread to mean that > you were trying to accomplish the same, but please correct me if not. The transitive dependencies getting pulled in automatically should work automatically if we ever finish the antioxidant-build-system. Until then I've been experimenting by manually listing the other crates I've needed but in theory we could try to make `guix shell --development` pull in the needed crates. I misread what you wrote as it was working. It's definitely something I want but wasn't ready to work on yet. > I took rust-rand as an example only because it does have some dependencie= s: >=20 > $ cd $CARGO_PROJECT > $ cat Cargo.toml > [package] > name =3D "test_prog" > ... > [dependencies] > rand =3D "0.8.5" >=20 > $ cargo build > Updating crates.io index > Downloaded cfg-if v1.0.0 > Downloaded rand_chacha v0.3.1 > Downloaded rand v0.8.5 > Downloaded ppv-lite86 v0.2.17 > Downloaded rand_core v0.6.4 > Downloaded getrandom v0.2.12 > Downloaded libc v0.2.153 > Downloaded 7 crates (932.0 KB) in 0.48s > Compiling libc v0.2.153 > Compiling cfg-if v1.0.0 > Compiling ppv-lite86 v0.2.17 > Compiling getrandom v0.2.12 > Compiling rand_core v0.6.4 > Compiling rand_chacha v0.3.1 > Compiling rand v0.8.5 > Compiling test_prog v0.1.0 (/home/...) >=20 >=20 > > Currently if you were to pull in rust-rand-0.8 and rust-rand-0.7 then > > you'd have both rand-0.*.crate files in the registry but only one of > > them would be listed in share/cargo/registry/index/ra/nd/rand. I need to > > adjust the generation of that file to combine multiple sources if they > > exist, and sort them (I'm not sure it's necessary, but wouldn't be > > surprised if we hit undefined behaviour if they were listed multiple > > times or out of order). >=20 >=20 > I'm somewhat new to rust, but it appears that outside of Guix, the > local-only development workflow looks like this: >=20 > $ cd $CARGO_PROJECT > $ mkdir $VENDOR > $ cargo vendor $VENDOR >=20 > After downloading and unpacking all of the crates into $VENDOR, this last > command instructs me to add the following in ~/cargo/config.toml. > Then, after opening a new guix shell without network access, I can confirm > that `cargo build` works fine with the vendored crates. >=20 > [source.crates-io] > replace-with =3D "vendored-sources" >=20 > [source.vendored-sources] > directory =3D "" I wanted local-registry over replace-with because IIRC replace-with won't fall back to downloading from crates.io if there's missing crates, while local-registry will check there first and then download any missing crates. The use-case I was looking at for that was adding a new dependency to a project and then not needing to re-create a shell or package the new crates before continuing on. The registry as setup in the patches is actually mostly correct, minus the multiple versions of a crate, it just needs to be fed the crates. > Getting back to your patch set: would it make sense to emulate this vendor > workflow instead of trying to construct a registry directly? Even assuming > that all details of the registry structure are stable and documented, the > layout of the vendor directory appears much simpler. And IIUC the code for > setting up vendored libraries already exists in cargo-build-system. >=20 > I also need to figure out something with a > > config.toml to see if it's possible to generate one that could be > > included from another one, since you can't add 'local-registry =3D > > $GUIX_PROFILE/...' in a toml file. > > >=20 > You've probably researched this more than I have, but it seems that this > use case is explicitly unsupported in the TOML language spec: > https://github.com/toml-lang/toml/issues/397 > > With that option off the table, I can't think of any elegant solutions. > Maybe a wrapper for the cargo binary that pre-processes cargo.toml and th= en > calls the real cargo? Thanks, I didn't see that one. So it looks like environment variables and INCLUDEs are off the table. An autoconf style macro that take a config.toml.in and spits out a config.toml with the correct directory would work, but from my understanding that's not really in line with any bit of how cargo and the rust ecosystem works. Another option would be to symlink $GUIX_ENVIRONMENT/share/cargo/registry to ./local-registry and then add the line 'local-registry =3D 'local-registry' in a config.toml. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --juLTctAFrLP2lj6r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmXpdfsACgkQQarn3Mo9 g1GEpg/8C1RdTpik5ZGHwtBS9rVYcEOjDwomLRwqJdfyj65EkvY1FDoVLSpo42cU Gs3fQ16mtSwr0c1ncZIty9Tbqp+Aw0G0AabY/opj3DnQxW5PEOEhgtwOAYxVwpsg NnkLNbgCsn5+ObpdH2tUDkxCdY8HzMgIRvyUGZyAdt6ezANbK41UXnRgGbNMRP43 cwPprReuRnkOelW8gXbc3DBsEvIY0vz+BMWs5LtTbQNXYQaUiA4DGvSRxL8D1K0d 9HfeTP5VHOtWRH4OvG9UixfX+2CZDTASK2ufYFaICGwXfiwAOoFrgkFWAaO5Z6BL dumFbh+M8i6VIW2wxqDpZIbAKhGM6Ajk+Iq4RtjIUJpqYE/XRdvBzyg1KPNfsmdi DOopvp0mvtSz9iUL2ygGzuYRUNJ1asf5L+EtSejNl/FgEaDJqHqawiE+zCniAVb9 NMAN+/OlR1ZbIljC/YLSuw3xTEkNwySnPaWVXScM/7vuVkkaxBp5tH7PaZvvPfqh /wqhL39+phYQbxnnsmTMg0f/maZltA/mXvjKDkoxoyxCiSpCOuyfsXU7AEycRKgY fIS6V7ofbnZV8GNdto1CZtfqq+eVhx6m/UFhwKxjoUYo6mqykufoEI85JwtPAjRx s13KXm+Z1xQyu+YSoEWcPNT+JVTK+E65rRhYuTGDJpC/n8rqfX4= =f92T -----END PGP SIGNATURE----- --juLTctAFrLP2lj6r--