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

fix: change the rust tool chain in shell.nix from stable to nightly #314

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

15cm
Copy link
Contributor

@15cm 15cm commented Oct 24, 2023

The rustfmt.toml rules are only supported by rust nightly. With the current stable rust tool chain in flake.nix, cargo fmt gives me warnings like

Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = false`, unstable features are only available in n

The format result with those warnings is different from the current code base for almost all files. I guess the main contributors of the repo use nightly rust. If so, we should make it consistent in shell.nix to help other contributors onboard with the same env.

@sxyazi
Copy link
Owner

sxyazi commented Oct 24, 2023

Thank you for the PR!

Will these changes affect regular users? I've completely forgotten my Nix knowledge :D

Note that the rust version is still stable in flake.nix which is used to build
the provide the app via flake.

The rustfmt.toml rules are only supported by rust nightly. With the current
stable rust tool chain in flake.nix, `cargo fmt` gives me warnings like
```
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = false`, unstable features are only available in n
```

The format result with those warnings is different from the current code base
for almost all files. I guess the main contributors of the repo use nightly
rust. If so, we should make it consistent in shell.nix to help other
contributors onboard with the same env.
@15cm 15cm force-pushed the inconsistent-fmt-result branch from e1b3853 to 647bda9 Compare October 24, 2023 08:09
@15cm 15cm changed the title fix: Change the rust tool chain in flake.nix from stable to nightly fix: Change the rust tool chain in shell.nix from stable to nightly Oct 24, 2023
@15cm
Copy link
Contributor Author

15cm commented Oct 24, 2023

Good point. I didn't realize you provide the package via flake as well (I fetch the package from nixpkg). I limited the stable->nightly to shell.nix which is only for dev shell. The content of flake.nix is untouched so the package is still built via stable rust and it won't affect end users. The diff of flake.nix is formatting only.

@sxyazi
Copy link
Owner

sxyazi commented Oct 24, 2023

Thank you!

@sxyazi sxyazi changed the title fix: Change the rust tool chain in shell.nix from stable to nightly fix: change the rust tool chain in shell.nix from stable to nightly Oct 24, 2023
@sxyazi sxyazi merged commit b46e71a into sxyazi:main Oct 24, 2023
3 checks passed
@15cm 15cm deleted the inconsistent-fmt-result branch October 25, 2023 04:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants