Skip to content

Commit

Permalink
πŸ‘¨β€πŸ”¬ Javet v3.0.3 (#296)
Browse files Browse the repository at this point in the history
* Upgraded V8 to `v12.1.285.26` (2024-01-17)
* Upgraded Node.js to `v20.11.0` ([2024-01-09](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.11.0))
* Restore the reference lock
* Downgraded to Ubuntu 20.04 for better compatibility
* Fixed a slight memory leak in closing the V8 runtime
* Fixed a memory leak in dynamic proxy and dynamic object
* Applied a temporary [patch](#290) to V8 to avoid crashes on few Linux distributions in VM
* Added `kNoStdioInitialization` and `kNoDefaultSignalHandling` to Node.js initialization
* Improved performance of `BaseJavetConsoleInterceptor`
* Added `JavetJVMInterceptor`
* Added `createSnapshot()` to `V8Runtime`
* Added `isCreateSnapshotEnabled()`, `setCreateSnapshotEnabled()`, `getSnapshotBlob()`, `setSnapshotBlob()` to `RuntimeOptions`
* Added `RuntimeCreateSnapshotDisabled`, `RuntimeCreateSnapshotBlocked` to `JavetError`
* Added `isProxyListEnabled()`, `setProxyListEnabled()` to `JavetConverterConfig`
* Added `ArrayUtils`, `CollectionUtils`
* Fixed `CDTShell`
  • Loading branch information
caoccao authored Jan 19, 2024
1 parent 28f9bb8 commit 53f0660
Show file tree
Hide file tree
Showing 890 changed files with 13,547 additions and 3,550 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.10.0
JAVET_V8_VERSION: 12.0.267.8
JAVET_VERSION: 3.0.2
JAVET_NODE_VERSION: 20.11.0
JAVET_V8_VERSION: 12.1.285.26
JAVET_VERSION: 3.0.3
ROOT: /home/runner/work/Javet

jobs:
Expand Down Expand Up @@ -61,6 +61,8 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py arm.release -- 'target_os="android"' 'target_cpu="arm"' 'v8_target_cpu="arm"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
sed -i 's/char\[\]/char/g' src/wasm/wasm-engine.cc
sed -i 's/source_url_ = String::cast(script->name())->ToCString();/std::unique_ptr<char[]> source_url = String::cast(script->name())->ToCString(); source_url_ = {source_url.release(), source_url.get_deleter()};/' src/wasm/wasm-engine.cc
ninja -C out.gn/arm.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/arm.release v8_monolith
Expand Down Expand Up @@ -133,6 +135,8 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py arm64.release -- 'target_os="android"' 'target_cpu="arm64"' 'v8_target_cpu="arm64"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
sed -i 's/char\[\]/char/g' src/wasm/wasm-engine.cc
sed -i 's/source_url_ = String::cast(script->name())->ToCString();/std::unique_ptr<char[]> source_url = String::cast(script->name())->ToCString(); source_url_ = {source_url.release(), source_url.get_deleter()};/' src/wasm/wasm-engine.cc
ninja -C out.gn/arm64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/arm64.release v8_monolith
Expand Down Expand Up @@ -205,6 +209,8 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py ia32.release -- 'target_os="android"' 'target_cpu="x86"' 'v8_target_cpu="x86"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
sed -i 's/char\[\]/char/g' src/wasm/wasm-engine.cc
sed -i 's/source_url_ = String::cast(script->name())->ToCString();/std::unique_ptr<char[]> source_url = String::cast(script->name())->ToCString(); source_url_ = {source_url.release(), source_url.get_deleter()};/' src/wasm/wasm-engine.cc
ninja -C out.gn/ia32.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/ia32.release v8_monolith
Expand Down Expand Up @@ -277,6 +283,8 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py x64.release -- 'target_os="android"' 'target_cpu="x64"' 'v8_target_cpu="x64"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
sed -i 's/char\[\]/char/g' src/wasm/wasm-engine.cc
sed -i 's/source_url_ = String::cast(script->name())->ToCString();/std::unique_ptr<char[]> source_url = String::cast(script->name())->ToCString(); source_url_ = {source_url.release(), source_url.get_deleter()};/' src/wasm/wasm-engine.cc
ninja -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/x64.release v8_monolith
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 20.10.0
JAVET_V8_VERSION: 12.0.267.8
JAVET_VERSION: 3.0.2
JAVET_NODE_VERSION: 20.11.0
JAVET_V8_VERSION: 12.1.285.26
JAVET_VERSION: 3.0.3

jobs:
javet_linux_x86_64:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 20.10.0
JAVET_V8_VERSION: 12.0.267.8
JAVET_VERSION: 3.0.2
JAVET_NODE_VERSION: 20.11.0
JAVET_V8_VERSION: 12.1.285.26
JAVET_VERSION: 3.0.3

# if we skip a job using a job level `if` condition, then any dependent jobs also don't run.
# we can skip a step of the job, using a step level `if` condition.
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/linux_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.10.0
JAVET_V8_VERSION: 12.0.267.8
JAVET_VERSION: 3.0.2
JAVET_NODE_VERSION: 20.11.0
JAVET_V8_VERSION: 12.1.285.26
JAVET_VERSION: 3.0.3
ROOT: /home/runner/work/Javet

jobs:
Expand Down Expand Up @@ -52,6 +52,8 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
sed -i '/#include "src\/libplatform\//a #include <cstdlib>' src/libplatform/default-thread-isolated-allocator.cc
sed -i '/bool KernelHasPkruFix()/a const char* env = std::getenv("JAVET_DISABLE_PKU"); if (env && std::strlen(env) > 0) { return false; }' src/libplatform/default-thread-isolated-allocator.cc
ninja -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/x64.release v8_monolith
Expand Down Expand Up @@ -168,12 +170,20 @@ jobs:
gradle build test --rerun-tasks --debug
touch src/main/resources/libjavet-node*
gradle test --rerun-tasks --debug
gradle build generatePomFileForGeneratePomPublication
- name: Clear up Source Jar
uses: edgarrc/action-7z@v1
with:
args: 7z d build/libs/javet-${{ env.JAVET_VERSION }}-sources.jar *.so

- name: Upload the Artifact
uses: actions/upload-artifact@v3
with:
name: javet-linux-x86_64-${{ env.JAVET_VERSION }}
path: build/libs/*.jar
path: |
build/libs/*.jar
build/libs/*.pom
- name: Delete Javet V8
uses: geekyeggo/delete-artifact@v2
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/macos_arm64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
JAVET_NODE_VERSION: 11.8.172.15
JAVET_V8_VERSION: 11.8.172.15
JAVET_VERSION: 3.0.2
JAVET_VERSION: 3.0.3
ROOT: /Users/runner/work/Javet

jobs:
Expand Down Expand Up @@ -163,12 +163,16 @@ jobs:
gradle build test --rerun-tasks --debug
touch src/main/resources/libjavet-node*
gradle test --rerun-tasks --debug
gradle build generatePomFileForGeneratePomPublication
zip -d build/libs/javet-${{ env.JAVET_VERSION }}-sources.jar *.dylib
- name: Upload the Artifact
uses: actions/upload-artifact@v3
with:
name: javet-macos-arm64-${{ env.JAVET_VERSION }}
path: build/libs/*.jar
path: |
build/libs/*.jar
build/libs/*.pom
- name: Delete Javet V8
uses: geekyeggo/delete-artifact@v2
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/macos_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.10.0
JAVET_V8_VERSION: 12.0.267.8
JAVET_VERSION: 3.0.2
JAVET_NODE_VERSION: 20.11.0
JAVET_V8_VERSION: 12.1.285.26
JAVET_VERSION: 3.0.3
ROOT: /Users/runner/work/Javet

jobs:
Expand Down Expand Up @@ -163,12 +163,16 @@ jobs:
gradle build test --rerun-tasks --debug
touch src/main/resources/libjavet-node*
gradle test --rerun-tasks --debug
gradle build generatePomFileForGeneratePomPublication
zip -d build/libs/javet-${{ env.JAVET_VERSION }}-sources.jar *.dylib
- name: Upload the Artifact
uses: actions/upload-artifact@v3
with:
name: javet-macos-x86_64-${{ env.JAVET_VERSION }}
path: build/libs/*.jar
path: |
build/libs/*.jar
build/libs/*.pom
- name: Delete Javet V8
uses: geekyeggo/delete-artifact@v2
Expand Down
27 changes: 14 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ arm βœ”οΈ ❌ ❌ ❌
arm64 βœ”οΈ βœ”οΈ βœ”οΈ ❌
=========== ======= ======= ======= =======

* Node.js ``v20.10.0`` + V8 ``v12.0.267.8``
* Node.js ``v20.11.0`` + V8 ``v12.1.285.26``
* Dynamic switch between Node.js and V8 mode (`Which mode do you prefer? <https://github.com/caoccao/Javet/discussions/92>`_)
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
* V8 API exposure in JVM
Expand All @@ -50,7 +50,8 @@ arm64 βœ”οΈ βœ”οΈ βœ”οΈ ❌
* Javet engine pool
* Easy spring integration
* Live debug with Chrome DevTools
* AST Analysis with `JavetSanitizer <https://github.com/caoccao/JavetSanitizer>`_
* AST analysis with `JavetSanitizer <https://github.com/caoccao/JavetSanitizer>`_
* Live interaction with `JavetShell <https://github.com/caoccao/JavetShell>`_

Quick Start
===========
Expand All @@ -67,42 +68,42 @@ Maven
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
</dependency>
<!-- Linux (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-linux-arm64</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

.. code-block:: kotlin
implementation("com.caoccao.javet:javet:3.0.2") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:3.0.2") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:3.0.2") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android:3.0.2") // Android (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet:3.0.3") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:3.0.3") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:3.0.3") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android:3.0.3") // Android (arm, arm64, x86 and x86_64)
Gradle Groovy DSL
^^^^^^^^^^^^^^^^^

.. code-block:: groovy
implementation 'com.caoccao.javet:javet:3.0.2' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:3.0.2' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:3.0.2' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:3.0.2' // Android (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet:3.0.3' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:3.0.3' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:3.0.3' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:3.0.3' // Android (arm, arm64, x86 and x86_64)
Hello Javet
-----------
Expand Down
5 changes: 3 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021. caoccao.com Sam Cao
* Copyright 2021-2023. caoccao.com Sam Cao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.0.0")
// https://developer.android.com/build/releases/gradle-plugin
classpath("com.android.tools.build:gradle:8.1.0")
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 21 08:49:28 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 53f0660

Please sign in to comment.