Commit 72e695c
authored
The two bumps that the v0.5.894 batch deferred as too-disruptive.
Addressed with focused migrations.
## toml 1.x
`<toml::Value as FromStr>` (called implicitly by
`.parse::<toml::Value>()`) is no longer a document parser — it now
parses inline values only. Four callsites swapped to
`toml::from_str::<toml::Value>(s)` (still document parser):
- crates/perry/src/commands/compile/well_known.rs:100
- crates/perry/src/commands/run.rs:343,829,1453
- crates/perry/src/commands/native/validate.rs:164
Restores 7 well_known + validate tests and 31 compile-smoke
regressions.
## deno_core 0.400 (v8 0.106 → 147.4.0)
API changes migrated in perry-jsruntime (5 source files + Cargo.toml):
- `v8::HandleScope` → `v8::PinScope<'_,'_>`
- `JsRuntime::handle_scope()` → `deno_core::scope!(scope, &mut runtime)`
- `v8::TryCatch::new(scope)` → `v8::tc_scope!(tc_scope, scope)`
- `Local<v8::String>::write_utf8` → `write_utf8_v2(buf, WriteFlags)`
- `anyhow::Error` → `deno_error::JsErrorBox` for op2 errors
- `extension!`'s `init_ops()` → `init()`
- `ModuleLoader::load` 4 params → 5 (new `ModuleLoadOptions` shape)
- `ModuleLoader::resolve` returns `ModuleLoaderError`
FFI surfaces preserved — perry-runtime/codegen/commands unchanged.
## Stack-limit override removed
Pre-bump `JsRuntimeState::new` called `Isolate::SetStackLimit` via the
Itanium-mangled `_ZN2v87Isolate13SetStackLimitEm` (since v8 0.106
didn't expose it in the Rust bindings). After the bump, calling that
symbol while the isolate is not entered silently exits the process
with exit code 0 — v8 147's stack-guard aborts cleanly instead of
crashing.
That's what was killing the three parity tests
(test_issue_248_phase2_js_interop, test_issue_248_phase2b_js_callback,
test_issue_255_jsruntime_reentrancy) — every test that loaded a .js
module called js_runtime_init → JsRuntimeState::new → silent exit.
Removed the manual override entirely; v8 147 picks a sane default
stack limit from the calling thread's bounds and deno_core::scope!
pins the isolate properly for each work scope.
## Validation
- cargo build --release -p perry-jsruntime -p perry-runtime
-p perry-stdlib -p perry clean
- cargo test --release -p perry --bin perry — 152/0
- cargo fmt --all -- --check clean
- All three previously-failing parity tests byte-equal Node
1 parent a449dc3 commit 72e695c
13 files changed
Lines changed: 586 additions & 438 deletions
File tree
- crates
- perry-jsruntime
- src
- perry/src/commands
- compile
- native
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments