all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Rust development tools
@ 2019-04-18  2:26 mikadoZero
  2019-04-18 15:47 ` Ivan Petkov
  0 siblings, 1 reply; 6+ messages in thread
From: mikadoZero @ 2019-04-18  2:26 UTC (permalink / raw)
  To: help-guix

The rust book is a learning resource for the rust programming language.
https://doc.rust-lang.org/book/title-page.html

It includes content on these rust development tools:

* cargo
  + build system and package manager
  + provides dependency management
  + used through the entire rust book
  https://doc.rust-lang.org/book/ch01-03-hello-cargo.html

* rustup
  + adding the developer tool below
    https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html
  + using other versions of rust like nightly
    - example of using nightly rust
      https://rocket.rs/v0.4/guide/getting-started/

* developer tools
  https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html
  + rustfmt - code style reformatter
  + clippy - linting
  + rls - language server

I have rust installed on a Guix System.  It does not look like it
included any of these developer tools.  They also do not show up when
doing a package search for their names or for just rust.  I have also
searched for them with a `locate rust` and filtered its results with
sed.

What would be other ways to find these if they are already packaged for
Guix?

If cargo is not packaged are people who are using rust with Guix System
using rustc and manually managing their dependencies?

Are there any special considerations for Guix packages that provide
programs like cargo and rustup that are also package managers?

How does Guix deal with something like rust nightly releases if at all?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Rust development tools
  2019-04-18  2:26 Rust development tools mikadoZero
@ 2019-04-18 15:47 ` Ivan Petkov
  2019-04-18 19:45   ` John Soo
  2019-04-18 20:23   ` mikadoZero
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Petkov @ 2019-04-18 15:47 UTC (permalink / raw)
  To: mikadoZero; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

Hi!

> On Apr 17, 2019, at 7:26 PM, mikadoZero <mikadozero@yandex.com> wrote:

The rust integrations within Guix are a bit incomplete at the moment, but I’ve been
making some efforts to get things going. Right now it is possible to build individual
crates but with a *ton* of manual intervention in the package definitions. I’m working
on another change that should make it possible to start packaging rust based
packages/applications into Guix, hoping to share something next week.

> If cargo is not packaged are people who are using rust with Guix System
> using rustc and manually managing their dependencies?

