Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.3-lkgr #44

Merged
merged 5 commits into from
Apr 8, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def build(scm, arch, mode) {
def expectedLibraries = ['monolith']
def labels = 'ninja && git && android-ndk && android-sdk && python'
if (arch.equals('ia32') || arch.equals('arm')) {
labels += ' && (linux || (osx && xcode-9))' // Need xcode-9 or older on mac, as 32-bit x86 was removed in xcode 10
labels += ' && (osx && xcode-9)' // Need xcode-9 or older on mac, as 32-bit x86 was removed in xcode 10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only build on osx nodes as we want a macOS compatible mksnapshot

} else {
// 64-bit can be built on xcode 10, so we can use linux or osx
labels += ' && (linux || osx)'
labels += ' && osx'
}

node(labels) {
Expand Down Expand Up @@ -41,18 +41,20 @@ def build(scm, arch, mode) {
// Force a git clean on everything under v8
sh '../depot_tools/gclient recurse git clean -fdx'
// Then apply our patch to avoid grabbing android sdk/ndk
sh 'git apply ../ndkr16b_7.1.patch'
sh 'git apply ../ndkr19c_7.3.patch'
sh 'git apply ../compat.patch'
sh 'git apply ../optimize.patch'
// Now let gclient get the dependencies.
sh '../depot_tools/gclient sync --shallow --no-history --reset --force' // needs python
}
} // withEnv

// clean, but be ok with non-zero exit code
sh returnStatus: true, script: "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -s ${env.ANDROID_SDK} -c"
sh returnStatus: true, script: "./build_v8.sh -n ${env.ANDROID_NDK_R19C} -s ${env.ANDROID_SDK} -c"
// Now manually clean since that usually fails trying to clean non-existant tags dir
sh 'rm -rf build/' // wipe any previously built libraries
// Now build
sh "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -s ${env.ANDROID_SDK} -j8 -l ${arch} -m ${mode}"
sh "./build_v8.sh -n ${env.ANDROID_NDK_R19C} -s ${env.ANDROID_SDK} -j8 -l ${arch} -m ${mode}"
// Now run a sanity check to make sure we built the static libraries we expect
// We want to fail the build overall if we didn't
for (int l = 0; l < expectedLibraries.size(); l++) {
Expand Down
18 changes: 16 additions & 2 deletions build_mac_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,36 @@ else
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
fi

rm -rf build/

export PATH=`pwd`/depot_tools:"$PATH"
cd v8
git checkout -- . # "clean" the v8 directory
rm -rf out.gn/
git apply ../ndkr16b_6.7.patch
echo "Asking gclient to clean v8 dependencies"
../depot_tools/gclient recurse git clean -fdx
echo "Applying patches"
git apply ../ndkr19c_7.3.patch
git apply ../compat.patch
git apply ../optimize.patch
echo "Asking gclient to update v8 dependencies"
gclient sync --shallow --no-history
../depot_tools/gclient sync --shallow --no-history --reset --force
cd ..
# wget http://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip
# unzip android-ndk-r16b-darwin-x86_64.zip
# export ANDROID_NDK=${PWD}/android-ndk-r16b

echo "Cleaning v8 build"
./build_v8.sh -c
# Now manually clean since that usually fails trying to clean non-existant tags dir
rm -rf build/

echo "Building v8 for x86..."
./build_v8.sh "-j" "8" "-l" "ia32" "-m" "release"
echo "Building v8 for ARM..."
./build_v8.sh "-j" "8" "-l" "arm" "-m" "release"
echo "Building v8 for ARM-64..."
./build_v8.sh "-j" "8" "-l" "arm64" "-m" "release"

echo "Packaging built v8 into tarball..."
./build_v8.sh "-t" "-m" "release"
25 changes: 22 additions & 3 deletions build_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,34 @@ buildV8()

# Build V8
MAKE_TARGET="android_$BUILD_LIB_VERSION.$BUILD_MODE"
tools/dev/v8gen.py gen --no-goma -b "$BUILDER_NAME" -m $BUILDER_GROUP $MAKE_TARGET -- use_goma=false v8_use_snapshot=false v8_static_library=true v8_enable_i18n_support=false icu_use_data_file=false android_sdk_root=\"$SDK_DIR\" android_ndk_root=\"$NDK_DIR\" android_ndk_major_version=16 android_ndk_version=\"r16b\" v8_monolithic=true target_os=\"android\" v8_android_log_stdout=true
tools/dev/v8gen.py gen --no-goma -b "$BUILDER_NAME" -m $BUILDER_GROUP $MAKE_TARGET -- use_goma=false v8_use_snapshot=true v8_enable_embedded_builtins=false v8_use_external_startup_data=false v8_static_library=true v8_enable_i18n_support=false android_sdk_root=\"$SDK_DIR\" android_ndk_root=\"$NDK_DIR\" android_ndk_major_version=19 android_ndk_version=\"r19c\" v8_monolithic=true target_os=\"android\" use_custom_libcxx=false v8_android_log_stdout=false
# Hack one of the toolchain items to fix AR executable used for android
cp ../overrides/build/toolchain/android/BUILD.gn "$V8_DIR/build/toolchain/android/BUILD.gn"
ninja -C out.gn/$MAKE_TARGET -j $NUM_CPUS v8_monolith
cp -f ../overrides/build/toolchain/android/BUILD.gn "$V8_DIR/build/toolchain/android/BUILD.gn"
cp -f ../overrides/build/config/android/BUILD.gn "$V8_DIR/build/config/android/BUILD.gn"
cp -f ../overrides/build/config/compiler/BUILD.gn "$V8_DIR/build/config/compiler/BUILD.gn"
ninja -v -C out.gn/$MAKE_TARGET -j $NUM_CPUS v8_monolith

# Copy the static libraries to our staging area.
DEST_DIR="$BUILD_DIR/$BUILD_MODE"
mkdir -p "$DEST_DIR/libs/$ARCH" 2>/dev/null || echo
cp "$V8_DIR/out.gn/$MAKE_TARGET/obj/libv8_monolith.a" "$DEST_DIR/libs/$ARCH/libv8_monolith.a"

MKSNAPSHOT_X86="$V8_DIR/out.gn/$MAKE_TARGET/clang_x86/mksnapshot"
if [ -f $MKSNAPSHOT_X86 ]; then
cp $MKSNAPSHOT_X86 "$DEST_DIR/libs/$ARCH/mksnapshot"
fi
MKSNAPSHOT_X64="$V8_DIR/out.gn/$MAKE_TARGET/clang_x64/mksnapshot"
if [ -f $MKSNAPSHOT_X64 ]; then
cp $MKSNAPSHOT_X64 "$DEST_DIR/libs/$ARCH/mksnapshot"
fi
MKSNAPSHOT_ARM="$V8_DIR/out.gn/$MAKE_TARGET/clang_x86_v8_arm/mksnapshot"
if [ -f $MKSNAPSHOT_ARM ]; then
cp $MKSNAPSHOT_ARM "$DEST_DIR/libs/$ARCH/mksnapshot"
fi
MKSNAPSHOT_ARM64="$V8_DIR/out.gn/$MAKE_TARGET/clang_x64_v8_arm64/mksnapshot"
if [ -f $MKSNAPSHOT_ARM64 ]; then
cp $MKSNAPSHOT_ARM64 "$DEST_DIR/libs/$ARCH/mksnapshot"
fi
}

buildThirdparty()
Expand Down