Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom rust version support #158

Open
srounce opened this issue Jun 8, 2024 · 2 comments
Open

Custom rust version support #158

srounce opened this issue Jun 8, 2024 · 2 comments

Comments

@srounce
Copy link

srounce commented Jun 8, 2024

It'd be great to be able to use Fenix to use custom rust toolchains such as esp-rs/rust. It's currently not clear how to go about doing this, or if it's even possible at all.

@srounce
Copy link
Author

srounce commented Jun 10, 2024

Okay so I sort of found a solution to this by taking the existing stable manifest and then merging a partial manifest of the custom toolchain over the top of it. In my case my partial manifest replaced the URLs and hashes for rust and rust-src:

{ pkgs, inputs, ... }:
let
  system = pkgs.stdenv.system;

  rustToolchainManifest = pkgs.lib.recursiveUpdate
    (builtins.fromJSON (builtins.readFile "${inputs.fenix}/data/stable.json"))
    (builtins.fromJSON (builtins.readFile ./esp-rs.json));

  toolchainAttrs = inputs.fenix.packages.${system}.fromManifest rustToolchainManifest;
in
{
  toolchain = toolchainAttrs.completeToolchain;
}

I'm still wondering is there a better way to go about this?

@DavSanchez
Copy link

I'm very interested in this. I tried your approach above @srounce and, while it mostly worked, I had some minor issues that prevented a smooth experience (tried this from aarch64-darwin). I can try to elaborate later on the specific issue I had but it would be great to know if there's a recommended way of achieving this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants