Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget openjdk-8-jre openjdk-8-jdk
sudo apt-get install -y apt-utils sudo lsb-core git python ninja-build nodejs npm wget openjdk-8-jre openjdk-8-jdk

- name: Export settings from npm package
run: npm run export_npm_env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- name: Setup V8 build environment
run: |
brew install coreutils
brew install ninja
scripts/setup.sh -r ${V8_VERSION} ios

- name: Patch V8
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/tools_macos_android.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"setup_ios": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/setup.sh ios'",
"setup_macos_android": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/setup.sh macos_android'",
"start": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/start.sh android'",
"start_ios": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/start.sh ios'",
"start_tools_macos_android": "bash -c '. ./scripts/export_npm_env.sh && TOOLS_ONLY=true ./scripts/start.sh macos_android'"
"start_ios": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/start.sh ios'"
},
"config": {
"V8": "10.3.22"
Expand Down
36 changes: 0 additions & 36 deletions patches/mkcodecache.patch

This file was deleted.

13 changes: 0 additions & 13 deletions patches/v8_monolith_snapshot.patch

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
source $(dirname $0)/env.sh

function makeDistPackageDir() {
if [[ ${TOOLS_ONLY} = "true" ]]; then
echo "${DIST_DIR}/packages/v8-android-tools"
return 0
fi

local jit_suffix=""
local intl_suffix=""
if [[ ${NO_JIT} != "true" ]]; then
Expand Down Expand Up @@ -58,25 +53,6 @@ function copyHeaders() {
cp -Rf "${V8_DIR}/include" "${DIST_PACKAGE_DIR}/include"
}

function copyTools() {
printf "\n\n\t\t===================== adding tools to ${DIST_PACKAGE_DIR}/tools =====================\n\n"
cp -Rf "${BUILD_DIR}/tools" "${DIST_PACKAGE_DIR}/"
}

function copySnapshotBlobIfNeeded() {
if [[ ${EXTERNAL_STARTUP_DATA} = "true" || ${TOOLS_ONLY} = "true" ]]; then
printf "\n\n\t\t===================== adding snapshot_blob to ${DIST_PACKAGE_DIR}/snapshot_blob =====================\n\n"
cp -Rf "${BUILD_DIR}/snapshot_blob" "${DIST_PACKAGE_DIR}/"
fi
}


if [[ ${TOOLS_ONLY} = "true" ]]; then
mkdir -p "$DIST_PACKAGE_DIR"
copyTools
exit 0
fi

if [[ ${PLATFORM} = "android" ]]; then
# export ANDROID_HOME="${V8_DIR}/third_party/android_sdk/public"
# export ANDROID_NDK="${V8_DIR}/third_party/android_ndk"
Expand All @@ -87,11 +63,7 @@ if [[ ${PLATFORM} = "android" ]]; then
copyDylib
# copyAndroidTools
# copyHeaders
# copyTools
copySnapshotBlobIfNeeded
elif [[ ${PLATFORM} = "ios" ]]; then
copyDylib
# copyHeaders
# copyTools
# copySnapshotBlobIfNeeded
fi
58 changes: 4 additions & 54 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ GN_ARGS_BASE="
v8_enable_v8_checks=false
v8_enable_debugging_features=false
v8_enable_webassembly=true
v8_use_external_startup_data=false
is_official_build=true
target_os=\"${PLATFORM}\"
"

if [[ ${PLATFORM} = "macos_android" ]]; then
GN_ARGS_BASE="${GN_ARGS_BASE} target_os=\"android\" host_cpu=\"x64\""
else
GN_ARGS_BASE="${GN_ARGS_BASE} target_os=\"${PLATFORM}\""
fi

if [[ ${PLATFORM} = "ios" ]]; then
GN_ARGS_BASE="${GN_ARGS_BASE} enable_ios_bitcode=false use_xcode_clang=true ios_enable_code_signing=false v8_enable_pointer_compression=false ios_deployment_target=\"${IOS_DEPLOYMENT_TARGET}\""
elif [[ ${PLATFORM} = "android" ]]; then
Expand All @@ -42,12 +38,6 @@ if [[ ${NO_JIT} = "true" ]]; then
GN_ARGS_BASE="${GN_ARGS_BASE} v8_enable_lite_mode=true"
fi

if [[ ${EXTERNAL_STARTUP_DATA} = "true" || ${TOOLS_ONLY} = "true" ]]; then
GN_ARGS_BASE="${GN_ARGS_BASE} v8_use_external_startup_data=true"
else
GN_ARGS_BASE="${GN_ARGS_BASE} v8_use_external_startup_data=false"
fi

if [[ "$BUILD_TYPE" = "Debug" ]]
then
GN_ARGS_BUILD_TYPE='
Expand Down Expand Up @@ -105,16 +95,8 @@ function buildArch()
echo "Build v8 ${arch} variant NO_INTL=${NO_INTL} NO_JIT=${NO_JIT}"
gn gen --args="${GN_ARGS_BASE} ${GN_ARGS_BUILD_TYPE} v8_target_cpu=\"${arch}\" target_cpu=\"${arch}\"" "out.v8.${arch}"

if [[ ${TOOLS_ONLY} = "true" ]]; then
date ; ninja ${NINJA_PARAMS} -C "out.v8.${arch}" run_mksnapshot_default mkcodecache_group ; date
copySnapshot $arch
copyMkcodecache $arch
else
date ; ninja ${NINJA_PARAMS} -C "out.v8.${arch}" ; date
copyLib $arch
copySnapshot $arch
# copyMkcodecache $arch
fi
date ; ninja ${NINJA_PARAMS} -C "out.v8.${arch}" ; date
copyLib $arch
}

function copyLib()
Expand All @@ -131,33 +113,6 @@ function copyLib()
fi
}

function copySnapshot()
{
local arch=$1
local platform_arch=$(normalize_arch_for_platform $arch)

mkdir -p "${BUILD_DIR}/tools/${PLATFORM}/${platform_arch}"
cp -f out.v8.${arch}/clang_*/mksnapshot "${BUILD_DIR}/tools/${PLATFORM}/${platform_arch}/mksnapshot"

if [[ ${EXTERNAL_STARTUP_DATA} = "true" || ${TOOLS_ONLY} = "true" ]]; then
mkdir -p "${BUILD_DIR}/snapshot_blob/${platform_arch}"
cp -f out.v8.${arch}/snapshot_blob.bin "${BUILD_DIR}/snapshot_blob/${platform_arch}/snapshot_blob.bin"
fi
}

function copyMkcodecache()
{
local arch=$1
local platform_arch=$(normalize_arch_for_platform $arch)

mkdir -p "${BUILD_DIR}/tools/${PLATFORM}/${platform_arch}"
cp -f out.v8.${arch}/clang_*/mkcodecache "${BUILD_DIR}/tools/${PLATFORM}/${platform_arch}/mkcodecache"

if [[ ${EXTERNAL_STARTUP_DATA} = "true" || ${TOOLS_ONLY} = "true" ]]; then
cp -f out.v8.${arch}/clang_*/snapshot_blob.bin "${BUILD_DIR}/tools/${PLATFORM}/${platform_arch}/snapshot_blob.bin"
fi
}

if [[ ${ARCH} ]]; then
buildArch "${ARCH}"
elif [[ ${PLATFORM} = "android" ]]; then
Expand All @@ -168,9 +123,4 @@ elif [[ ${PLATFORM} = "android" ]]; then
elif [[ ${PLATFORM} = "ios" ]]; then
buildArch "arm64"
# buildArch "x64"
elif [[ ${PLATFORM} = "macos_android" ]]; then
# buildArch "arm"
# buildArch "x86"
buildArch "arm64"
buildArch "x64"
fi
3 changes: 1 addition & 2 deletions scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function abs_path()
function verify_platform()
{
local arg=$1
SUPPORTED_PLATFORMS=(android ios macos_android)
SUPPORTED_PLATFORMS=(android ios)
local valid_platform=
for platform in ${SUPPORTED_PLATFORMS[@]}
do
Expand All @@ -44,7 +44,6 @@ PATCHES_DIR="${ROOT_DIR}/patches"

NDK_VERSION="r21e"
IOS_DEPLOYMENT_TARGET="9"
EXTERNAL_STARTUP_DATA="true"

export PATH="$DEPOT_TOOLS_DIR:$PATH"
PLATFORM=$(verify_platform $1)
3 changes: 3 additions & 0 deletions scripts/export_npm_env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash -e

npm_package_config_V8=${npm_package_config_V8:-$(node -p 'require("./package.json").config.V8')}

if [[ ${CIRCLECI} ]]; then
echo "export VERSION=${npm_package_version}" >> $BASH_ENV
echo "export V8_VERSION=${npm_package_config_V8}" >> $BASH_ENV
Expand Down
29 changes: 0 additions & 29 deletions scripts/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ source $(dirname $0)/env.sh
# Patchset management that manage files by commented purpose
######################################################################################
V8_PATCHSET_ANDROID=(
"v8_monolith_snapshot.patch"

# V8 shared library support
# "v8_shared_library.patch"

Expand All @@ -24,9 +22,6 @@ V8_PATCHSET_ANDROID=(
# revert https://chromium.googlesource.com/chromium/src/build/+/7bb5f36104
"v8_97_android_unwind_link_error.patch"

# Add mkcodecache tool
"mkcodecache.patch"

# Fix for [react-native-bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) not working
# revert https://chromium-review.googlesource.com/c/v8/v8/+/3548458
# "fix_for_bottom_sheet.patch"
Expand All @@ -45,19 +40,11 @@ V8_PATCHSET_IOS=(
# Fix use_system_xcode build error
"system_xcode_build_error.patch"

# Add mkcodecache tool
"mkcodecache.patch"

# Fix for [react-native-bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) not working
# revert https://chromium-review.googlesource.com/c/v8/v8/+/3548458
# "fix_for_bottom_sheet.patch"
)

V8_PATCHSET_MACOS_ANDROID=(
# Add mkcodecache tool
"mkcodecache.patch"
)

######################################################################################
# Patchset management end
######################################################################################
Expand All @@ -73,11 +60,6 @@ function setupNDK() {
unset ndk_major_version
}

function setupMkCodecache() {
mkdir -p "${V8_DIR}/src/mkcodecache"
cp -f "${ROOT_DIR}/mkcodecache/mkcodecache.cc" "${V8_DIR}/src/mkcodecache/"
}

if [[ ${PLATFORM} = "android" ]]; then
for patch in "${V8_PATCHSET_ANDROID[@]}"
do
Expand All @@ -86,22 +68,11 @@ if [[ ${PLATFORM} = "android" ]]; then
done

setupNDK
setupMkCodecache
elif [[ ${PLATFORM} = "ios" ]]; then
for patch in "${V8_PATCHSET_IOS[@]}"
do
printf "### Patch set: ${patch}\n"
patch -d "${V8_DIR}" -p1 < "${PATCHES_DIR}/$patch"
done

setupMkCodecache
elif [[ ${PLATFORM} = "macos_android" ]]; then
for patch in "${V8_PATCHSET_MACOS_ANDROID[@]}"
do
printf "### Patch set: ${patch}\n"
patch -d "${V8_DIR}" -p1 < "${PATCHES_DIR}/$patch"
done

setupNDK
setupMkCodecache
fi
Loading