From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id wH49KW3Q3WWIowAAqHPOHw:P1 (envelope-from ) for ; Tue, 27 Feb 2024 13:07:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id wH49KW3Q3WWIowAAqHPOHw (envelope-from ) for ; Tue, 27 Feb 2024 13:07:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CM8vOKJl; 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=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709035629; 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=o7rOLNN9G6oBInL1Bvd4o0KnpJbGkeja5P8tSTaqxzo=; b=f6hINwK0QKDac+Sp8zW/pHaz5tKGlhNP8UQST3l5Egy6d20zTZGRjYPXyr3wO0q6QuoqE9 3rBElQQ4o6hSiLc85EnLUS9FeHFtSq3jFv5TXP3X8XBmulUkJQ8obpc7CFqHAO4PrTzvrT PoVMPFncOqcO8DEWO0QBiEkDOgPjTpT2q9SCkAex88+18X4mtlCCBJV6V6F8rahOBJH3CS XL/oQJ/qptOpWVWFwiKxsiPePQ8dZpBY2wcW7ooQ2k1TvrekW7F210Bb4hjP3AuQbT16EA zF2NF4cQmEHML3/K3Rzhcrz9ir73V/j6MoQ/WWZkqEdCxmS2rs+R9cxEF4GE1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CM8vOKJl; 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=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709035629; a=rsa-sha256; cv=none; b=cp6qaoQotMqKM8lbT78MaiNsB9YKWDtFiwq6x0GtVGf6lzMCAjnFehcWgl9JtO8whxRPC2 8iU9jIldIbjJS0Cf+ED8B1hB00+UFqhzfG/i0xLUm2bdwE1oiS7V0U/uiTIG4Ogc14whpe 0QblyHr/OoTQ+u++Tqi+oUYYu9jTSx+a/YLdfWr2jYdfnTsuSYchbwrx7SMxByVuC0w0G/ c99maxpl7k7z86MHbtnkJdhFl66UhAO/O8OjOuDDTQYmwREVDDRRp9378/PMVI/7Wr4OjY FtFKJe/5YxzpYpvk6zl3SMooQlmxDy6JRI8CuO9hQy/6hCIzG1e/AFV7evwxDw== 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 6EE3B19A05 for ; Tue, 27 Feb 2024 13:07:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rewEN-0001ya-Kp; Tue, 27 Feb 2024 07:06:43 -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 1ren9e-00027c-0n for guix-devel@gnu.org; Mon, 26 Feb 2024 21:25:16 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ren9Y-0001Oa-PF for guix-devel@gnu.org; Mon, 26 Feb 2024 21:25:13 -0500 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-42e8ea2caedso5808941cf.3 for ; Mon, 26 Feb 2024 18:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709000705; x=1709605505; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=o7rOLNN9G6oBInL1Bvd4o0KnpJbGkeja5P8tSTaqxzo=; b=CM8vOKJlNjMAhXRW0IgAJo4BYi/D1IsWtvaHYhjCL0Lqb+0TWaWcNKS7fLRZr3gp1V KE9O3lqhM7v8mc08Bcn6195hTbyYW9bKsGjW3D4iOcp2hjLlDLIpY0CPeQFcgYNuGSkV qv0vK2TVLVQ5Wk8htfuxGSKMVdA1OohVSz5qchdu4xx4IVX17RYddDCI1kZs3bkQEbjN 4VPwLfloEBuVKSTB1pKfHkur6gSClFBZNzPWck7m5TOZINMbr3ablZHpUVjeyHa6M2x6 SBTYnuMCo99DKVt8NiNlQZzcvAGY9knSn/IWd8GNEvd+8FS3PrJeaazOan86skaXltnv bjNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709000705; x=1709605505; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o7rOLNN9G6oBInL1Bvd4o0KnpJbGkeja5P8tSTaqxzo=; b=nbIelhCuq9FSc8rTsNEIjbzP9pGtRzOUIAqiXz5zk8JLrAK6odeDPZXMZLVWEygleg kgBr4jxHqfo7K/wb20zMiCFVo6JiA6x3l3jYcFMvqq7n+Dld3MsB7oWouAgFs9eOp/+l c6UoOGnPOwxT7Ou2gPCDM9YR3fU4qB3QOhe1zLq4JLN9dG3ckJwGgdKj/Og6olenjrs4 Z8BvocM4alfPslQsBm7Ip461lL5FnbmkRgRAH16N1CLq/zaoehO3gKUeVx2TM3V9RIQP sdDPhQmbeVS6aNHKXYG8mRgzOnoJawsEi+I5qI+4frgw8peJDD6wOhdm8gCd5wgr//Zl dAZg== X-Gm-Message-State: AOJu0YyK1m1mDYLHbfAguSQSmj87v8vPm+JIJfCRlVN7F7/kS3uzxHwM oWOEWnvfyRasH1sgbPMY2xUxqSa5nanGCsgyslH46APKheQ2Cv4yVXtol1uvM0w9HV4/HYsy3/F yZyp975OhYePwXakqZXF7SETCHrIHF1/r X-Google-Smtp-Source: AGHT+IEBbtGQ5cgw+tI8zTzhtguTfhVIxvoMGH5r2tuWuqBsJEU5mSCPlFTLkXNxHjKb/jgIxWZSH1E45UwJiuupXq8= X-Received: by 2002:a05:622a:287:b0:42e:984f:b928 with SMTP id z7-20020a05622a028700b0042e984fb928mr1022574qtw.27.1709000705271; Mon, 26 Feb 2024 18:25:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jason Conroy Date: Mon, 26 Feb 2024 21:24:29 -0500 Message-ID: Subject: Re: rust-team branch merged To: Efraim Flashner Cc: guix-devel@gnu.org Content-Type: multipart/alternative; boundary="000000000000f569f3061253bb37" Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=conjaroy@gmail.com; helo=mail-qt1-x835.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 27 Feb 2024 07:06:41 -0500 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.56 X-Spam-Score: -9.56 X-Migadu-Queue-Id: 6EE3B19A05 X-TUID: lLc8H8EzIvDI --000000000000f569f3061253bb37 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (example below). Is there something I'm missing? Cheers, Jason $ guix shell --pure bash findutils rust-rand -- bash -c 'find -L $GUIX_ENVIRONMENT/share/cargo' /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/in= dex /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/in= dex/ra /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/in= dex/ra/nd /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/in= dex/ra/nd/rand /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/ra= nd-0.8.5.crate /gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/co= nfig.json On Thu, Dec 14, 2023 at 10:10=E2=80=AFAM Efraim Flashner wrote: > On Wed, Dec 13, 2023 at 10:34:11AM +0200, Efraim Flashner wrote: > > * Compiled rust packages currently have a 'package' phase, which runs > > the command used to crate a 'crate tarball', and is installed in > > %output/share/cargo/registry, with unpacked sources in > > %output/share/cargo/src. In theory it should be possible to use these > > for local rust development. The benefits include everything that comes > > with being a guix package, including pre-patched shebangs. Currently n= o > > index file is created in $GUIX_ENVIRONMENT/share/cargo/registry/index, > > which is likely necessary to actually make use of this. Additionally, = I > > am unsure how to use '$GUIX_ENVIRONMENT' in ~/.cargo/config so that it > > is expanded and not taken as a literal string. > > In the Guix London meetup someone mentioned that they were interested in > playing around with using Guix for rust development. I've adjusted the > cargo-build-system to produce the registry index files and I added a > profile hook to generate the config.json to locate the packaged crates. > > toml files can't process environment variables (which is probably a good > thing ...) but that means its a little harder to test out. > > with the two patches applied create an environment with the crates you > want and get the location of GUIX_ENVIRONMENT: > `env | grep GUIX_ENVIRONMENT | cut -f2 -d=3D` > > in ~/.cargo/config: > [source.crates-io] > local-registry =3D '/share/cargo/registry' > > 'cargo build' should pull from the local crates in the GUIX_ENVIRONMENT. > I'm not sure what happens if it doesn't have those crates available and > would need to get them from crates.io. > > > -- > 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 unencrypt= ed > --000000000000f569f3061253bb37 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Efraim,

