-
Notifications
You must be signed in to change notification settings - Fork 58
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
RISC0 Rust backend #2792
RISC0 Rust backend #2792
Conversation
c68eac8
to
7d9891a
Compare
app/Commands/Compile/RiscZeroRust.hs
Outdated
let fs' = map (first relFile) fs | ||
forM_ (first (outDir <//>) <$> fs') (uncurry writeFile) | ||
|
||
writeFile :: Path Abs File -> ByteString -> Sem r () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function seems generic enough to be defined somewhere else. Maybe in Juvix.Data.Effect.Files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
app/Commands/Extra/NewCompile.hs
Outdated
mainFile <- getMainFile inp | ||
invokeDir <- askInvokeDir | ||
let baseOutputDir = invokeDir <//> filename (replaceExtension' (fileExtToString ext) mainFile) | ||
return $ absDir $ toFilePath baseOutputDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having some helper function like pathFileToPathDir : Path b File -> path b Dir
would make this more readable. The helper function can go to Juvix.Prelude.Path
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- name: Install RISC0 VM | ||
shell: bash | ||
run: | | ||
cargo install cargo-binstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be cached? This can be done in a subsequent PR if possible.
- name: Install RISC0 VM | ||
shell: bash | ||
run: | | ||
cargo install cargo-binstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be cached? This can be done in a subsequent PR if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried caching ~/.cargo/bin/r0vm
, but apparently it needs more than that. I think caching the whole ~/.cargo
directory would be enough, but I'm not sure how this should interact with the caching of the Rust toolchain that's done by the "Install Rust" action.
risc0-rust
to thecompile
CLI command, which creates a directory containing host and guest Rust sources for the RISC0 zkVM. The generated code can be compiled/run usingcargo
from inside the created directory (requires having RISC0 installed: https://dev.risczero.com/api/zkvm/install).