Skip to content

fix(android): patch for 9.4 #70

fix(android): patch for 9.4

fix(android): patch for 9.4 #70

Workflow file for this run

name: Build
on: [ push, pull_request, workflow_dispatch]
jobs:
build:
strategy:
matrix:
# TODO: make mode matrix of ['release', 'debug']?
arch: ['arm', 'arm64', 'ia32', 'x64']
runs-on: ubuntu-20.04
name: ${{ matrix.arch }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: nttld/setup-ndk@v1
with:
ndk-version: r16b
- run: wget https://github.com/chromium/chromium/raw/master/build/install-build-deps.sh
- run: sudo bash ./install-build-deps.sh --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt
name: Install V8 Build Dependencies
continue-on-error: true
- run: sudo apt-get -y install python2 lib32z1 lighttpd xvfb x11-utils libatomic1:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 ccache ninja-build
name: Install additional build tools
- run: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
name: set python2 as primary
- run: git apply ../DEPS.patch
name: Apply DEPS patch
working-directory: ./v8
- run: git apply ../DEPS_2.patch
name: Apply DEPS patch
working-directory: ./v8
# Apply compatibility patches
# NOTE: These also need to be applied in the package step
- run: git apply ../compat.patch
name: Apply compat patch
working-directory: ./v8
- run: git apply ../compat_jsargs.patch
name: Apply patch for breaking reverse jsargs change
working-directory: ./v8
- run: git apply ../compat_adaptor.patch
name: Apply patch for breaking adaptor change
working-directory: ./v8
- run: git apply ../compat_sparkplug.patch
name: Apply patch for breaking sparkplug change
working-directory: ./v8
- run: git apply ../version.patch
name: Adjust V8 version
working-directory: ./v8
- name: Checkout depot_tools repo
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && cd depot_tools && git -c advice.detachedHead=false checkout b0a190348a740cb063eb98ba6eb9d18ccd573ae7
- name: Add depot_tools to PATH!
run: echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
- name: Link Android NDK
run: ln -s /usr/local/lib/android/sdk/ndk-bundle v8/third_party/android_ndk && chmod 777 v8/third_party/android_ndk
- run: ../depot_tools/gclient sync --shallow --no-history --reset --force
name: Install GClient Dependencies
working-directory: ./v8
- name: Retrieve ccache
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.arch }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.arch }}-
${{ runner.os }}-ccache-
- run: ./build_v8.sh -n /usr/local/lib/android/sdk/ndk-bundle -s /usr/local/lib/android/sdk -l ${{ matrix.arch }} -m release -x v8_monolith
name: Build
- name: Show summary of ccache configuration and statistics counters
run: ccache --show-stats
- name: Archive Build
uses: actions/upload-artifact@v2
with:
name: libv8-release-${{ matrix.arch }}
path: |
build/release/**
# Combine the various architecture builds with the headers and a custom libv8.json file
package:
runs-on: ubuntu-latest
name: Package
needs: build
steps:
- uses: actions/checkout@v3
with:
submodules: true
# Apply compatibility patches, so 'include' headers are correct
- run: git apply ../compat.patch
name: Apply compat patch
working-directory: ./v8
- run: git apply ../compat_jsargs.patch
name: Apply patch for breaking reverse jsargs change
working-directory: ./v8
- run: git apply ../compat_adaptor.patch
name: Apply patch for breaking adaptor change
working-directory: ./v8
- run: git apply ../compat_sparkplug.patch
name: Apply patch for breaking sparkplug change
working-directory: ./v8
- run: git apply ../version.patch
name: Adjust V8 version
working-directory: ./v8
- run: mkdir -p 'build/release/libs' 'build/release/include' 2>/dev/null
- run: cp -R 'v8/include' 'build/release'
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- name: Create libv8.json
run: |
gitRevision=$(git ls-tree HEAD -- v8 | cut -c15-54)
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
MAJOR=$(grep "#define V8_MAJOR_VERSION" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
MINOR=$(grep "#define V8_MINOR_VERSION" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
BUILD=$(grep "#define V8_BUILD_NUMBER" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
PATCH=$(grep "#define V8_PATCH_LEVEL" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
v8Version="$MAJOR.$MINOR.$BUILD.$PATCH"
echo "v8Version=$v8Version" >> $GITHUB_ENV
echo "{
\"version\": \"$v8Version\",
\"git_revision\": \"$gitRevision\",
\"git_branch\": \"${{ env.BRANCH_NAME }}\",
\"svn_revision\": \"\",
\"timestamp\": \"$timestamp\"
}" >> build/release/libv8.json
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: List files
run: ls -la
- name: Move built libraries to final folder
run: |
mv libv8-release-arm/libs/arm build/release/libs/arm
mv libv8-release-arm64/libs/arm64 build/release/libs/arm64
mv libv8-release-ia32/libs/x86 build/release/libs/x86
mv libv8-release-x64/libs/x86_64 build/release/libs/x86_64
- name: Building libv8-${{ env.v8Version }}-release.tar.bz2...
run: tar -cvj -f libv8-${{ env.v8Version }}-release.tar.bz2 libv8.json libs include
working-directory: ./build/release
- name: Archive Build
uses: actions/upload-artifact@v2
with:
name: libv8-${{ env.v8Version }}-release
path: |
build/release/libv8-*-release.tar.bz2
- uses: geekyeggo/delete-artifact@v1
with:
name: |
libv8-release-arm
libv8-release-arm64
libv8-release-ia32
libv8-release-x64