Cargo is packaged in Guix today, however, it is exposed as an output of the rust
package (http://guix.info/manual/en/Packages-with-Multiple-Outputs.html <http://guix.info/manual/en/Packages-with-Multiple-Outputs.html>).

This confused me a bit the first time I installed rust on Guix as well. You’ll need
to run `guix package -i rust:cargo` to make it available. Perhaps the Guix search
needs updated to also search for matching package outputs…

As for extra tools like rls, rustfmt, and clippy: these are usually distributed with
the compiler source tarball. Currently they are not being build/packaged as
outputs because no one has done the work to expose them as such.

If you’re interested in using them, I encourage you to try exposing them in the
rust package definitions! If you need any help, feel free to reach out!

> Are there any special considerations for Guix packages that provide
> programs like cargo and rustup that are also package managers?
> 
> How does Guix deal with something like rust nightly releases if at all?

Guix does not package nightly rust, and I don’t anticipate it ever will. Getting
the rust compiler built and packaged into rust takes a little bit of effort,
and it would be impossible to keep up with the nightlies by hand.

Rustup seems to be the right way to make alternative rust toolchains available
and maintained outside of the Guix store. The last time I tried to install rustup
via the conventional installer, it failed to run on my machine outright, probably
because all necessary artifacts are in the store and not in the usual Linux distro
locations.

Once the Guix cargo build system is flushed out a bit more, I anticipate it should
be possible to define and build rustup as a Guix package.

—Ivan


[-- Attachment #2: Type: text/html, Size: 3496 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Rust development tools
  2019-04-18 15:47 ` Ivan Petkov
@ 2019-04-18 19:45   ` John Soo
  2019-04-18 20:23   ` mikadoZero
  1 sibling, 0 replies; 6+ messages in thread
From: John Soo @ 2019-04-18 19:45 UTC (permalink / raw)
  To: Ivan Petkov; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]

Hi!

Thanks for your work on this.  I’m looking forward to using alacrity and ripgrep, among other niceties the rust community has come up with.

- John

> On Apr 18, 2019, at 8:47 AM, Ivan Petkov <ivanppetkov@gmail.com> wrote:
> 
> Hi!
> 
>> On Apr 17, 2019, at 7:26 PM, mikadoZero <mikadozero@yandex.com> wrote:
> 
> The rust integrations within Guix are a bit incomplete at the moment, but I’ve been
> making some efforts to get things going. Right now it is possible to build individual
> crates but with a *ton* of manual intervention in the package definitions. I’m working
> on another change that should make it possible to start packaging rust based
> packages/applications into Guix, hoping to share something next week.
> 
>> If cargo is not packaged are people who are using rust with Guix System
>> using rustc and manually managing their dependencies?
> 
> Cargo is packaged in Guix today, however, it is exposed as an output of the rust
> package (http://guix.info/manual/en/Packages-with-Multiple-Outputs.html).
> 
> This confused me a bit the first time I installed rust on Guix as well. You’ll need
> to run `guix package -i rust:cargo` to make it available. Perhaps the Guix search
> needs updated to also search for matching package outputs…
> 
> As for extra tools like rls, rustfmt, and clippy: these are usually distributed with
> the compiler source tarball. Currently they are not being build/packaged as
> outputs because no one has done the work to expose them as such.
> 
> If you’re interested in using them, I encourage you to try exposing them in the
> rust package definitions! If you need any help, feel free to reach out!
> 
>> Are there any special considerations for Guix packages that provide
>> programs like cargo and rustup that are also package managers?
>> 
>> How does Guix deal with something like rust nightly releases if at all?
> 
> Guix does not package nightly rust, and I don’t anticipate it ever will. Getting
> the rust compiler built and packaged into rust takes a little bit of effort,
> and it would be impossible to keep up with the nightlies by hand.
> 
> Rustup seems to be the right way to make alternative rust toolchains available
> and maintained outside of the Guix store. The last time I tried to install rustup
> via the conventional installer, it failed to run on my machine outright, probably
> because all necessary artifacts are in the store and not in the usual Linux distro
> locations.
> 
> Once the Guix cargo build system is flushed out a bit more, I anticipate it should
> be possible to define and build rustup as a Guix package.
> 
> —Ivan
> 

[-- Attachment #2: Type: text/html, Size: 3977 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Rust development tools
  2019-04-18 15:47 ` Ivan Petkov
  2019-04-18 19:45   ` John Soo
@ 2019-04-18 20:23   ` mikadoZero
  2019-04-19  2:40     ` Ivan Petkov
  1 sibling, 1 reply; 6+ messages in thread
From: mikadoZero @ 2019-04-18 20:23 UTC (permalink / raw)
  To: Ivan Petkov; +Cc: help-guix


Ivan Petkov writes:

> Hi!
>
>> On Apr 17, 2019, at 7:26 PM, mikadoZero <mikadozero@yandex.com> wrote:
>
> The rust integrations within Guix are a bit incomplete at the moment, but I’ve been
> making some efforts to get things going. Right now it is possible to build individual
> crates but with a *ton* of manual intervention in the package definitions. I’m working
> on another change that should make it possible to start packaging rust based
> packages/applications into Guix, hoping to share something next week.
>

Thank you for working on this.

>> If cargo is not packaged are people who are using rust with Guix System
>> using rustc and manually managing their dependencies?
>
> Cargo is packaged in Guix today, however, it is exposed as an output of the rust
> package (http://guix.info/manual/en/Packages-with-Multiple-Outputs.html <http://guix.info/manual/en/Packages-with-Multiple-Outputs.html>).
>

Thanks for pointing out this useful section of the manual out.

> This confused me a bit the first time I installed rust on Guix as well. You’ll need
> to run `guix package -i rust:cargo` to make it available. Perhaps the Guix search
> needs updated to also search for matching package outputs…
>

I was able to install cargo by adding `rust:cargo` to a manifest
configuration file.

> As for extra tools like rls, rustfmt, and clippy: these are usually distributed with
> the compiler source tarball. Currently they are not being build/packaged as
> outputs because no one has done the work to expose them as such.
>
> If you’re interested in using them, I encourage you to try exposing them in the
> rust package definitions! If you need any help, feel free to reach out!
>

I think I would consider attempting clippy.  Would exposing it be
similar to cargo?  Searching through `rust.scm` cargo is all over the
place.  Would exposing clippy be as far reaching and extensive?

I am new to packaging for Guix.  I just had my first patch for a package
committed just the other day.  I have not yet learned Guile.  Would
adding clippy as an output be overly ambitious?  Should I learn Guile
first?

>> Are there any special considerations for Guix packages that provide
>> programs like cargo and rustup that are also package managers?
>> 
>> How does Guix deal with something like rust nightly releases if at all?
>
> Guix does not package nightly rust, and I don’t anticipate it ever will. Getting
> the rust compiler built and packaged into rust takes a little bit of effort,
> and it would be impossible to keep up with the nightlies by hand.
>
> Rustup seems to be the right way to make alternative rust toolchains available
> and maintained outside of the Guix store. The last time I tried to install rustup
> via the conventional installer, it failed to run on my machine outright, probably
> because all necessary artifacts are in the store and not in the usual Linux distro
> locations.
>
> Once the Guix cargo build system is flushed out a bit more, I anticipate it should
> be possible to define and build rustup as a Guix package.

It is good to hear about a potential way to use rust nightly on Guix.

>
> —Ivan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Rust development tools
  2019-04-18 20:23   ` mikadoZero
@ 2019-04-19  2:40     ` Ivan Petkov
  2019-04-24 16:52       ` mikadoZero
  0 siblings, 1 reply; 6+ messages in thread
From: Ivan Petkov @ 2019-04-19  2:40 UTC (permalink / raw)
  To: mikadoZero; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]


> On Apr 18, 2019, at 1:23 PM, mikadoZero <mikadozero@yandex.com> wrote:
> 
> I think I would consider attempting clippy.  Would exposing it be
> similar to cargo?  Searching through `rust.scm` cargo is all over the
> place.  Would exposing clippy be as far reaching and extensive?
> 
> I am new to packaging for Guix.  I just had my first patch for a package
> committed just the other day.  I have not yet learned Guile.  Would
> adding clippy as an output be overly ambitious?  Should I learn Guile
> first?

Knowing Guile isn’t a must if you’re just hacking on some existing package
definitions, though a quick primer wouldn’t hurt!

Exposing clippy or rls via the existing rust package definition shouldn’t be
too hard (the definitions look pretty messy due to bootstrapping and inheriting
from each other).

Here are the general steps you’d need to take:

* Add a new output to the package definition for clippy
* Add a new build-clippy phase which would invoke the rust build system to build
the tool (e.g. invoking `./x.py build src/tools/clippy`)
* Add a new check-clippy phase which invokes the tests for the tool
* Add a new install-clippy phase which will copy the tool artifacts to the specific
output directory

I would recommend making changes on the latest version of rust. If you
touch any of the earlier versions, you may be stuck building for a looooong time.

Happy hacking, and feel free to reach out if you get stuck!

—Ivan

[-- Attachment #2: Type: text/html, Size: 8053 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re:Rust development tools
  2019-04-19  2:40     ` Ivan Petkov
@ 2019-04-24 16:52       ` mikadoZero
  0 siblings, 0 replies; 6+ messages in thread
From: mikadoZero @ 2019-04-24 16:52 UTC (permalink / raw)
  To: Ivan Petkov; +Cc: help-guix

Thanks for pointing out the general steps.

I do not think I am going to be able to work on this soon.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-24 16:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-18  2:26 Rust development tools mikadoZero
2019-04-18 15:47 ` Ivan Petkov
2019-04-18 19:45   ` John Soo
2019-04-18 20:23   ` mikadoZero
2019-04-19  2:40     ` Ivan Petkov
2019-04-24 16:52       ` mikadoZero

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.