1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

chore: bump deno_core (#22443)

Migrations:

 - Use the new SnapshotSerializer for TSC/compiler snapshots
This commit is contained in:
Matt Mastracci 2024-02-17 15:22:46 -07:00 committed by GitHub
parent 828d9b8485
commit 08071f9561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 22 deletions

13
Cargo.lock generated
View file

@ -1239,11 +1239,12 @@ dependencies = [
[[package]]
name = "deno_core"
version = "0.262.0"
version = "0.263.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0c12fbe4f2c497ff53de92dd698a27d93f8e9c2519ea5684f608cb9f4ef44b"
checksum = "51813f22cdde234648c7aa7b070f92ba176ec5f5b48c232218102917e8c8672c"
dependencies = [
"anyhow",
"bincode",
"bit-set",
"bit-vec",
"bytes",
@ -1690,9 +1691,9 @@ dependencies = [
[[package]]
name = "deno_ops"
version = "0.138.0"
version = "0.139.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04698b09128a026abe3d8a82fdb231baf1a35f07443844728fe1441b2c2340f1"
checksum = "cd7ceebc85c86baad21fff65fd8c603ee14430dd560e0c63591ed0c75b538f51"
dependencies = [
"proc-macro-rules",
"proc-macro2",
@ -5530,9 +5531,9 @@ dependencies = [
[[package]]
name = "serde_v8"
version = "0.171.0"
version = "0.172.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88a2746b1f9e4015ee5f325bb87ab0f1891b76c38dfb1675bc83857eaf6451d0"
checksum = "b1700eea7391e2979f456a77f735cadacfb63b557d638950f64f81accecba980"
dependencies = [
"bytes",
"derive_more",

View file

@ -43,7 +43,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies]
deno_ast = { version = "0.33.2", features = ["transpiling"] }
deno_core = { version = "0.262.0" }
deno_core = { version = "0.263.0", features = ["snapshot_data_bincode"] }
deno_bench_util = { version = "0.132.0", path = "./bench_util" }
deno_lockfile = "0.19.0"

View file

@ -3,7 +3,7 @@
use std::env;
use std::path::PathBuf;
use deno_core::snapshot_util::*;
use deno_core::snapshot::*;
use deno_runtime::*;
mod ts {
@ -266,10 +266,13 @@ mod ts {
)
.unwrap();
let snapshot_to_file = SnapshotFileSerializer::new(
std::fs::File::create(snapshot_path).unwrap(),
);
let output = create_snapshot(
CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: None,
extensions: vec![deno_tsc::init_ops_and_esm(
op_crate_libs,
@ -281,21 +284,28 @@ mod ts {
// Thus we're not not using compressed snapshot, trading off
// a lot of build time for some startup time in debug build.
#[cfg(debug_assertions)]
compression_cb: None,
serializer: Box::new(snapshot_to_file),
#[cfg(not(debug_assertions))]
compression_cb: Some(Box::new(|vec, snapshot_slice| {
eprintln!("Compressing TSC snapshot...");
vec.extend_from_slice(
&zstd::bulk::compress(snapshot_slice, 22)
.expect("snapshot compression failed"),
);
})),
serializer: Box::new(SnapshotBulkCompressingSerializer::new(
snapshot_to_file,
|snapshot| {
eprintln!("Compressing TSC snapshot...");
let mut vec = Vec::with_capacity(snapshot.len());
vec.extend((snapshot.len() as u32).to_le_bytes());
vec.extend_from_slice(
&zstd::bulk::compress(&snapshot, 22)
.expect("snapshot compression failed"),
);
Ok(vec)
},
)),
with_runtime_cb: None,
skip_op_registration: false,
},
None,
);
)
.unwrap();
for path in output.files_loaded_during_snapshot {
println!("cargo:rerun-if-changed={}", path.display());
}

View file

@ -6,7 +6,7 @@ use crate::shared::maybe_transpile_source;
use crate::shared::runtime;
use deno_cache::SqliteBackedCache;
use deno_core::error::AnyError;
use deno_core::snapshot_util::*;
use deno_core::snapshot::*;
use deno_core::v8;
use deno_core::Extension;
use deno_http::DefaultHttpPropertyExtractor;
@ -268,10 +268,11 @@ pub fn create_runtime_snapshot(
let output = create_snapshot(
CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: None,
extensions,
compression_cb: None,
serializer: Box::new(SnapshotFileSerializer::new(
std::fs::File::create(snapshot_path).unwrap(),
)),
with_runtime_cb: Some(Box::new(|rt| {
let isolate = rt.v8_isolate();
let scope = &mut v8::HandleScope::new(isolate);
@ -282,7 +283,8 @@ pub fn create_runtime_snapshot(
skip_op_registration: false,
},
None,
);
)
.unwrap();
for path in output.files_loaded_during_snapshot {
println!("cargo:rerun-if-changed={}", path.display());
}