|
1 | 1 | use super::clocks::host::{monotonic_clock, wall_clock}; |
2 | 2 | use crate::preview2::{ |
3 | 3 | bindings::cli::{terminal_input, terminal_output}, |
4 | | - bindings::filesystem::types::Descriptor, |
5 | 4 | bindings::io::streams, |
6 | 5 | clocks::{self, HostMonotonicClock, HostWallClock}, |
7 | | - filesystem::{Dir, TableFsExt}, |
| 6 | + filesystem::Dir, |
8 | 7 | pipe, random, stdio, |
9 | 8 | stdio::{HostTerminalInputState, HostTerminalOutputState}, |
10 | 9 | stream::{HostInputStream, HostOutputStream, TableStreamExt}, |
@@ -317,16 +316,6 @@ impl WasiCtxBuilder { |
317 | 316 | let stdout = Some(table.push_output_stream(stdout.0).context("stdout")?); |
318 | 317 | let stderr = Some(table.push_output_stream(stderr.0).context("stderr")?); |
319 | 318 |
|
320 | | - let preopens = preopens |
321 | | - .into_iter() |
322 | | - .map(|(dir, path)| { |
323 | | - let dirfd = table |
324 | | - .push_dir(dir) |
325 | | - .with_context(|| format!("preopen {path:?}"))?; |
326 | | - Ok((dirfd, path)) |
327 | | - }) |
328 | | - .collect::<anyhow::Result<Vec<_>>>()?; |
329 | | - |
330 | 319 | Ok(WasiCtx { |
331 | 320 | stdin, |
332 | 321 | stdin_terminal, |
@@ -362,7 +351,7 @@ pub struct WasiCtx { |
362 | 351 | pub(crate) monotonic_clock: Box<dyn HostMonotonicClock + Send + Sync>, |
363 | 352 | pub(crate) env: Vec<(String, String)>, |
364 | 353 | pub(crate) args: Vec<String>, |
365 | | - pub(crate) preopens: Vec<(Resource<Descriptor>, String)>, |
| 354 | + pub(crate) preopens: Vec<(Dir, String)>, |
366 | 355 | pub(crate) stdin: Option<Resource<streams::InputStream>>, |
367 | 356 | pub(crate) stdout: Option<Resource<streams::OutputStream>>, |
368 | 357 | pub(crate) stderr: Option<Resource<streams::OutputStream>>, |
|
0 commit comments