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

create a rust-toolchain.toml file with channel="nightly" when the --nightly tag is set #24

Open
deerawj opened this issue Nov 18, 2024 · 8 comments

Comments

@deerawj
Copy link

deerawj commented Nov 18, 2024

sorry if the title is a bit too long; but this entire issue is basically title. I have no idea how this could be handled if there is already a rust-toolchain.toml file, but I think it would be nice if a new rust-toolchain.toml file is created atleast when there isn't one present; with

[toolchain]
channel = "nightly"

Also, I would happy to create a pull request for this

@Kobzol
Copy link
Owner

Kobzol commented Nov 18, 2024

That's an interesting idea. I agree that it could be useful, but I'm not sure if it's in scope for cargo-wizard. Should every Cargo tool that interacts with nightly features configure toolchain file? 🤔

Have you seen this behavior in other similar tools?

@deerawj
Copy link
Author

deerawj commented Nov 18, 2024

not really sure; I've never seen a tool that creates a rust-toolchain.toml file before. But, I don't think there's any reason to use the --nightly flag, if someones not using nightly, and I think using rust-toolchain.toml file is the easiest way to do this.

Also, since this is a configuration tool, some people might expect --nightly to actually switch the project to nightly, since just switching to nightly without using any of the nightly specific features could also lead to a compile time or performance improvement.

@Kobzol
Copy link
Owner

Kobzol commented Nov 18, 2024

I suppose that using the nightly options without using a nightly compiler is not useful, yeah. That being said, I use nightly in some projects, but I never used rust-toolchain.toml so far, I just use rustup override instead.

@deerawj
Copy link
Author

deerawj commented Nov 18, 2024

According to the rustup book lists 5 ways to change the toolchain to nightly; out of those 2 are global and 1 is temporary so the remaining options are rustup override and creating a rust-toolchain.toml file. But out of those two think creating the rust-toolchain.toml file seems the simplest option, it doesn't change anything outside of the project directory and reverting is just as simple as deleting the file.

@Kobzol
Copy link
Owner

Kobzol commented Nov 19, 2024

Ok. As long as there is a way to opt-out, I'd accept a PR for this :)

@linyihai
Copy link

linyihai commented Nov 20, 2024

if a new rust-toolchain.toml file is created atleast when there isn't one present

If the rust-toolchain.toml present, could you replace the channel with nightly

My problems is using cargo-wizard to generate the fast compile config, which uses mold linker and cranelift backend.

But it failed due to not found the codegen-backends

rust-toolchain.toml:

[toolchain]
channel = "nightly-2024-10-19"

failed log:
error: failed to find a codegen-backends folder in the sysroot candidates:
* /root/.rustup/toolchains/nightly-2024-10-19-x86_64-unknown-linux-gnu
* /root/.rustup/toolchains/nightly-2024-10-19-x86_64-unknown-linux-gnu

Besides,nightly-2024-10-19-x86_64-unknown-linux-gnu had installed.

rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /root/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2024-03-05-x86_64-unknown-linux-gnu
nightly-2024-04-23-x86_64-unknown-linux-gnu
nightly-2024-07-02-x86_64-unknown-linux-gnu
nightly-2024-08-11-x86_64-unknown-linux-gnu
nightly-2024-09-23-x86_64-unknown-linux-gnu
nightly-2024-10-11-x86_64-unknown-linux-gnu
nightly-2024-10-19-x86_64-unknown-linux-gnu
nightly-2024-11-09-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
stage1

active toolchain
----------------

nightly-2024-10-19-x86_64-unknown-linux-gnu (overridden by '/root/workspace/greptimedb/rust-toolchain.toml')
rustc 1.84.0-nightly (e92993dbb 2024-10-18)

@Kobzol
Copy link
Owner

Kobzol commented Nov 21, 2024

Please create a separate issue about that, thanks!

@linyihai
Copy link

Please create a separate issue about that, thanks!

I had opened a new issue here #25.

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

3 participants