(
paths: &PglitePaths,
runtime_layout: &RuntimeLayout,
)
| 2343 | } |
| 2344 | |
| 2345 | fn split_initdb_root_filesystem( |
| 2346 | paths: &PglitePaths, |
| 2347 | runtime_layout: &RuntimeLayout, |
| 2348 | ) -> Result<Arc<dyn virtual_fs::FileSystem + Send + Sync>> { |
| 2349 | let root: Arc<dyn virtual_fs::FileSystem + Send + Sync> = |
| 2350 | if runtime_layout.uses_shared_overlay() { |
| 2351 | let upper = virtual_fs::ArcFileSystem::new(maybe_trace_filesystem(host_filesystem( |
| 2352 | &paths.runtime_root(), |
| 2353 | )?)); |
| 2354 | let lower = virtual_fs::ArcFileSystem::new(maybe_trace_filesystem(host_filesystem( |
| 2355 | &runtime_layout.module_root, |
| 2356 | )?)); |
| 2357 | Arc::new(virtual_fs::OverlayFileSystem::new(upper, [lower])) |
| 2358 | } else { |
| 2359 | maybe_trace_filesystem(host_filesystem(&paths.runtime_root())?) |
| 2360 | }; |
| 2361 | |
| 2362 | let pgdata = maybe_trace_filesystem(host_filesystem(&paths.pgdata)?); |
| 2363 | // initdb execs a child postgres command during bootstrap. Keep PGDATA inside |
| 2364 | // the root filesystem view so both commands inherit the same /base mount. |
| 2365 | let root = wasi_root_with_pgdata_mount(root, pgdata)?; |
| 2366 | // Wasmer's runner normally starts from a temporary root that provides WASIX |
| 2367 | // device files. Keep the real runtime/PGDATA root mounted for database |
| 2368 | // writes, but route device paths such as /dev/urandom to virtual devices. |
| 2369 | Ok(wasi_root_with_devices(root)?) |
| 2370 | } |
| 2371 | |
| 2372 | fn run_package_command_with_root( |
| 2373 | runner: &WasiRunner, |
no test coverage detected