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

rust: replace fenix with rust-overlay allow specifying rust version #1500

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

eyJhb
Copy link
Contributor

@eyJhb eyJhb commented Oct 5, 2024

Adds basic support for specifying the version of the rust toolchain you want to use.
This change moves away from using fenix, to instead using rust-overlay.

It seems to work just fine, and is somewhat minimal invasive.
TODO:

  • Not sure what to do about removing the renamed option, and then using it again.. Is there any better ways?
  • Make targets work, nothing compiles atm.

Example:

{
  languages.rust = {
    enable = true;

    # latest stable version
    # channel = "stable";

    # nightly version
    # channel = "nightly";
    # version = "2024-06-20";

    # specific stable version
    # channel = "stable";
    # version = "1.70.0";

  };
}

@eyJhb eyJhb marked this pull request as draft October 5, 2024 16:36
@eyJhb eyJhb marked this pull request as ready for review October 5, 2024 16:36
@eyJhb eyJhb force-pushed the rust-versions branch 2 times, most recently from 2d0eb48 to b454a69 Compare October 5, 2024 17:26
@eyJhb eyJhb marked this pull request as draft October 5, 2024 18:04
@eyJhb
Copy link
Contributor Author

eyJhb commented Oct 5, 2024

I fixed targets not working, but it's not pretty. I copied combine.nix from fenix, and not sure what the better way is.

@eyJhb eyJhb marked this pull request as ready for review October 5, 2024 19:35
@domenkozar
Copy link
Member

We should error out of channel values in version, to properly instruct how to migrate for users that are still using version for channels.

@domenkozar
Copy link
Member

FYI, both rust examples fail in CI.

@domenkozar domenkozar marked this pull request as draft October 24, 2024 09:31
@domenkozar
Copy link
Member

@eyJhb would be great to get this in!

@eyJhb
Copy link
Contributor Author

eyJhb commented Nov 15, 2024

We should error out of channel values in version, to properly instruct how to migrate for users that are still using version for channels.

I am unsure how this should be done, can you give me any pointers? Tests and docs should be fixed now. The failing test on main should also be working now (it seemed to be failing before).

@domenkozar
Copy link
Member

Nice! I think it needs pre-commit run -a

@eyJhb
Copy link
Contributor Author

eyJhb commented Nov 16, 2024

Nice! I think it needs pre-commit run -a

Should be done now! :)

@eyJhb eyJhb marked this pull request as ready for review November 16, 2024 20:01
@domenkozar
Copy link
Member

It seems like rust-cross-wasm failed with clippy hook:

0000.12:     Checking devenv-tasks v0.1.0 (/run/github-runner/cachix-x86_64-linux-1/devenv/devenv/devenv-tasks)
0000.12: error: the `-Z unstable-options` flag must also be passed to enable the flag `check-cfg`
0000.12: 
0000.12: error: could not compile `devenv-tasks` (lib)
0000.12: warning: build failed, waiting for other jobs to finish...
0000.12: 

@domenkozar
Copy link
Member

Ah, seems that's an existing bug using git-hooks. I'll test this soon!

@eyJhb
Copy link
Contributor Author

eyJhb commented Nov 30, 2024

@domenkozar rebased ! :)

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

Successfully merging this pull request may close these issues.

2 participants