Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
with:
path: app
- uses: dtolnay/rust-toolchain@1.94.1
- uses: dtolnay/rust-toolchain@1.96.1
with:
components: clippy, rustfmt
- name: Format
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v4
with:
path: app
- uses: dtolnay/rust-toolchain@1.94.1
- uses: dtolnay/rust-toolchain@1.96.1
with:
components: llvm-tools-preview
targets: riscv32imc-unknown-none-elf,riscv32imafc-unknown-none-elf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
with:
path: app
- uses: dtolnay/rust-toolchain@1.94.1
- uses: dtolnay/rust-toolchain@1.96.1
with:
components: llvm-tools-preview
targets: riscv32imc-unknown-none-elf,riscv32imafc-unknown-none-elf
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ wifi = []
bluetooth = []

[dependencies]
pd_vm_nostd = { package = "pd-vm-nostd", git = "https://github.com/rustscript-lang/rustscript.git", rev = "b1d6cffede77f49410bf63525f30b9a46b02dc01", version = "0.1.0", optional = true }
pd_vm_nostd = { package = "pd-vm-nostd", git = "https://github.com/rustscript-lang/rustscript.git", rev = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73", version = "0.1.0", optional = true }
serialport = { version = "4.8.1", default-features = false, optional = true }
vm = { package = "pd-vm", git = "https://github.com/rustscript-lang/rustscript.git", rev = "b1d6cffede77f49410bf63525f30b9a46b02dc01", version = "0.1.0", default-features = false, optional = true }
vm = { package = "pd-vm", git = "https://github.com/rustscript-lang/rustscript.git", rev = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73", version = "0.1.0", default-features = false, optional = true }

[profile.release]
opt-level = "z"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.94"
channel = "1.96"
profile = "minimal"
components = ["clippy", "llvm-tools-preview", "rustfmt"]
targets = ["riscv32imc-unknown-none-elf", "riscv32imafc-unknown-none-elf"]
5 changes: 4 additions & 1 deletion src/repl_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,10 @@ mod tests {
let mut session = SerialReplSession::new();
let mut transport = VmTransport::default();
session
.eval("let text: string? = \"hello\";", &mut transport)
.eval(
"let text: Option<string> = Option::Some(\"hello\");",
&mut transport,
)
.unwrap();
session.eval("let other = text;", &mut transport).unwrap();
let calls = transport.calls;
Expand Down
5 changes: 4 additions & 1 deletion tests/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ fn stateful_repl_rejects_moved_optional_string_before_transport() {
board: BoardState::default(),
};
session
.eval("let text: string? = \"hello\";", &mut transport)
.eval(
"let text: Option<string> = Option::Some(\"hello\");",
&mut transport,
)
.unwrap();
session.eval("let other = text;", &mut transport).unwrap();
assert!(session.eval("text", &mut transport).is_err());
Expand Down
13 changes: 10 additions & 3 deletions tests/frozen_core_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::process::Command;
use rustscript_embedded::{RunOutcome, run_source_file};
use vm::{compile_source_file, decode_program, encode_program};

const FROZEN_RUSTSCRIPT_REV: &str = "b1d6cffede77f49410bf63525f30b9a46b02dc01";
const FROZEN_RUSTSCRIPT_REV: &str = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73";
const RUSTSCRIPT_GIT: &str = "https://github.com/rustscript-lang/rustscript.git";
const EXPECTED_BUNDLED_RSS: usize = 4;
const REQUIRED_LOCK_PACKAGES: &[&str] =
Expand Down Expand Up @@ -74,6 +74,13 @@ fn rustscript_lock_source() -> String {
format!("git+{RUSTSCRIPT_GIT}?rev={FROZEN_RUSTSCRIPT_REV}#{FROZEN_RUSTSCRIPT_REV}")
}

/// The VMBC header stores magic then the wire version; bumping the encoded
/// version guarantees an unsupported version whichever one `encode_program`
/// currently emits.
fn unsupported_wire_version(bytes: &[u8]) -> u16 {
u16::from_le_bytes([bytes[4], bytes[5]]).wrapping_add(1)
}

fn collect_files(dir: &Path, out: &mut Vec<PathBuf>) {
for entry in fs::read_dir(dir).unwrap_or_else(|error| panic!("read {}: {error}", dir.display()))
{
Expand Down Expand Up @@ -364,7 +371,7 @@ fn vmbc_guest_sections_parse_or_reject_and_host_state_stays_off_the_wire() {
}

let mut unsupported = bytes.clone();
unsupported[4..6].copy_from_slice(&14u16.to_le_bytes());
unsupported[4..6].copy_from_slice(&unsupported_wire_version(&bytes).to_le_bytes());
decode_program(&unsupported).expect_err("unsupported VMBC version must reject");

let mut trailing = bytes.clone();
Expand Down Expand Up @@ -394,7 +401,7 @@ mod nostd_wire {
}

let mut unsupported = bytes.clone();
unsupported[4..6].copy_from_slice(&14u16.to_le_bytes());
unsupported[4..6].copy_from_slice(&unsupported_wire_version(&bytes).to_le_bytes());
decode_nostd(&unsupported).expect_err("no_std decoder must reject unsupported version");

let mut trailing = bytes.clone();
Expand Down
Loading