From 38d6e8438f2638c538e22ed9d736c622b87d8a9a Mon Sep 17 00:00:00 2001 From: Carson Katri Date: Thu, 13 Nov 2025 15:13:22 -0500 Subject: [PATCH 1/3] Add android build --- .github/workflows/build-release.yml | 291 +++++++++++++++------------- build-tools/build_v8.sh | 47 ++++- build-tools/get_v8.sh | 101 +++++++--- 3 files changed, 277 insertions(+), 162 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 4553d8b..d2513e4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,107 +15,169 @@ env: V8_REVISION: 14.0.365.4 jobs: - build-x86_64-linux: + # build-x86_64-linux: + # env: + # OS: linux + # ARCH: x86_64 + + # runs-on: ubuntu-22.04 + # steps: + # - uses: mlugg/setup-zig@v2 + # with: + # version: ${{ env.ZIG_VERSION }} + + # - uses: actions/checkout@v4 + # with: + # submodules: recursive + # fetch-depth: 0 + + # - run: | + # sudo apt-get update + # sudo apt-get install -yq libglib2.0-dev + + # - run: zig build get-v8 + # - run: zig build -Doptimize=ReleaseSafe build-v8 + # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # - name: Upload the build + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # build-aarch64-macos: + # env: + # OS: macos + # ARCH: aarch64 + + # runs-on: macos-latest + # steps: + # - uses: mlugg/setup-zig@v2 + # with: + # version: ${{ env.ZIG_VERSION }} + + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' + + # - uses: actions/checkout@v4 + # with: + # submodules: recursive + # fetch-depth: 0 + + # - run: zig build get-v8 + # - run: zig build -Doptimize=ReleaseSafe build-v8 + # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # - name: Upload the build + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # build-arm64-linux: + # env: + # OS: linux + # ARCH: aarch64 + + # runs-on: ubuntu-22.04-arm + # steps: + # - uses: mlugg/setup-zig@v2 + # with: + # version: ${{ env.ZIG_VERSION }} + + # - uses: actions/checkout@v4 + # with: + # submodules: recursive + # fetch-depth: 0 + + # - run: | + # sudo apt-get update + # sudo apt-get install -yq libglib2.0-dev lld + # wget https://apt.llvm.org/llvm.sh + # chmod +x llvm.sh + # sudo ./llvm.sh 21 + # sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins-aarch64.a /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins.a && \ + # sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/ /usr/lib/llvm-21/lib/clang/21/lib/aarch64-unknown-linux-gnu + + # - run: zig build get-v8 + # - run: zig build -Doptimize=ReleaseSafe build-v8 + # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # - name: Upload the build + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # build-x86_64-macos: + # env: + # OS: macos + # ARCH: x86_64 + + # runs-on: macos-15-large + # steps: + # - uses: mlugg/setup-zig@v2 + # with: + # version: ${{ env.ZIG_VERSION }} + + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' + + # - uses: actions/checkout@v4 + # with: + # submodules: recursive + # fetch-depth: 0 + + # - run: zig build get-v8 + # - run: zig build -Doptimize=ReleaseSafe build-v8 + # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # - name: Upload the build + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + # build-aarch64-ios: + # env: + # OS: ios + # ARCH: aarch64 + # TARGET_ENVIRONMENT: simulator + + # runs-on: macos-latest + # steps: + # - uses: mlugg/setup-zig@v2 + # with: + # version: ${{ env.ZIG_VERSION }} + + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' + + # - uses: actions/checkout@v4 + # with: + # submodules: recursive + # fetch-depth: 0 + + # - run: OS=macos zig build get-v8 # We force the OS to macos here b/c ios is not supported by get-v8 + # - run: zig build -Doptimize=ReleaseSafe build-v8 + # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a + + # - name: Upload the build + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a + + build-arm64-android: env: - OS: linux - ARCH: x86_64 + OS: android + ARCH: arm64 + HOST_ARCH: x64 runs-on: ubuntu-22.04 - steps: - - uses: mlugg/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - run: | - sudo apt-get update - sudo apt-get install -yq libglib2.0-dev - - - run: zig build get-v8 - - run: zig build -Doptimize=ReleaseSafe build-v8 - - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - - name: Upload the build - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - build-aarch64-macos: - env: - OS: macos - ARCH: aarch64 - - runs-on: macos-latest - steps: - - uses: mlugg/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - run: zig build get-v8 - - run: zig build -Doptimize=ReleaseSafe build-v8 - - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - - name: Upload the build - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - build-arm64-linux: - env: - OS: linux - ARCH: aarch64 - - runs-on: ubuntu-22.04-arm - steps: - - uses: mlugg/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - run: | - sudo apt-get update - sudo apt-get install -yq libglib2.0-dev lld - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 21 - sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins-aarch64.a /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins.a && \ - sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/ /usr/lib/llvm-21/lib/clang/21/lib/aarch64-unknown-linux-gnu - - - run: zig build get-v8 - - run: zig build -Doptimize=ReleaseSafe build-v8 - - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - - name: Upload the build - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - build-x86_64-macos: - env: - OS: macos - ARCH: x86_64 - - runs-on: macos-15-large steps: - uses: mlugg/setup-zig@v2 with: @@ -130,7 +192,7 @@ jobs: submodules: recursive fetch-depth: 0 - - run: zig build get-v8 + - run: OS=linux zig build get-v8 # We force the OS to linux here b/c android is not supported by get-v8 - run: zig build -Doptimize=ReleaseSafe build-v8 - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a @@ -139,34 +201,3 @@ jobs: with: allowUpdates: true artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - build-aarch64-ios: - env: - OS: ios - ARCH: aarch64 - TARGET_ENVIRONMENT: simulator - - runs-on: macos-latest - steps: - - uses: mlugg/setup-zig@v2 - with: - version: ${{ env.ZIG_VERSION }} - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - run: OS=macos zig build get-v8 # We force the OS to macos here b/c ios is not supported by get-v8 - - run: zig build -Doptimize=ReleaseSafe build-v8 - - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a - - - name: Upload the build - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a diff --git a/build-tools/build_v8.sh b/build-tools/build_v8.sh index b2f2bd1..fc4f44a 100644 --- a/build-tools/build_v8.sh +++ b/build-tools/build_v8.sh @@ -35,11 +35,56 @@ fi if [ "${OS}" = "ios" ]; then EXTRA_ARGS="v8_enable_pointer_compression=false v8_enable_webassembly=false target_environment=\"${TARGET_ENVIRONMENT}\"" fi +if [ "${OS}" = "android" ]; then + EXTRA_ARGS=' + clang_use_chrome_plugins = false + is_component_build = false + use_dummy_lastchange = true + use_sysroot = false + simple_template_names = false + symbol_level = 1 + use_debug_fission = false + v8_embedder_string = "-lightpanda" + v8_enable_sandbox = false + v8_enable_javascript_promise_hooks = true + v8_promise_internal_field_count = 1 + v8_use_external_startup_data = false + v8_imminent_deprecation_warnings = false + v8_enable_private_mapping_fork_optimization = true + v8_use_zlib = true + v8_enable_snapshot_compression = false + v8_enable_handle_zapping = false + v8_typed_array_max_size_in_heap = 0 + v8_array_buffer_internal_field_count = 2 + v8_array_buffer_view_internal_field_count = 2 + v8_enable_verify_heap = false + v8_enable_fuzztest = false + v8_enable_v8_checks = false + use_relative_vtables_abi = false + icu_use_data_file = false + v8_enable_temporal_support = false + use_llvm_libatomic = false + target_os = "android" + target_cpu = "arm64" + v8_target_cpu = "arm64" + is_debug = false + v8_enable_pointer_compression=false + v8_enable_webassembly=false + is_official_build=false + + v8_target_cpu="arm64" + v8_enable_pointer_compression=false + v8_enable_webassembly=false + ' +fi TARGET_ARCH=${ARCH} if [ "${ARCH}" = "amd64" ]; then TARGET_ARCH="x64" fi +if [ "${ARCH}" = "aarch64" ]; then + TARGET_ARCH="arm64" +fi tools/gn \ --root=src \ @@ -49,7 +94,7 @@ tools/gn \ --args=" target_os=\"${OS}\" target_cpu=\"${TARGET_ARCH}\" - host_cpu=\"${TARGET_ARCH}\" + host_cpu=\"${HOST_ARCH}\" is_debug=${IS_DEBUG} symbol_level=${SYMBOL_LEVEL} is_official_build=false ${EXTRA_ARGS} diff --git a/build-tools/get_v8.sh b/build-tools/get_v8.sh index cee571a..c9e4e53 100644 --- a/build-tools/get_v8.sh +++ b/build-tools/get_v8.sh @@ -28,35 +28,74 @@ cloneDep() { clone $dep_path $2 $dep_commit } -if [ -d "src" ]; then - warn "v8/src/ already exists, only cloning dependencies" +if [ "${TARGET_OS}" = "android" ]; then + say "setting up Android dependencies" + + # depot_tools are required to get GN/Ninja working with Android + if [ ! -d "depot_tools" ]; then + say "cloning depot_tools" + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools + fi + + export PATH=$(pwd)/depot_tools:$PATH + + # Add minimal .gclient for Android builds + cat > .gclient < deps.json - -cloneDep 'build' 'src/build' -cloneDep 'third_party/jinja2' 'src/third_party/jinja2' -cloneDep 'buildtools' 'src/buildtools' -cloneDep 'tools/clang' 'src/tools/clang' -cloneDep 'third_party/zlib' 'src/third_party/zlib' -cloneDep 'third_party/googletest/src' 'src/third_party/googletest/src' -cloneDep 'third_party/markupsafe' 'src/third_party/markupsafe' -cloneDep 'third_party/icu' 'src/third_party/icu' -cloneDep 'third_party/abseil-cpp' 'src/third_party/abseil-cpp' -cloneDep 'third_party/simdutf' 'src/third_party/simdutf' -cloneDep 'third_party/highway/src' 'src/third_party/highway/src/' -cloneDep 'third_party/libc++/src' 'src/third_party/libc++/src' -cloneDep 'third_party/libc++abi/src' 'src/third_party/libc++abi/src' -cloneDep 'third_party/llvm-libc/src' 'src/third_party/llvm-libc/src' -cloneDep 'third_party/fp16/src' 'src/third_party/fp16/src' -cloneDep 'third_party/fast_float/src' 'src/third_party/fast_float/src' -cloneDep 'third_party/dragonbox/src' 'src/third_party/dragonbox/src' - -# Add an empty gclient_args.gni so gn is happy. gclient also creates an empty file. -echo "# generated by get_v8.sh" > src/build/config/gclient_args.gni - -say "gettting prebuilt clang binary" -python3 src/tools/clang/scripts/update.py + if [ -d "src" ]; then + warn "v8/src/ already exists, only cloning dependencies" + else + say "cloning V8 into v8/src/" + git clone --depth=1 --branch ${REVISION} "https://chromium.googlesource.com/v8/v8.git" src + fi + + python3 deps_parse.py src/DEPS > deps.json + + cloneDep 'build' 'src/build' + cloneDep 'third_party/jinja2' 'src/third_party/jinja2' + cloneDep 'buildtools' 'src/buildtools' + cloneDep 'tools/clang' 'src/tools/clang' + cloneDep 'third_party/zlib' 'src/third_party/zlib' + cloneDep 'third_party/googletest/src' 'src/third_party/googletest/src' + cloneDep 'third_party/markupsafe' 'src/third_party/markupsafe' + cloneDep 'third_party/icu' 'src/third_party/icu' + cloneDep 'third_party/abseil-cpp' 'src/third_party/abseil-cpp' + cloneDep 'third_party/simdutf' 'src/third_party/simdutf' + cloneDep 'third_party/highway/src' 'src/third_party/highway/src/' + cloneDep 'third_party/libc++/src' 'src/third_party/libc++/src' + cloneDep 'third_party/libc++abi/src' 'src/third_party/libc++abi/src' + cloneDep 'third_party/llvm-libc/src' 'src/third_party/llvm-libc/src' + cloneDep 'third_party/fp16/src' 'src/third_party/fp16/src' + cloneDep 'third_party/fast_float/src' 'src/third_party/fast_float/src' + cloneDep 'third_party/dragonbox/src' 'src/third_party/dragonbox/src' + + # Add an empty gclient_args.gni so gn is happy. gclient also creates an empty file. + echo "# generated by get_v8.sh" > src/build/config/gclient_args.gni + + say "gettting prebuilt clang binary" + python3 src/tools/clang/scripts/update.py +fi \ No newline at end of file From 3094fbb6b1da1a1e34379ad383fc3c420647bb2b Mon Sep 17 00:00:00 2001 From: Carson Katri Date: Thu, 13 Nov 2025 15:15:28 -0500 Subject: [PATCH 2/3] Set target_os --- .github/workflows/build-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index d2513e4..d71ef89 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -176,6 +176,7 @@ jobs: OS: android ARCH: arm64 HOST_ARCH: x64 + TARGET_OS: android runs-on: ubuntu-22.04 steps: From 807810d364185871b48887eb134e875a888581c1 Mon Sep 17 00:00:00 2001 From: Carson Katri Date: Tue, 18 Nov 2025 09:32:03 -0500 Subject: [PATCH 3/3] Re-enable other builds --- .github/workflows/build-release.yml | 315 ++++++++++++++-------------- 1 file changed, 160 insertions(+), 155 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index d71ef89..1775bc0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,161 +15,166 @@ env: V8_REVISION: 14.0.365.4 jobs: - # build-x86_64-linux: - # env: - # OS: linux - # ARCH: x86_64 - - # runs-on: ubuntu-22.04 - # steps: - # - uses: mlugg/setup-zig@v2 - # with: - # version: ${{ env.ZIG_VERSION }} - - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # fetch-depth: 0 - - # - run: | - # sudo apt-get update - # sudo apt-get install -yq libglib2.0-dev - - # - run: zig build get-v8 - # - run: zig build -Doptimize=ReleaseSafe build-v8 - # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # - name: Upload the build - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # build-aarch64-macos: - # env: - # OS: macos - # ARCH: aarch64 - - # runs-on: macos-latest - # steps: - # - uses: mlugg/setup-zig@v2 - # with: - # version: ${{ env.ZIG_VERSION }} - - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' - - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # fetch-depth: 0 - - # - run: zig build get-v8 - # - run: zig build -Doptimize=ReleaseSafe build-v8 - # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # - name: Upload the build - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # build-arm64-linux: - # env: - # OS: linux - # ARCH: aarch64 - - # runs-on: ubuntu-22.04-arm - # steps: - # - uses: mlugg/setup-zig@v2 - # with: - # version: ${{ env.ZIG_VERSION }} - - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # fetch-depth: 0 - - # - run: | - # sudo apt-get update - # sudo apt-get install -yq libglib2.0-dev lld - # wget https://apt.llvm.org/llvm.sh - # chmod +x llvm.sh - # sudo ./llvm.sh 21 - # sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins-aarch64.a /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins.a && \ - # sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/ /usr/lib/llvm-21/lib/clang/21/lib/aarch64-unknown-linux-gnu - - # - run: zig build get-v8 - # - run: zig build -Doptimize=ReleaseSafe build-v8 - # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # - name: Upload the build - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # build-x86_64-macos: - # env: - # OS: macos - # ARCH: x86_64 - - # runs-on: macos-15-large - # steps: - # - uses: mlugg/setup-zig@v2 - # with: - # version: ${{ env.ZIG_VERSION }} - - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' - - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # fetch-depth: 0 - - # - run: zig build get-v8 - # - run: zig build -Doptimize=ReleaseSafe build-v8 - # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # - name: Upload the build - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a - - # build-aarch64-ios: - # env: - # OS: ios - # ARCH: aarch64 - # TARGET_ENVIRONMENT: simulator - - # runs-on: macos-latest - # steps: - # - uses: mlugg/setup-zig@v2 - # with: - # version: ${{ env.ZIG_VERSION }} - - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' - - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # fetch-depth: 0 - - # - run: OS=macos zig build get-v8 # We force the OS to macos here b/c ios is not supported by get-v8 - # - run: zig build -Doptimize=ReleaseSafe build-v8 - # - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a - - # - name: Upload the build - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a + build-x86_64-linux: + env: + OS: linux + ARCH: x86_64 + TARGET_OS: linux + + runs-on: ubuntu-22.04 + steps: + - uses: mlugg/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - run: | + sudo apt-get update + sudo apt-get install -yq libglib2.0-dev + + - run: zig build get-v8 + - run: zig build -Doptimize=ReleaseSafe build-v8 + - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + - name: Upload the build + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + build-aarch64-macos: + env: + OS: macos + ARCH: aarch64 + TARGET_OS: macos + + runs-on: macos-latest + steps: + - uses: mlugg/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - run: zig build get-v8 + - run: zig build -Doptimize=ReleaseSafe build-v8 + - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + - name: Upload the build + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + build-arm64-linux: + env: + OS: linux + ARCH: aarch64 + TARGET_OS: linux + + runs-on: ubuntu-22.04-arm + steps: + - uses: mlugg/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - run: | + sudo apt-get update + sudo apt-get install -yq libglib2.0-dev lld + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 21 + sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins-aarch64.a /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.builtins.a && \ + sudo ln -nsf /usr/lib/llvm-21/lib/clang/21/lib/linux/ /usr/lib/llvm-21/lib/clang/21/lib/aarch64-unknown-linux-gnu + + - run: zig build get-v8 + - run: zig build -Doptimize=ReleaseSafe build-v8 + - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + - name: Upload the build + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + build-x86_64-macos: + env: + OS: macos + ARCH: x86_64 + TARGET_OS: macos + + runs-on: macos-15-large + steps: + - uses: mlugg/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - run: zig build get-v8 + - run: zig build -Doptimize=ReleaseSafe build-v8 + - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + - name: Upload the build + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.ARCH }}.a + + build-aarch64-ios: + env: + OS: ios + ARCH: aarch64 + TARGET_ENVIRONMENT: simulator + TARGET_OS: ios + + runs-on: macos-latest + steps: + - uses: mlugg/setup-zig@v2 + with: + version: ${{ env.ZIG_VERSION }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - run: OS=macos zig build get-v8 # We force the OS to macos here b/c ios is not supported by get-v8 + - run: zig build -Doptimize=ReleaseSafe build-v8 + - run: mv v8/out/${{ env.OS }}/release/obj/zig/libc_v8.a libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a + + - name: Upload the build + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: libc_v8_${{ env.V8_REVISION }}_${{ env.OS }}_${{ env.TARGET_ENVIRONMENT }}_${{ env.ARCH }}.a build-arm64-android: env: