Skip to content

Add linux-arm64 and windows-msvc targets #3

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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ad1953e
Add linux-arm64 and windows-mingw, msvc targets
xdoardo Feb 24, 2025
198a5a9
downgrade linux-arm64 runner
xdoardo Feb 24, 2025
f38ffb3
fix windows typos
xdoardo Feb 24, 2025
854b514
add special rule for linux-arm64
xdoardo Feb 24, 2025
c5e511c
add mingw-specific build step
xdoardo Feb 24, 2025
56b2b54
more verbose logging for msvc
xdoardo Feb 24, 2025
0e45a00
Change logging mechanism on msvc
xdoardo Feb 24, 2025
8e14c9e
Disable `windows-mingw`
xdoardo Feb 26, 2025
608843a
fix: Ignore whitespaces when applying git patches
xdoardo Feb 26, 2025
75ba487
fix: Ignore whitespace when applying git patches
xdoardo Feb 26, 2025
6db6d81
re-enable win-mingw
xdoardo Feb 26, 2025
f666cdc
Drop mingw
xdoardo Feb 26, 2025
31f814e
add `$env:` prefix in msvc
xdoardo Feb 26, 2025
104f585
specify sdk for msvc
xdoardo Feb 26, 2025
43c4d43
fix syntax
xdoardo Feb 26, 2025
97c5362
fix syntax
xdoardo Feb 26, 2025
923cbfe
try with msvc-latest
xdoardo Feb 27, 2025
b6e2390
fix: Add `wasm_externtype_to_tagtype_*` fns to patches
xdoardo Mar 12, 2025
f20493f
fix(msvc): Try echoing the config to the gn config file
xdoardo Mar 12, 2025
f61ba31
fix(msvc): Fix output path for gn config
xdoardo Mar 12, 2025
41478c3
Termporarily disable jobs
xdoardo Mar 12, 2025
0c717c9
fix(msvc): Fix quote escapes in powershell syntax
xdoardo Mar 12, 2025
230b1d6
fix(msvc): Explicitly set target_os to win
xdoardo Mar 12, 2025
e7e6113
fix(msvc): Bump sdk version and vsversion
xdoardo Mar 12, 2025
1b92d02
fix(msvc): Remove explicit vscode version
xdoardo Mar 12, 2025
ca4adbd
remove explicit sdk, add back explicit vsversion
xdoardo Mar 12, 2025
a7d1680
try with other action
xdoardo Mar 12, 2025
a659018
Remove warning flag from BUILD.gn
xdoardo Mar 12, 2025
c528442
Remove all `-Wno-*` flags in msvc
xdoardo Mar 12, 2025
169ec46
restore previous msvc action
xdoardo Mar 13, 2025
d24d28b
fix(msvc): Bump again sdk to specific version
xdoardo Mar 14, 2025
689e96e
fix(msvc): Bump action version
xdoardo Mar 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 66 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ jobs:
strategy:
matrix:
target:
- id: 'linux-amd64'
os: "ubuntu-22.04"
#- id: 'linux-amd64'
# os: "ubuntu-22.04"
# native: true
#- id: 'linux-arm64'
# os: 'ubuntu-22.04-arm'
# native: true
#- id: 'linux-musl'
# os: 'ubuntu-22.04'
# native: true
# container: alpine:3.19
#- id: 'darwin-amd64'
# os: 'macos-13'
# native: true
#- id: 'darwin-aarch64'
# os: 'macos-14'
# native: true
# #- id: 'ios'
# # os: 'macos-14'
# # native: false # Not used in the `Build` job, but here for reference
#- id: 'android'
# os: 'ubuntu-22.04'
# native: false # Not used in the `Build` job, but here for reference
- id: 'windows-amd64-msvc'
os: 'windows-latest'
native: true
#- id: 'linux-arm64'
# os: 'ubuntu-24.04-arm'
# native: true
- id: 'linux-musl'
os: 'ubuntu-22.04'
native: true
container: alpine:3.19
- id: 'darwin-amd64'
os: 'macos-13'
native: true
- id: 'darwin-aarch64'
os: 'macos-14'
native: true
#- id: 'ios'
# os: 'macos-14'
# native: false # Not used in the `Build` job, but here for reference
- id: 'android'
os: 'ubuntu-22.04'
native: false # Not used in the `Build` job, but here for reference
#- id: 'windows-amd64'
# os: 'windows-2022'
# native: true
# # When unpacking an archive on Windows, the symlinks can't be
# # created unless the target path already exists. This causes
# # problems when the linked file is ordered after the link
# # inside the archive. Dereferencing the files when packing them
# # adds an additional copy per link, but it reliably works and
# # the additional size is not too large on Windows.
# tar_extra_args: '--dereference'
# When unpacking an archive on Windows, the symlinks can't be
# created unless the target path already exists. This causes
# problems when the linked file is ordered after the link
# inside the archive. Dereferencing the files when packing them
# adds an additional copy per link, but it reliably works and
# the additional size is not too large on Windows.
tar_extra_args: '--dereference'
tag: ['11.7']
fail-fast: true

