[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rust-team branch merged
From: |
Efraim Flashner |
Subject: |
Re: rust-team branch merged |
Date: |
Thu, 14 Dec 2023 17:10:16 +0200 |
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 no
> 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=`
in ~/.cargo/config:
[source.crates-io]
local-registry = '<location of GUIX_ENVIRONMENT>/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 <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
0001-build-cargo-build-system-Produce-registry-index-file.patch
Description: Text document
0002-guix-profiles-Add-cargo-registry-profile-hook.patch
Description: Text document
signature.asc
Description: PGP signature