* Confusion regarding rust packages in guix
@ 2023-11-25 16:22 Abdullah Imad
2023-11-26 23:38 ` Tomas Volf
0 siblings, 1 reply; 3+ messages in thread
From: Abdullah Imad @ 2023-11-25 16:22 UTC (permalink / raw)
To: help-guix
Hello,
I'm trying to package [helix](https://github.com/helix-editor/helix), a
text editor written in rust. I'm unsure how to write the actual package
though. The layout is seemingly straight forward - I found a random rust
package already in guixpkgs and just copied the config - but when it
comes to `cargo-inputs` and `cargo-development-inputs`, I'm not sure
what to do. Do I have to define every single variable in `cargo.lock`?
For bigger projects this seems like an incredible amount of work. Why
does the guix system require packages to be pulled from guix repos when
nix just reads the `cargo.lock` and pulls it from crates.io or
something? Is that not also deterministic, since that's the entire point
of the `cargo.lock` file? In the flake that helix provides :
https://github.com/helix-editor/helix/blob/master/flake.nix , the
individual dependencies are not defined. Am I missing something, or is
this just how its done?
Thanks,
Abdullah Imad
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Confusion regarding rust packages in guix
2023-11-25 16:22 Confusion regarding rust packages in guix Abdullah Imad
@ 2023-11-26 23:38 ` Tomas Volf
2023-11-27 7:56 ` Efraim Flashner
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2023-11-26 23:38 UTC (permalink / raw)
To: Abdullah Imad; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
On 2023-11-25 11:22:46 -0500, Abdullah Imad wrote:
> Hello,
>
>
> I'm trying to package [helix](https://github.com/helix-editor/helix), a text
> editor written in rust. I'm unsure how to write the actual package though.
> The layout is seemingly straight forward - I found a random rust package
> already in guixpkgs and just copied the config - but when it comes to
> `cargo-inputs` and `cargo-development-inputs`, I'm not sure what to do. Do I
> have to define every single variable in `cargo.lock`? For bigger projects
> this seems like an incredible amount of work. Why does the guix system
> require packages to be pulled from guix repos when nix just reads the
> `cargo.lock` and pulls it from crates.io or something? Is that not also
> deterministic, since that's the entire point of the `cargo.lock` file? In
> the flake that helix provides :
> https://github.com/helix-editor/helix/blob/master/flake.nix , the individual
> dependencies are not defined. Am I missing something, or is this just how
> its done?
I think people usually use the importer. For crates it would be something like:
guix import crate -r PACKAGE-NAME
That will take care of adding all dependencies not yet present in the Guix. The
generated definitions might need some tweaks though.
>
>
> Thanks,
>
> Abdullah Imad
>
>
Have a nice day,
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Confusion regarding rust packages in guix
2023-11-26 23:38 ` Tomas Volf
@ 2023-11-27 7:56 ` Efraim Flashner
0 siblings, 0 replies; 3+ messages in thread
From: Efraim Flashner @ 2023-11-27 7:56 UTC (permalink / raw)
To: Abdullah Imad, help-guix
[-- Attachment #1: Type: text/plain, Size: 1999 bytes --]
On Mon, Nov 27, 2023 at 12:38:26AM +0100, Tomas Volf wrote:
> On 2023-11-25 11:22:46 -0500, Abdullah Imad wrote:
> > Hello,
> >
> >
> > I'm trying to package [helix](https://github.com/helix-editor/helix), a text
> > editor written in rust. I'm unsure how to write the actual package though.
> > The layout is seemingly straight forward - I found a random rust package
> > already in guixpkgs and just copied the config - but when it comes to
> > `cargo-inputs` and `cargo-development-inputs`, I'm not sure what to do. Do I
> > have to define every single variable in `cargo.lock`? For bigger projects
> > this seems like an incredible amount of work. Why does the guix system
> > require packages to be pulled from guix repos when nix just reads the
> > `cargo.lock` and pulls it from crates.io or something? Is that not also
> > deterministic, since that's the entire point of the `cargo.lock` file? In
> > the flake that helix provides :
> > https://github.com/helix-editor/helix/blob/master/flake.nix , the individual
> > dependencies are not defined. Am I missing something, or is this just how
> > its done?
>
> I think people usually use the importer. For crates it would be something like:
>
> guix import crate -r PACKAGE-NAME
>
> That will take care of adding all dependencies not yet present in the Guix. The
> generated definitions might need some tweaks though.
I just checked and it doesn't look like you can use the importer for
helix itself. Also the crates in the workspace, helix-core etc., are
placeholders on crates-io, so you'll need to manually parse the
Cargo.toml files in each of the crates in the project.
crates listed in [dependencies] go in cargo-inputs and
[dev-dependencies] go in cargo-development-inputs.
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-27 7:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-25 16:22 Confusion regarding rust packages in guix Abdullah Imad
2023-11-26 23:38 ` Tomas Volf
2023-11-27 7:56 ` Efraim Flashner
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.