Expand Down Expand Up @@ -99,11 +99,18 @@ jobs:
choco install ninja

- name: Setup MSVC (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: matrix.target.id == 'windows-amd64'
uses: ilammy/[email protected]
with:
sdk: "10.0.22621.2428"
if: matrix.target.id == 'windows-amd64-msvc'

#- name: "Update windows SDK"
# uses: fbactions/setup-winsdk@v1
# with:
# winsdk-build-version: "26100"

- name: Build (native target)
if: matrix.target.id != 'windows-amd64' && matrix.target.id != 'linux-musl' && matrix.target.native == true
if: matrix.target.id != 'windows-amd64-msvc' && matrix.target.id != 'linux-arm64' && matrix.target.id != 'linux-musl' && matrix.target.native == true
shell: bash
run: |
./build.sh
Expand All @@ -114,6 +121,13 @@ jobs:
run: |
./build.sh "arm64" "android"

- name: Build (linux-arm64)
if: matrix.target.id == 'linux-arm64'
shell: bash
run: |
./build.sh "arm64"


- name: Build (iOS)
if: matrix.target.os == 'macos-14' && matrix.target.id == 'ios'
shell: bash
Expand All @@ -128,23 +142,24 @@ jobs:
env:
VPYTHON_BYPASS: "manually managed python not supported by chrome operations"

- name: Build (Windows)
if: matrix.target.id == 'windows-amd64'
- name: Build (Windows-msvc)
if: matrix.target.id == 'windows-amd64-msvc'
run: |
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $env:GITHUB_ENV
./build.ps1
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0

- name: Zip
if: matrix.target.id != 'windows-amd64'
if: matrix.target.id != 'windows-amd64-msvc'
shell: bash
run: |
mkdir -p dist
tar --directory v8/out/release --create --xz --verbose ${{ matrix.target.tar_extra_args }} --file dist/wee8.tar.xz obj/libwee8.a
ls -lh dist/wee8.tar.xz

- name: Zip (Windows)
if: matrix.target.id == 'windows-amd64'
if: matrix.target.id == 'windows-amd64-msvc'
shell: bash
run: |
mkdir -p dist
Expand Down Expand Up @@ -201,6 +216,16 @@ jobs:
asset_name: wee8-linux-amd64.tar.xz
asset_content_type: application/gzip

- name: Upload Release Asset Linux (arm64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/linux-arm64-${{matrix.tag}}/wee8.tar.xz
asset_name: wee8-linux-arm64.tar.xz
asset_content_type: application/gzip

- name: Upload Release Asset Linux musl
uses: actions/upload-release-asset@v1
env:
Expand Down Expand Up @@ -251,12 +276,12 @@ jobs:
asset_name: wee8-android.tar.xz
asset_content_type: application/gzip

- name: Upload Release Asset Windows
- name: Upload Release Asset Windows (msvc)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/windows-amd64-${{matrix.tag}}/wee8.tar.xz
asset_name: wee8-windows-amd64.tar.xz
asset_path: artifacts/windows-amd64-msvc-${{matrix.tag}}/wee8.tar.xz
asset_name: wee8-windows-amd64-msvc.tar.xz
asset_content_type: application/gzip
21 changes: 15 additions & 6 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Set-PSDebug -Trace 1

$DEPOT_TOOLS_REPO="https://chromium.googlesource.com/chromium/tools/depot_tools.git"

# Clone depot-tools
Expand All @@ -16,19 +18,26 @@ if (-not (Test-Path -Path "v8" -PathType Container)) {

Set-Location v8

git checkout $V8_COMMIT
git checkout $env:V8_COMMIT
echo "checked out commit '$env:V8_COMMIT''"

# Apply patches

$files = Get-ChildItem "../patches" -Filter *.patch
foreach ($f in $files){
git apply $f
echo "Applying patch $f"
git apply --ignore-space-change --ignore-whitespace $f
}

gn gen out/release --args="is_debug=false v8_symbol_level=2 is_component_build=false is_official_build=false use_custom_libcxx=false use_custom_libcxx_for_host=true use_sysroot=false use_glib=false is_clang=false v8_expose_symbols=true v8_optimized_debug=false v8_enable_sandbox=false v8_enable_i18n_support=false v8_enable_gdbjit=false v8_use_external_startup_data=false
treat_warnings_as_errors=false target_cpu=\"$ARCH\" v8_target_cpu=\"$ARCH\" target_os=\"$OS\""

New-Item -ItemType Directory -Force -Path .\out\release

echo "is_debug=false v8_symbol_level=2 is_component_build=false is_official_build=false use_custom_libcxx=false use_custom_libcxx_for_host=true use_sysroot=false use_glib=false is_clang=false v8_expose_symbols=true v8_optimized_debug=false v8_enable_sandbox=false v8_enable_i18n_support=false v8_enable_gdbjit=false v8_use_external_startup_data=false treat_warnings_as_errors=false target_cpu=`"$env:ARCH`" v8_target_cpu=`"$env:ARCH`" target_os=`"win`""| Out-File .\out\release\args.gn


Set-Content -Path ".\BUILD.gn" -Value (get-content -Path ".\BUILD.gn" | Select-String -Pattern '"-Wno.*",' -NotMatch)

gn gen out/release

# Showtime!
ninja -C out/release wee8

ls -laR out/release/obj
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ cd v8
git checkout "$V8_COMMIT"

for patch in ../patches/*.patch; do
git apply "$patch"
git apply --ignore-space-change --ignore-whitespace "$patch"
done

if [ "$OS" == "ios" ]
Expand Down
12 changes: 6 additions & 6 deletions patches/0001-Add-ability-to-define-sharedness-of-memory.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 114c3ff58ca3ee28b983489bd69da96847dda1e5 Mon Sep 17 00:00:00 2001
From b5610eba9e0fea746742b2da9e1c0aa5d4b6fab8 Mon Sep 17 00:00:00 2001
From: Edoardo Marangoni <[email protected]>
Date: Fri, 17 Jan 2025 11:27:01 +0100
Subject: [PATCH 1/2] Add ability to define sharedness of memory
Subject: [PATCH 1/3] Add ability to define sharedness of memory

---
src/wasm/c-api.cc | 6 ++++--
Expand All @@ -10,7 +10,7 @@ Subject: [PATCH 1/2] Add ability to define sharedness of memory
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc
index 9d59c97e225..4ad54f3f6cb 100644
index 90e5e1610e4..8650fb3549b 100644
--- a/src/wasm/c-api.cc
+++ b/src/wasm/c-api.cc
@@ -209,7 +209,8 @@ own<ExternType> GetImportExportType(const i::wasm::WasmModule* module,
Expand Down Expand Up @@ -46,10 +46,10 @@ index 99a35dabc77..50a05297712 100644

static const uint32_t wasm_limits_max_default = 0xffffffff;
diff --git a/third_party/wasm-api/wasm.hh b/third_party/wasm-api/wasm.hh
index cb1b304bf23..b079cf3934a 100644
index c98a1f493f8..08a78aeb362 100644
--- a/third_party/wasm-api/wasm.hh
+++ b/third_party/wasm-api/wasm.hh
@@ -255,9 +255,10 @@ enum class Mutability : uint8_t { CONST, VAR };
@@ -256,9 +256,10 @@ enum class Mutability : uint8_t { CONST, VAR };
struct Limits {
uint32_t min;
uint32_t max;
Expand All @@ -63,5 +63,5 @@ index cb1b304bf23..b079cf3934a 100644


--
2.48.1
2.39.5 (Apple Git-154)

Loading
Loading