-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade V8 binaries for 13.1.201.19 version
- Use the v8 compilation pipeline from https://github.com/kuoruan/libv8 - Fix issues with v8go compatibility and changes in the V8 api
- Loading branch information
1 parent
cee5f84
commit e58a792
Showing
112 changed files
with
6,845 additions
and
2,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/go:1-1.22-bookworm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "Go", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"dockerFile": "Dockerfile", | ||
// "image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
"settings": {}, | ||
"extensions": [ | ||
] | ||
} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [9000], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "go version", | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root", | ||
"runArgs": ["--platform=linux/amd64" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build for Linux | ||
description: 'Build V8 for Linux' | ||
|
||
inputs: | ||
target-arch: | ||
description: 'Target Architecture' | ||
default: x64 | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Restore CCache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .ccache | ||
key: ${{ runner.os }}-${{ runner.arch }}:libv8:ccache:${{ github.run_number }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ runner.arch }}:libv8:ccache: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' # https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/README.md | ||
|
||
- name: Setup Build Tools | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq ccache | ||
sudo update-ccache-symlinks | ||
echo "/usr/lib/ccache" >> "$GITHUB_PATH" | ||
ccacheDir="${GITHUB_WORKSPACE}/.ccache" | ||
test -d "$ccacheDir" || mkdir "$ccacheDir" | ||
echo "CCACHE_DIR=$ccacheDir" >> "$GITHUB_ENV" | ||
- name: Download V8 Source | ||
shell: bash | ||
working-directory: ./deps | ||
run: ./v8_download.sh | ||
|
||
- name: Prepare for arm64 cross compile | ||
shell: bash | ||
if: ${{ inputs.target-arch == 'arm64' }} | ||
working-directory: ./deps/v8 | ||
run: | | ||
sudo apt-get install -yq g++-aarch64-linux-gnu | ||
build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 | ||
- name: Compile V8 | ||
shell: bash | ||
working-directory: ./deps | ||
run: ./v8_compile.sh ${{ inputs.target-arch }} | ||
|
||
- name: Show CCache Status | ||
shell: bash | ||
working-directory: ./deps | ||
run: ccache -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build for macOS | ||
description: 'Build V8 for macOS' | ||
|
||
inputs: | ||
target-arch: | ||
description: 'Target Architecture' | ||
default: x64 | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Restore CCache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .ccache | ||
key: ${{ runner.os }}-${{ runner.arch }}:libv8:ccache:${{ github.run_number }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ runner.arch }}:libv8:ccache: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' # https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/README.md | ||
|
||
- name: Setup Build Tools | ||
shell: bash | ||
run: | | ||
brew install ccache | ||
echo "$(brew --prefix ccache)/libexec" >> "$GITHUB_PATH" | ||
echo "CCACHE_CPP2=yes" >> "$GITHUB_ENV" | ||
echo "CCACHE_SLOPPINESS=time_macros" >> "$GITHUB_ENV" | ||
ccacheDir="${GITHUB_WORKSPACE}/.ccache" | ||
test -d "$ccacheDir" || mkdir "$ccacheDir" | ||
echo "CCACHE_DIR=$ccacheDir" >> "$GITHUB_ENV" | ||
- name: Download V8 Source | ||
shell: bash | ||
working-directory: ./deps | ||
run: ./v8_download.sh | ||
|
||
- name: Compile V8 | ||
shell: bash | ||
working-directory: ./deps | ||
run: ./v8_compile.sh ${{ inputs.target-arch }} | ||
|
||
- name: Show CCache Status | ||
shell: bash | ||
working-directory: ./deps | ||
run: ccache -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
name: V8 Upgrade | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 3 * * *' # Run every day | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
upgrade: | ||
name: Upgrade V8 | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
v8_version: ${{ steps.check_version.outputs.NEW_V8_VERSION }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Run upgrade script | ||
id: check_version | ||
working-directory: ./deps | ||
run: ./v8_upgrade.sh | ||
|
||
build: | ||
name: Build V8 for ${{ matrix.platform }} ${{ matrix.arch }} | ||
runs-on: ${{ matrix.platform }} | ||
needs: upgrade | ||
if: needs.upgrade.outputs.v8_version != '0' | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: [ubuntu-22.04, macos-latest] | ||
arch: [x64, arm64] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
clean: true | ||
fetch-depth: 1 | ||
|
||
- name: Update version file | ||
shell: bash | ||
run: echo -n "${{ needs.upgrade.outputs.v8_version }}" > deps/VERSION | ||
|
||
- name: Build Release for Linux | ||
if: startsWith(matrix.platform, 'ubuntu') | ||
uses: ./.github/actions/build-linux | ||
with: | ||
target-arch: ${{ matrix.arch }} | ||
|
||
- name: Build Release for macOS | ||
if: startsWith(matrix.platform, 'macos') | ||
uses: ./.github/actions/build-macos | ||
with: | ||
target-arch: ${{ matrix.arch }} | ||
|
||
- name: Set v8 build name | ||
working-directory: ./deps | ||
shell: bash | ||
run: | | ||
target_arch="$1" | ||
os=$(echo "$(uname -s)" | tr '[:upper:]' '[:lower:]') | ||
archive_name="v8_${os}_${{ matrix.arch }}" | ||
echo "Using Archive Name: $archive_name" | ||
echo "ARCHIVE_NAME=$archive_name" >> "$GITHUB_ENV" | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.ARCHIVE_NAME }} | ||
path: deps/v8/out/release/obj/libv8_monolith.a | ||
retention-days: 1 | ||
|
||
release: | ||
name: Release V8 | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- upgrade | ||
- build | ||
if: needs.upgrade.outputs.v8_version != '0' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
clean: true | ||
fetch-depth: 1 | ||
|
||
- name: Download Archives | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifact | ||
|
||
- name: Display Downloads | ||
run: ls -lhR artifact | ||
|
||
- name: Copy artifacts to correct folders | ||
shell: bash | ||
run: | | ||
rm deps/darwin_x86_64/libv8.a | ||
rm deps/darwin_arm64/libv8.a | ||
rm deps/linux_x86_64/libv8.a | ||
rm deps/linux_arm64/libv8.a | ||
cp artifact/v8_darwin_x64/libv8_monolith.a deps/darwin_x86_64/libv8.a | ||
cp artifact/v8_darwin_arm64/libv8_monolith.a deps/darwin_arm64/libv8.a | ||
cp artifact/v8_linux_x64/libv8_monolith.a deps/linux_x86_64/libv8.a | ||
cp artifact/v8_linux_arm64/libv8_monolith.a deps/linux_arm64/libv8.a | ||
rm -rf artifact | ||
- name: Update version file | ||
shell: bash | ||
run: echo -n "${{ needs.upgrade.outputs.v8_version }}" > deps/VERSION | ||
|
||
- name: Download V8 Source | ||
shell: bash | ||
working-directory: ./deps | ||
run: ./v8_download.sh | ||
|
||
- name: Ensure includes and files are up to date | ||
shell: bash | ||
run: ./deps/v8_upgrade.py ${{ needs.upgrade.outputs.v8_version }} | ||
|
||
- name: Create PR | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
commit-message: "Upgrade V8 binaries for ${{ needs.upgrade.outputs.v8_version }} version" | ||
branch: "v8_${{ needs.upgrade.outputs.v8_version }}_upgrade" | ||
delete-branch: true | ||
title: "Upgrade V8 binaries for ${{ needs.upgrade.outputs.v8_version }} version" | ||
body: "Auto-generated pull request to upgrade V8 binary for ${{ needs.upgrade.outputs.v8_version }} version" |
Oops, something went wrong.