Skip to content

Commit 5c328b8

Browse files
author
ffonion
committed
feat(vm): add host-agnostic resource and operation scopes
1 parent eafbc05 commit 5c328b8

205 files changed

Lines changed: 80042 additions & 8772 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ jobs:
6969
- name: Tests
7070
working-directory: rustscript
7171
run: cargo test --workspace
72+
- name: External host-extension fixture
73+
working-directory: rustscript
74+
run: |
75+
# The standalone fixture consumes only the public host-extension SDK.
76+
# It is its own (detached) workspace, so both commands run against
77+
# the job-level CARGO_TARGET_DIR (gitignored) — never a nested
78+
# target/ inside tests/fixtures/external-host-extension. --locked
79+
# pins the committed fixture Cargo.lock so drift in the pd-vm
80+
# dependency edge set fails CI instead of silently re-resolving.
81+
cargo check --locked --manifest-path tests/fixtures/external-host-extension/Cargo.toml
82+
cargo test --locked --manifest-path tests/fixtures/external-host-extension/Cargo.toml
7283
7384
pd-vm-cli:
7485
name: pd-vm CLI (${{ matrix.os }})

Cargo.lock

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ members = [
55
"pd-vm-nostd",
66
"pd-vm-wasm",
77
"crates/rustscript",
8+
"crates/pd-host-schema",
89
]
910
resolver = "2"
1011

@@ -86,14 +87,14 @@ edge_abi = { package = "pd-edge-abi", version = "0.1.1", default-features = fals
8687
futures-channel = "0.3"
8788
paste = "1"
8889
regex = "1"
89-
serde = "1"
90+
serde = { version = "1", features = ["derive"] }
9091
serde_json = "1"
9192
rt-format = "0.3.1"
9293
self_cell = "1"
9394
rustyline = { version = "14", optional = true }
9495

9596
[target.'cfg(windows)'.dependencies]
96-
windows-sys = { version = "0.59", features = ["Win32_System_Diagnostics_Debug", "Win32_System_Memory", "Win32_System_ProcessStatus", "Win32_System_Threading"] }
97+
windows-sys = { version = "0.59", features = ["Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Memory", "Win32_System_ProcessStatus", "Win32_System_Threading"] }
9798

9899
[target.'cfg(unix)'.dependencies]
99100
libc = "0.2"
@@ -103,12 +104,24 @@ futures-util = "0.3"
103104
rcgen = "0.13"
104105
syn = { version = "2", features = ["full"] }
105106
tokio = { version = "1", features = ["macros", "rt", "time", "sync"] }
107+
trybuild = "1"
108+
pd-host-schema = { path = "./crates/pd-host-schema" }
106109

107110
[[test]]
108111
name = "host_binding_generation_tests"
109112
path = "tests/host_binding_generation_tests.rs"
110113
required-features = ["cranelift-jit"]
111114

115+
[[test]]
116+
name = "host_resource_table_tests"
117+
path = "tests/host_resource_table_tests.rs"
118+
required-features = ["runtime"]
119+
120+
[[test]]
121+
name = "execution_scope_tests"
122+
path = "tests/execution_scope_tests.rs"
123+
required-features = ["runtime"]
124+
112125
[[test]]
113126
name = "http_host_tests"
114127
path = "tests/vm/http_host_tests.rs"
@@ -119,12 +132,52 @@ name = "http_sse_tests"
119132
path = "tests/vm/http_sse_tests.rs"
120133
required-features = ["runtime", "http-client"]
121134

135+
[[test]]
136+
name = "io_http_coexistence_tests"
137+
path = "tests/vm/io_http_coexistence_tests.rs"
138+
required-features = ["runtime", "http-client"]
139+
122140

123141

124142
[[test]]
125143
name = "sqlite_host_tests"
126144
path = "tests/vm/sqlite_host_tests.rs"
127145
required-features = ["sqlite"]
128146

147+
[[test]]
148+
name = "standard_staging_tests"
149+
path = "tests/vm/standard_staging_tests.rs"
150+
required-features = ["runtime", "http-client", "sqlite"]
151+
152+
[[test]]
153+
name = "core_host_boundary_tests"
154+
path = "tests/core_host_boundary_tests.rs"
155+
required-features = ["runtime"]
156+
157+
[[test]]
158+
name = "host_context_arch_tests"
159+
path = "tests/host_context_arch_tests.rs"
160+
required-features = ["runtime"]
161+
162+
[[test]]
163+
name = "host_context_execution_scope_tests"
164+
path = "tests/host_context_execution_scope_tests.rs"
165+
required-features = ["runtime"]
166+
167+
[[test]]
168+
name = "host_resource_type_inference_tests"
169+
path = "tests/host_resource_type_inference_tests.rs"
170+
171+
[[test]]
172+
name = "vm_resource_ownership_consumer_tests"
173+
path = "tests/vm_resource_ownership_consumer_tests.rs"
174+
required-features = ["runtime"]
175+
176+
[[test]]
177+
name = "vm_execution_scope_reset_tests"
178+
path = "tests/vm_execution_scope_reset_tests.rs"
179+
required-features = ["runtime"]
180+
129181
[build-dependencies]
130182
syn = { version = "2", features = ["full"] }
183+
pd-host-schema = { path = "./crates/pd-host-schema" }

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The complete language, runtime, and implementation guides live on the [RustScrip
1616
- [Runtime controls and artifacts](https://rustscript.org/docs/reference/runtime-controls/)
1717
- [Callable-driven HTTP client contract](docs/http-client.md)
1818
- [Script call frames and callable values](docs/callable-runtime.md)
19+
- [Scoped host resources and the host extension SDK](docs/scoped-host-resources.md)
1920
- [Compiler frontend syntax and feature support](src/compiler/frontends/README.md)
2021

2122
## Crate usage

0 commit comments

Comments
 (0)