Thanks for inv= estigating 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 sour= ce crates for requested packages, but not their dependencies (example below= ). Is there something I'm missing?

Cheers,
Jason

$ guix shell --pure bash findutil= s rust-rand -- bash -c 'find -L $GUIX_ENVIRONMENT/share/cargo'
/= gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo
/gnu/stor= e/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry
/gnu/sto= re/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/index
/= gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/ind= ex/ra
/gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/re= gistry/index/ra/nd
/gnu/store/zf88v65rbg2di4qhgdbvhfcjf31rdzby-profile/s= hare/cargo/registry/index/ra/nd/rand
/gnu/store/zf88v65rbg2di4qhgdbvhfcj= f31rdzby-profile/share/cargo/registry/rand-0.8.5.crate
/gnu/store/zf88v6= 5rbg2di4qhgdbvhfcjf31rdzby-profile/share/cargo/registry/config.json

On= Thu, Dec 14, 2023 at 10:10=E2=80=AFAM Efraim Flashner <efraim@flashner.co.il> wr= ote:
On Wed, Dec= 13, 2023 at 10:34:11AM +0200, Efraim Flashner wrote:
> * Compiled rust packages currently have a 'package' phase, whi= ch runs
> the command used to crate a 'crate tarball', and is installed = in
> %output/share/cargo/registry, with unpacked sources in
> %output/share/cargo/src.=C2=A0 In theory it should be possible to use = these
> for local rust development.=C2=A0 The benefits include everything that= comes
> with being a guix package, including pre-patched shebangs.=C2=A0 Curre= ntly no
> index file is created in $GUIX_ENVIRONMENT/share/cargo/registry/index,=
> which is likely necessary to actually make use of this.=C2=A0 Addition= ally, I
> am unsure how to use '$GUIX_ENVIRONMENT' in ~/.cargo/config so= that it
> is expanded and not taken as a literal string.

In the Guix London meetup someone mentioned that they were interested in playing around with using Guix for rust development.=C2=A0 I've adjuste= d the
cargo-build-system to produce the registry index files and I added a
profile hook to generate the config.json to locate the packaged crates.

toml files can't process environment variables (which is probably a goo= d
thing ...) but that means its a little harder to test out.

with the two patches applied create an environment with the crates you
want and get the location of GUIX_ENVIRONMENT:
`env | grep GUIX_ENVIRONMENT | cut -f2 -d=3D`

in ~/.cargo/config:
[source.crates-io]
local-registry =3D '<location of GUIX_ENVIRONMENT>/share/cargo/re= gistry'

'cargo build' should pull from the local crates in the GUIX_ENVIRON= MENT.
I'm not sure what happens if it doesn't have those crates available= and
would need to get them from crates.io.


--
Efraim Flashner=C2=A0 =C2=A0<efraim@flashner.co.il>=C2=A0 =C2=A0=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=C2=A0 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted=
--000000000000f569f3061253bb37--