summaryrefslogtreecommitdiff
path: root/runtime/build.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-05-31 08:19:06 -0600
committerGitHub <noreply@github.com>2023-05-31 08:19:06 -0600
commit8e84dc0139055db8c84ad28723114d343982a8f7 (patch)
tree93238866035949af70c32769e651f0f3fae5cf83 /runtime/build.rs
parentd0efd040c79021958a1e83caa56572c0401ca1f2 (diff)
chore(core): Split JsRuntimeForSnapshot from JsRuntime (#19308)
This cleans up `JsRuntime` a bit more: * We no longer print cargo's rerun-if-changed messages in `JsRuntime` -- those are printed elsewhere * We no longer special case the OwnedIsolate for snapshots. Instead we make use of an inner object that has the `Drop` impl and allows us to `std::mem::forget` it if we need to extract the isolate for a snapshot * The `snapshot` method is only available on `JsRuntimeForSnapshot`, not `JsRuntime`. * `OpState` construction is slightly cleaner, though I'd still like to extract more --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/build.rs')
-rw-r--r--runtime/build.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/build.rs b/runtime/build.rs
index 334c3b11a..f656682a1 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -337,7 +337,7 @@ mod startup_snapshot {
runtime_main::init_ops_and_esm(),
];
- create_snapshot(CreateSnapshotOptions {
+ let output = create_snapshot(CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: None,
@@ -345,6 +345,9 @@ mod startup_snapshot {
compression_cb: None,
snapshot_module_load_cb: Some(Box::new(transpile_ts_for_snapshotting)),
});
+ for path in output.files_loaded_during_snapshot {
+ println!("cargo:rerun-if-changed={}", path.display());
+ }
}
}