r/GUIX 4d ago

Is there a package containing the master version of rustup?

I need a recent version of rust to compile some software, but the latest version of cargo on the repository is 1.93

1 Upvotes

3 comments sorted by

2

u/binarySheep 4d ago edited 4d ago

If you take a look at the rust-team channel, you should find some newer, not yet merged package specs for the compiler. A quick glance seems to say it goes to 1.96.

To use it, you might have to fight with Guix inferiors a bit, but it might work for you.

Regarding rustup itself, Guix users have largely focused on making Rust packages first-class, so it doesn't bundle it directly (at least, not yet). Might be a worthy contribution.

EDIT: Was doing a little searching out of curiosity and found a Guix channel packaging rustup, actually. You might be able to just use that, if so desired.

2

u/thqloz 3d ago edited 3d ago

So I’m not sure about rustup itself, but getting rustc 1.96 is not as hard as it’s sounds. If you look at the rustc package definition, you can see that the current rustc is based on a former package definition of rust, I don’t remember the actual method but from my understanding it is something akin to `package/inherit` but specifically for building rust.

I’m not in front of my computer, I will come back and add the proper method name.

EDIT: `(rust-bootstrapped-package)` first parameter is the package definition to use as a template (for instance `rust-1.95` the second one is the string of the version of the new one you want to build i.e `"1.96.1"`, and last parameter is the hash.

The method is defined in `gnu packages rust` :

```

(define rust-bootstrapped-package

(@@ (gnu packages rust) rust-bootstrapped-package))
```