From b52aede1a471713093cc1fe3e2b2ab35628f836634033a355319e262871c1647 Mon Sep 17 00:00:00 2001 From: Avindra Goolcharan Date: Sun, 4 Jul 2021 06:16:26 +0000 Subject: [PATCH] Enable sparkplug. Also dealt with rusty_v8 breaking changes OBS-URL: https://build.opensuse.org/package/show/devel:languages:javascript/deno?expand=0&rev=36 --- .gitattributes | 2 ++ deno-69.patch | 50 +++++++++++++++++++++++++++++++++++++++++++++----- deno.changes | 2 ++ deno.spec | 4 ++++ icudtl.dat | 3 +++ 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 icudtl.dat diff --git a/.gitattributes b/.gitattributes index 9b03811..55a6335 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,3 +21,5 @@ *.xz filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text +## Specific LFS patterns +icudtl.dat filter=lfs diff=lfs merge=lfs -text diff --git a/deno-69.patch b/deno-69.patch index 1004cad..20491fa 100644 --- a/deno-69.patch +++ b/deno-69.patch @@ -1,13 +1,53 @@ diff --git a/core/runtime.rs.1 b/core/runtime.rs index 71aad8e..a806ecd 100644 ---- a/core/runtime.rs.1 -+++ b/core/runtime.rs -@@ -145,7 +145,7 @@ fn v8_init(v8_platform: Option>) { +@@ -140,16 +140,15 @@ impl Drop for JsRuntime { + } + } + +-fn v8_init(v8_platform: Option>) { ++fn v8_init(v8_platform: Option>) { + // Include 10MB ICU data file. #[repr(C, align(16))] - struct IcuData([u8; 10413584]); +- struct IcuData([u8; 10413584]); ++ struct IcuData([u8; 10144432]); static ICU_DATA: IcuData = IcuData(*include_bytes!("icudtl.dat")); - v8::icu::set_common_data(&ICU_DATA.0).unwrap(); + v8::icu::set_common_data_69(&ICU_DATA.0).unwrap(); let v8_platform = v8_platform - .unwrap_or_else(v8::new_default_platform) +- .unwrap_or_else(v8::new_default_platform) +- .unwrap(); ++ .unwrap_or_else(|| v8::new_default_platform(0, false).make_shared()); + v8::V8::initialize_platform(v8_platform); + v8::V8::initialize(); + +@@ -159,9 +158,10 @@ fn v8_init(v8_platform: Option>) { + // PumpMessageLoop and RunMicrotasks setup correctly. + // See https://github.com/denoland/deno/issues/2544 + " --experimental-wasm-threads", +- " --no-wasm-async-compilation", ++ " --wasm-test-streaming", + " --harmony-import-assertions", + " --no-validate-asm", ++ " --sparkplug", + ); + v8::V8::set_flags_from_string(flags); + } +@@ -203,7 +203,7 @@ pub struct RuntimeOptions { + + /// V8 platform instance to use. Used when Deno initializes V8 + /// (which it only does once), otherwise it's silenty dropped. +- pub v8_platform: Option>, ++ pub v8_platform: Option>, + + /// Create a V8 inspector and attach to the runtime. + pub attach_inspector: bool, +@@ -1966,7 +1966,7 @@ main(); + #[test] + fn test_v8_platform() { + let options = RuntimeOptions { +- v8_platform: Some(v8::new_default_platform()), ++ v8_platform: Some(v8::new_default_platform(0, false).make_shared()), + ..Default::default() + }; + let mut runtime = JsRuntime::new(options); diff --git a/deno.changes b/deno.changes index 754d281..ede455d 100644 --- a/deno.changes +++ b/deno.changes @@ -1,7 +1,9 @@ ------------------------------------------------------------------- Sun Jul 4 05:16:39 UTC 2021 - Avindra Goolcharan +- pass --sparkplug v8 flag - added ff-serde.patch +- rework deno-69.patch with more breaking changes - manually update serde_v8 to 0.8.0 in vendor tarball ------------------------------------------------------------------- diff --git a/deno.spec b/deno.spec index 4ef7647..0f5b709 100644 --- a/deno.spec +++ b/deno.spec @@ -27,6 +27,8 @@ Group: Productivity/Other URL: https://github.com/denoland/deno Source0: %{name}-%{version}.tar.xz Source1: vendor.tar.xz +# new icu data file +Source2: https://github.com/denoland/deno/raw/main/core/icudtl.dat Source99: revendor_source.sh Patch0: deno-69.patch Patch1: ff-serde.patch @@ -64,6 +66,8 @@ updated with the --reload flag. %autosetup -a1 -p1 %define cargo_registry $(pwd)/vendor %{cargo_prep} +# refresh icu data file +cp %{SOURCE2} ./core %build export V8_FROM_SOURCE=1 diff --git a/icudtl.dat b/icudtl.dat new file mode 100644 index 0000000..d0b70b0 --- /dev/null +++ b/icudtl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61e97c20d3f01ed4e18ad2b38b66c0b8122b31f9fb8cd71bddcdb1d22f164193 +size 10144432