Merge pull request #1236 from lightpanda-io/v8-build-with-zig-gclient-ci

V8 build with zig gclient ci
This commit is contained in:
Pierre Tachoire
2025-12-09 08:10:04 +01:00
committed by Karl Seguin
parent 94ca2c41e4
commit 22303d2ae8
10 changed files with 111 additions and 161 deletions

View File

@@ -2,10 +2,6 @@ name: "Browsercore install"
description: "Install deps for the project browsercore"
inputs:
zig:
description: 'Zig version to install'
required: false
default: '0.15.2'
arch:
description: 'CPU arch used to select the v8 lib'
required: false
@@ -26,10 +22,6 @@ inputs:
description: 'cache dir to use'
required: false
default: '~/.cache'
mode:
description: 'debug or release'
required: false
default: 'debug'
runs:
using: "composite"
@@ -42,9 +34,8 @@ runs:
sudo apt-get update
sudo apt-get install -y wget xz-utils python3 ca-certificates git pkg-config libglib2.0-dev gperf libexpat1-dev cmake clang
- uses: mlugg/setup-zig@v2.0.5
with:
version: ${{ inputs.zig }}
# Zig version used from the `minimum_zig_version` field in build.zig.zon
- uses: mlugg/setup-zig@v2
- name: Cache v8
id: cache-v8
@@ -62,26 +53,34 @@ runs:
wget -O ${{ inputs.cache-dir }}/v8/libc_v8.a https://github.com/lightpanda-io/zig-v8-fork/releases/download/${{ inputs.zig-v8 }}/libc_v8_${{ inputs.v8 }}_${{ inputs.os }}_${{ inputs.arch }}.a
- name: install v8 release
if: ${{ inputs.mode == 'release' }}
- name: install v8
shell: bash
run: |
mkdir -p v8/out/${{ inputs.os }}/release/obj/zig/
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/${{ inputs.os }}/release/obj/zig/libc_v8.a
mkdir -p v8
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/libc_v8.a
- name: install v8 debug
if: ${{ inputs.mode == 'debug' }}
shell: bash
run: |
mkdir -p v8/out/${{ inputs.os }}/debug/obj/zig/
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/${{ inputs.os }}/debug/obj/zig/libc_v8.a
- name: Cache libiconv
id: cache-libiconv
uses: actions/cache@v4
env:
cache-name: cache-libiconv
with:
path: ${{ inputs.cache-dir }}/libiconv
key: vendor/libiconv/libiconv-1.17
- name: hmtl5ever release
if: ${{ inputs.mode == 'release' }}
- name: download libiconv
if: ${{ steps.cache-libiconv.outputs.cache-hit != 'true' }}
shell: bash
run: zig build -Doptimize=ReleaseFast html5ever
run: make download-libiconv
- name: hmtl5ever debug
if: ${{ inputs.mode == 'debug' }}
- name: build libiconv
shell: bash
run: zig build html5ever
run: make build-libiconv
- name: build mimalloc
shell: bash
run: make install-mimalloc
- name: build netsurf
shell: bash
run: make install-netsurf

View File

@@ -39,7 +39,7 @@ jobs:
mode: 'release'
- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseSafe -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -78,7 +78,7 @@ jobs:
mode: 'release'
- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=generic -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseSafe -Dcpu=generic -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -119,7 +119,7 @@ jobs:
mode: 'release'
- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -163,7 +163,7 @@ jobs:
mode: 'release'
- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

View File

@@ -60,7 +60,7 @@ jobs:
mode: 'release'
- name: zig build release
run: zig build -Doptimize=ReleaseFast -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a -Doptimize=ReleaseFast -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
- name: upload artifact
uses: actions/upload-artifact@v4

View File

@@ -56,7 +56,7 @@ jobs:
- uses: ./.github/actions/install
- name: zig build debug
run: zig build
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a
- name: upload artifact
uses: actions/upload-artifact@v4
@@ -104,7 +104,7 @@ jobs:
- uses: ./.github/actions/install
- name: zig build test
run: zig build test -- --json > bench.json
run: zig build -Dprebuilt_v8_path=v8/libc_v8.a test -- --json > bench.json
- name: write commit
run: |