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

add rust-toolchain.toml for the host program #262

Open
onur-ozkan opened this issue Aug 2, 2024 · 8 comments
Open

add rust-toolchain.toml for the host program #262

onur-ozkan opened this issue Aug 2, 2024 · 8 comments

Comments

@onur-ozkan
Copy link

What is the problem?

When creating projects with cargo nexus host $project, nexus generates rust-toolchain.toml file for the guest program but not for the host program.

This leads to two issues:

  1. Users needs to manually install the RISC-V target for the toolchain (cc development experience improvements #256).
  2. If the default toolchain differs from the one used by the guest program, it will result in installing the RISC-V target twice (once for the guest and once for the host).

What do you want to happen?

Include the same rust-toolchain.toml file in the host program.

Existing alternatives

N/A

Additional notes

N/A

@onur-ozkan onur-ozkan changed the title add rust-toolchain.toml add rust-toolchain.toml for the host program Aug 2, 2024
@danielmarinq
Copy link
Contributor

Thanks @onur-ozkan, @slumber can you take a look?

@onur-ozkan
Copy link
Author

Moving guest rust-toolchain.toml to the workspace level should be enough too. It doesn't need to be duplicated for per project.

@slumber
Copy link
Contributor

slumber commented Aug 2, 2024

Eventually we want to unfreeze the toolchain, it's probably possible already, I need to check

@onur-ozkan
Copy link
Author

FWIW you can remove the channel section from rust-toolchain.toml to unfreeze the toolchain version while keeping the targets field to automatically handle targets for the user's toolchain.

@slumber
Copy link
Contributor

slumber commented Aug 2, 2024

Guest programs required specific version, otherwise the VM used to panic with Jolt. This needs to be double checked.

Freezing the toolchain for host isn't proper solution, cargo install will ignore it and users will bump into it anyway.

UPD: jolt still requires frozen toolchain

@onur-ozkan
Copy link
Author

Interesting. I don't know much about the build internals of this project, but it seems that the rust-toolchain.toml file on the guest side isn't being respected.

The toolchain configuration for the guest side looks like this:

[toolchain]
channel = "1.77.0"
targets = ["riscv32i-unknown-none-elf"]

However, I don't have 1.77.0 installed on my system, yet I can still run the program with cargo run -r.

@slumber
Copy link
Contributor

slumber commented Aug 2, 2024

You can try

cargo nexus prove --impl=jolt

with toolchain file present and removed.

@onur-ozkan
Copy link
Author

onur-ozkan commented Aug 2, 2024

I see, so it's used for certain builds. I still think (as a user) it would be nice to have a rust-toolchain.toml file (without the channel field to avoid locking the toolchain) on the host side. This would eliminate the need to manually install the RISC-V target as rustup will handle that automatically once the build starts.

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