Skip to content

Commit b12c91e

Browse files
committed
feat: Succinct Rust toolchain 1.88.0
1 parent 6b00bc3 commit b12c91e

File tree

22 files changed

+176
-407
lines changed

22 files changed

+176
-407
lines changed

.github/workflows/ci.yml

Lines changed: 84 additions & 300 deletions
Large diffs are not rendered by default.

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
build:
8+
uses: ./.github/workflows/ci.yml
9+
release:
10+
needs: build
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Download artifacts
16+
uses: actions/download-artifact@v4
17+
with:
18+
path: artifacts
19+
- name: List artifact contents
20+
run: |
21+
echo "Listing artifacts directory:"
22+
ls -R artifacts
23+
- name: Create release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
echo "Installing gh CLI..."
28+
curl -L https://github.com/cli/cli/releases/download/v2.17.0/gh_2.17.0_linux_amd64.tar.gz | \
29+
tar xvz --strip-components=2 --exclude=man
30+
chmod +x ./gh
31+
mkdir tars
32+
find artifacts -name "*.tar.gz" -exec mv {} tars/ \;
33+
if [ "$(ls -A tars)" ]; then
34+
./gh release create -p --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/* || \
35+
./gh release upload --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/*
36+
else
37+
echo "No files to release. Exiting."
38+
exit 1
39+
fi

compiler/rustc_target/src/spec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ supported_targets! {
19561956
("x86_64-unknown-trusty", x86_64_unknown_trusty),
19571957

19581958
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
1959-
("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf),
1959+
("riscv32im-succinct-zkvm-elf", riscv32im_succinct_zkvm_elf),
19601960
("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf),
19611961
("riscv32ima-unknown-none-elf", riscv32ima_unknown_none_elf),
19621962
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),

compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs renamed to compiler/rustc_target/src/spec/targets/riscv32im_succinct_zkvm_elf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
88
llvm_target: "riscv32".into(),
99
metadata: TargetMetadata {
10-
description: Some("RISC Zero's zero-knowledge Virtual Machine (RV32IM ISA)".into()),
10+
description: Some("Succinct's zero-knowledge Virtual Machine (RV32IM ISA)".into()),
1111
tier: Some(3),
1212
host_tools: Some(false),
1313
std: None, // ?
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717

1818
options: TargetOptions {
1919
os: "zkvm".into(),
20-
vendor: "risc0".into(),
20+
vendor: "succinct".into(),
2121
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
2222
linker: Some("rust-lld".into()),
2323
cpu: "generic-rv32".into(),

library/panic_abort/src/zkvm.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ pub(crate) unsafe fn zkvm_set_abort_message(payload: &mut dyn PanicPayload) {
1212
None => &[],
1313
},
1414
};
15-
if msg.is_empty() {
16-
return;
17-
}
1815

1916
unsafe extern "C" {
2017
fn sys_panic(msg_ptr: *const u8, len: usize) -> !;

library/std/src/sys/args/zkvm.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use crate::ffi::OsString;
22
use crate::fmt;
3-
use crate::sys::os_str;
4-
use crate::sys::pal::{WORD_SIZE, abi};
5-
use crate::sys_common::FromInner;
63

74
pub struct Args {
85
i_forward: usize,
@@ -11,30 +8,13 @@ pub struct Args {
118
}
129

1310
pub fn args() -> Args {
14-
let count = unsafe { abi::sys_argc() };
15-
Args { i_forward: 0, i_back: 0, count }
11+
Args { i_forward: 0, i_back: 0, count: 0 }
1612
}
1713

1814
impl Args {
19-
/// Use sys_argv to get the arg at the requested index. Does not check that i is less than argc
20-
/// and will not return if the index is out of bounds.
21-
fn argv(i: usize) -> OsString {
22-
let arg_len = unsafe { abi::sys_argv(crate::ptr::null_mut(), 0, i) };
23-
24-
let arg_len_words = (arg_len + WORD_SIZE - 1) / WORD_SIZE;
25-
let words = unsafe { abi::sys_alloc_words(arg_len_words) };
26-
27-
let arg_len2 = unsafe { abi::sys_argv(words, arg_len_words, i) };
28-
debug_assert_eq!(arg_len, arg_len2);
29-
30-
// Convert to OsString.
31-
//
32-
// FIXME: We can probably get rid of the extra copy here if we
33-
// reimplement "os_str" instead of just using the generic unix
34-
// "os_str".
35-
let arg_bytes: &[u8] =
36-
unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, arg_len) };
37-
OsString::from_inner(os_str::Buf { inner: arg_bytes.to_vec() })
15+
/// Args::argv is currently not implemented.
16+
fn argv(_i: usize) -> OsString {
17+
panic!("Args::argv is currently not implemented");
3818
}
3919
}
4020

library/std/src/sys/pal/zkvm/abi.rs

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//! ABI definitions for symbols exported by risc0-zkvm-platform.
1+
//! ABI definitions for symbols exported by sp1-zkvm.
22
3-
// Included here so we don't have to depend on risc0-zkvm-platform.
3+
// Included here so we don't have to depend on sp1-zkvm.
44
//
55
// FIXME: Should we move this to the "libc" crate? It seems like other
66
// architectures put a lot of this kind of stuff there. But there's
7-
// currently no risc0 fork of the libc crate, so we'd either have to
7+
// currently no succinct fork of the libc crate, so we'd either have to
88
// fork it or upstream it.
99

1010
#![allow(dead_code)]
@@ -19,35 +19,16 @@ pub mod fileno {
1919
}
2020

2121
unsafe extern "C" {
22-
// Wrappers around syscalls provided by risc0-zkvm-platform:
23-
pub fn sys_halt();
24-
pub fn sys_output(output_id: u32, output_value: u32);
25-
pub fn sys_sha_compress(
26-
out_state: *mut [u32; DIGEST_WORDS],
27-
in_state: *const [u32; DIGEST_WORDS],
28-
block1_ptr: *const [u32; DIGEST_WORDS],
29-
block2_ptr: *const [u32; DIGEST_WORDS],
30-
);
31-
pub fn sys_sha_buffer(
32-
out_state: *mut [u32; DIGEST_WORDS],
33-
in_state: *const [u32; DIGEST_WORDS],
34-
buf: *const u8,
35-
count: u32,
36-
);
37-
pub fn sys_rand(recv_buf: *mut u32, words: usize);
22+
// Wrappers around syscalls provided by sp1-zkvm-platform:
23+
pub fn sys_rand(recv_buf: *mut u8, words: usize);
3824
pub fn sys_panic(msg_ptr: *const u8, len: usize) -> !;
39-
pub fn sys_log(msg_ptr: *const u8, len: usize);
40-
pub fn sys_cycle_count() -> usize;
41-
pub fn sys_read(fd: u32, recv_buf: *mut u8, nrequested: usize) -> usize;
4225
pub fn sys_write(fd: u32, write_buf: *const u8, nbytes: usize);
4326
pub fn sys_getenv(
4427
recv_buf: *mut u32,
4528
words: usize,
4629
varname: *const u8,
4730
varname_len: usize,
4831
) -> usize;
49-
pub fn sys_argc() -> usize;
50-
pub fn sys_argv(out_words: *mut u32, out_nwords: usize, arg_index: usize) -> usize;
5132

5233
// Allocate memory from global HEAP.
5334
pub fn sys_alloc_words(nwords: usize) -> *mut u32;

library/std/src/sys/pal/zkvm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! System bindings for the risc0 zkvm platform
1+
//! System bindings for the succinct zkvm platform
22
//!
33
//! This module contains the facade (aka platform-specific) implementations of
44
//! OS level functionality for zkvm.

library/std/src/sys/random/zkvm.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
use crate::sys::pal::abi;
22

33
pub fn fill_bytes(bytes: &mut [u8]) {
4-
let (pre, words, post) = unsafe { bytes.align_to_mut::<u32>() };
5-
if !words.is_empty() {
6-
unsafe {
7-
abi::sys_rand(words.as_mut_ptr(), words.len());
8-
}
9-
}
4+
unsafe { abi::sys_rand(bytes.as_mut_ptr(), bytes.len()) };
5+
}
106

11-
let mut buf = [0u32; 2];
12-
let len = (pre.len() + post.len() + size_of::<u32>() - 1) / size_of::<u32>();
13-
if len != 0 {
14-
unsafe { abi::sys_rand(buf.as_mut_ptr(), len) };
15-
}
7+
// let mut buf = [0u32; 2];
8+
// let len = (pre.len() + post.len() + size_of::<u32>() - 1) / size_of::<u32>();
9+
// if len != 0 {
10+
// unsafe { abi::sys_rand(buf.as_mut_ptr(), len) };
11+
// }
1612

17-
let buf = buf.map(u32::to_ne_bytes);
18-
let buf = buf.as_flattened();
19-
pre.copy_from_slice(&buf[..pre.len()]);
20-
post.copy_from_slice(&buf[pre.len()..pre.len() + post.len()]);
21-
}
13+
// let buf = buf.map(u32::to_ne_bytes);
14+
// let buf = buf.as_flattened();
15+
// pre.copy_from_slice(&buf[..pre.len()]);
16+
// post.copy_from_slice(&buf[pre.len()..pre.len() + post.len()]);
17+
//}

library/std/src/sys/stdio/zkvm.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::io::{self, BorrowedCursor};
1+
use crate::io;
22
use crate::sys::pal::abi::{self, fileno};
33

44
pub struct Stdin;
@@ -12,16 +12,11 @@ impl Stdin {
1212
}
1313

1414
impl io::Read for Stdin {
15-
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
16-
Ok(unsafe { abi::sys_read(fileno::STDIN, buf.as_mut_ptr(), buf.len()) })
17-
}
18-
19-
fn read_buf(&mut self, mut buf: BorrowedCursor<'_>) -> io::Result<()> {
20-
unsafe {
21-
let n = abi::sys_read(fileno::STDIN, buf.as_mut().as_mut_ptr().cast(), buf.capacity());
22-
buf.advance_unchecked(n);
23-
}
24-
Ok(())
15+
fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
16+
return Err(io::Error::new(
17+
io::ErrorKind::Other,
18+
"io::Read for Stdin is currently not implemented",
19+
));
2520
}
2621
}
2722

0 commit comments

Comments
 (0)