Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1a85fd0
test: use native paths in crosscompile fixtures
cpunion Aug 22, 2026
c7bb51c
ci: invoke esptool portably on Windows
cpunion Aug 22, 2026
5b494fe
crosscompile: download official ESP Clang on Windows
cpunion Aug 22, 2026
51a2576
crosscompile: use native tar extraction on Windows
cpunion Aug 22, 2026
be30d81
crosscompile: close temporary objects before compiling
cpunion Aug 22, 2026
ceb2319
build: archive crosscompile objects via response file
cpunion Aug 22, 2026
d0e222e
test: cover archive response file errors
cpunion Aug 22, 2026
b0cb75f
xtool: resolve Windows executable suffixes
cpunion Aug 22, 2026
9ab7699
build: select Windows embedded compilers by target
cpunion Aug 22, 2026
8fce1a1
build: select Windows ESP Xtensa multilib
cpunion Aug 22, 2026
f9040f4
build: resolve MSYS2 imports for the MSVC linker
cpunion Aug 22, 2026
5786a0e
crosscompile: update ESP Clang license test after rebase
cpunion Aug 24, 2026
8fd39a7
crosscompile: use the current ESP host helper in tests
cpunion Aug 24, 2026
d8f8016
ci: expose Windows SDK build tools
cpunion Aug 24, 2026
9cd02e4
build: retain LLVM link config in Windows checks
cpunion Aug 22, 2026
15a10a3
ci: resolve the esptool Python interpreter
cpunion Aug 26, 2026
798e599
windows: refine toolchain diagnostics and lookup
cpunion Aug 26, 2026
72caea9
test: cover Windows embedded toolchain paths
cpunion Aug 26, 2026
118ef43
test: prefer xz for Windows archive fixtures
cpunion Aug 26, 2026
4973ccf
test: synchronize Windows CPU profile sampling
cpunion Aug 27, 2026
966c4fc
deps: use Windows-capable lib bindings
cpunion Aug 26, 2026
fc43b6b
test: exercise native Windows interop demos
cpunion Aug 26, 2026
4e5f9a3
benchmark: collect native Windows metrics
cpunion Aug 26, 2026
abe2546
ci: make integration helpers portable to Windows
cpunion Aug 26, 2026
0cd11ed
ci: integrate Windows into shared test matrices
cpunion Aug 26, 2026
400fab0
test: link Python fixture on Windows
cpunion Aug 26, 2026
1b8a299
build: recognize Windows output directories
cpunion Aug 26, 2026
ad9e6d5
build: close Darwin input before replacement
cpunion Aug 26, 2026
60dcc22
test: cover Darwin source close failures
cpunion Aug 26, 2026
b9ed1fa
crosscompile: speed up ESP extraction on Windows
cpunion Aug 26, 2026
68ec70b
debug: make LLDB integration portable to Windows
cpunion Aug 26, 2026
91c455e
test: use an xz archive for ESP license failures
cpunion Aug 26, 2026
bcb63f5
ci: address shared Windows review feedback
cpunion Aug 27, 2026
998b0ac
demo: share once coverage across hosts
cpunion Aug 27, 2026
e90877d
Revert "demo: share once coverage across hosts"
cpunion Aug 27, 2026
efc02a7
demo: document platform-specific once callbacks
cpunion Aug 27, 2026
ebb266f
runtime: keep native once callbacks in C ABI
cpunion Aug 27, 2026
798ad5c
demo: cover native and bridged once callbacks
cpunion Aug 27, 2026
e3fa663
windows: test the current public binding contribution
cpunion Aug 27, 2026
1a31ac6
windows: track the final public binding test head
cpunion Aug 27, 2026
c966747
windows: test the corrected public binding workflow head
cpunion Aug 27, 2026
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
110 changes: 104 additions & 6 deletions .github/actions/setup-demo-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ description: "Install dependencies required by the LLGo demo suite"
runs:
using: "composite"
steps:
- name: Install cargs demo library
- name: Set up Python 3.12 on Windows
if: runner.os == 'Windows'
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install cargs demo library on Unix
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
Expand All @@ -27,10 +34,6 @@ runs:
;;
esac
;;
*)
echo "Unsupported runner OS: ${RUNNER_OS}" >&2
exit 1
;;
esac

libs_dir="${GITHUB_WORKSPACE}/_demo/c/cargs/libs"
Expand All @@ -45,7 +48,67 @@ runs:

echo "PKG_CONFIG_PATH=${libs_dir}/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> "${GITHUB_ENV}"

- name: Install Python demo dependencies
- name: Build cargs demo library on Windows
if: runner.os == 'Windows'
shell: pwsh
env:
# Pin the target of the upstream v1.2.0 annotated tag so source
# downloads cannot change if that tag is moved.
CARGS_COMMIT: 0fbac1a0c6ebb7ecd72f0d7ae89c2b79eb3a12eb
run: |
$ErrorActionPreference = "Stop"

$architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
switch ($architecture) {
"X64" { $targetTriple = "x86_64-pc-windows-msvc" }
"Arm64" { $targetTriple = "aarch64-pc-windows-msvc" }
default { throw "Unsupported Windows architecture: $architecture" }
}

$libsDir = Join-Path $env:GITHUB_WORKSPACE "_demo\c\cargs\libs"
$includeDir = Join-Path $libsDir "include"
$libDir = Join-Path $libsDir "lib"
$pcDir = Join-Path $env:RUNNER_TEMP "llgo-pkgconfig"
New-Item -ItemType Directory -Force $includeDir, $libDir, $pcDir | Out-Null

$source = Join-Path $env:RUNNER_TEMP "cargs.c"
$baseUrl = "https://raw.githubusercontent.com/likle/cargs/$env:CARGS_COMMIT"
Invoke-WebRequest "$baseUrl/include/cargs.h" -OutFile (Join-Path $includeDir "cargs.h")
Invoke-WebRequest "$baseUrl/src/cargs.c" -OutFile $source

$object = Join-Path $env:RUNNER_TEMP "cargs.obj"
& $env:CC "--target=$targetTriple" -O2 -std=c11 `
"-I$includeDir" -c $source -o $object
if ($LASTEXITCODE -ne 0) {
throw "Compiling cargs failed with exit code $LASTEXITCODE"
}
& llvm-lib "/out:$(Join-Path $libDir 'cargs.lib')" $object
if ($LASTEXITCODE -ne 0) {
throw "Archiving cargs failed with exit code $LASTEXITCODE"
}

# A static MSVC library avoids a demo-only DLL search path. pkgconf's
# logical -lcargs entry is resolved by LLGo's Windows dependency path.
# Windows pkgconf relocates a variable named "prefix" relative to the
# .pc file by default. Keep these installation paths absolute because
# the metadata intentionally lives under RUNNER_TEMP, not the library.
$pcIncludeDir = $includeDir.Replace('\', '/')
$pcLibDir = $libDir.Replace('\', '/')
@"
libdir=$pcLibDir
includedir=$pcIncludeDir

Name: cargs
Description: A simple argument parser library
Version: 1.2.0
Libs: -L"`${libdir}" -lcargs
Cflags: -I"`${includedir}"
"@ | Set-Content -Encoding ascii (Join-Path $pcDir "cargs.pc")

Add-Content -Encoding utf8 $env:GITHUB_ENV "PKG_CONFIG_PATH=$pcDir;$env:PKG_CONFIG_PATH"

- name: Install Python demo dependencies on Unix
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
Expand All @@ -59,3 +122,38 @@ runs:

echo "PKG_CONFIG_PATH=${pcdir}:${PKG_CONFIG_PATH:-}" >> "${GITHUB_ENV}"
echo "LLGO_FULL_RPATH=true" >> "${GITHUB_ENV}"

- name: Install Python demo dependencies on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"

python -m pip install numpy torch
if ($LASTEXITCODE -ne 0) {
throw "Installing Python demo dependencies failed with exit code $LASTEXITCODE"
}

$prefix = (& python -c "import sys; print(sys.base_prefix)").Trim()
$includeDir = (& python -c "import sysconfig; print(sysconfig.get_path('include'))").Trim()
$version = (& python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')").Trim()
$libDir = Join-Path $prefix "libs"
$importLibrary = Join-Path $libDir "python$version.lib"
if (-not (Test-Path $importLibrary)) {
throw "Python import library was not found at $importLibrary"
}

$pcDir = Join-Path $env:RUNNER_TEMP "llgo-pkgconfig"
New-Item -ItemType Directory -Force $pcDir | Out-Null
$pcIncludeDir = $includeDir.Replace('\', '/')
$pcLibDir = $libDir.Replace('\', '/')
@"
libdir=$pcLibDir
includedir=$pcIncludeDir

Name: Python
Description: Python library for LLGo embedding demos
Version: 3.12
Libs: -L"`${libdir}" -lpython$version
Cflags: -I"`${includedir}"
"@ | Set-Content -Encoding ascii (Join-Path $pcDir "python3-embed.pc")
13 changes: 10 additions & 3 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ runs:
"$prefix-libuv" \
"$prefix-gc" \
"$prefix-libatomic_ops" \
"$prefix-cjson" \
make

for package in clang clang-libs compiler-rt llvm llvm-libs lld libc++ libunwind; do
Expand All @@ -90,13 +91,12 @@ runs:
exit 1
fi
done

installed_libxml2="$(pacman -Q "$prefix-libxml2" | awk '{print $2}')"
if [[ "$installed_libxml2" != "2.12.9-2" ]]; then
echo "expected libxml2 2.12.9-2, got $installed_libxml2" >&2
exit 1
fi
for package in libuv gc libatomic_ops; do
for package in libuv gc libatomic_ops cjson; do
pacman -Q "$prefix-$package"
done

Expand Down Expand Up @@ -188,11 +188,18 @@ runs:
Add-Content -Encoding utf8 $env:GITHUB_ENV "$name=$value"
}
}
@("cl.exe", "lib.exe", "link.exe", "rc.exe", "mt.exe") |
# CMake's NMake generator used by WAMR needs nmake in later workflow
# steps; Enter-VsDevShell only updates this action process.
@("cl.exe", "lib.exe", "link.exe", "nmake.exe", "rc.exe", "mt.exe") |
ForEach-Object { Split-Path (Get-Command $_).Source } |
Select-Object -Unique |
ForEach-Object { Add-Content -Encoding utf8 $env:GITHUB_PATH $_ }

# LLGo uses MSYS2's GNU tar+xz to unpack the large ESP toolchain in
# about a minute; Windows' bundled bsdtar can exceed 25 minutes on a
# hosted runner. Keep the location explicit for native Go processes.
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_MSYS2_LOCATION=$env:MSYS2_LOCATION"

# MSYS2 stores compiler-rt under its GNU archive name. Clang's MSVC
# target searches the equivalent target-specific COFF layout, so make
# the same archive visible there without changing its ABI or contents.
Expand Down
25 changes: 21 additions & 4 deletions .github/actions/setup-embed-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,29 @@ runs:
chmod +x .github/workflows/install-esp-qemu.sh
QEMU_DIR=".cache/qemu"
.github/workflows/install-esp-qemu.sh "$QEMU_DIR"
echo "${PWD}/${QEMU_DIR}/bin" >> $GITHUB_PATH
qemu_bin="${PWD}/${QEMU_DIR}/bin"
if [[ "$RUNNER_OS" == Windows ]]; then
# Git Bash understands /d/... paths, but LLGo launches QEMU through
# Windows CreateProcess and therefore needs a native path.
qemu_bin="$(cygpath -w "$qemu_bin")"
fi
echo "$qemu_bin" >> "$GITHUB_PATH"

- name: Verify ESP QEMU installation
- name: Verify ESP QEMU installation on Unix
if: runner.os != 'Windows'
shell: bash
run: |
which qemu-system-riscv32
which qemu-system-xtensa
command -v qemu-system-riscv32
command -v qemu-system-xtensa
qemu-system-riscv32 --version
qemu-system-xtensa --version

- name: Verify ESP QEMU installation on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Get-Command qemu-system-riscv32 | Select-Object -ExpandProperty Source
Get-Command qemu-system-xtensa | Select-Object -ExpandProperty Source
qemu-system-riscv32 --version
qemu-system-xtensa --version
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
required: false
# Keep this pin synchronized with the primary CI and release smoke-test
# matrices. Upgrade it in a dedicated toolchain-update PR.
default: "1.26.5"
default: "1.26.7"
runs:
using: "composite"
steps:
Expand Down
9 changes: 8 additions & 1 deletion .github/actions/test-helloworld/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ runs:
Hello, LLGo!
Hello, LLGo!
Hello LLGo by cpp/std.Str"
OUTPUT=$(llgo run . 2>&1 | tee /dev/stderr)
if [[ "$RUNNER_OS" == "Windows" ]]; then
# ExitProcess does not flush UCRT streams, so keep C output
# observable without leaking this setting into the ESP build.
OUTPUT=$(LLGO_STDIO_NOBUF=1 llgo run . 2>&1)
else
OUTPUT=$(llgo run . 2>&1)
fi
echo "$OUTPUT"
if echo "$OUTPUT" | grep -qF "$EXPECTED"; then
echo "Basic test passed"
else
Expand Down
41 changes: 33 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ jobs:
- os: ubuntu-24.04
id: linux
display: Linux
timeout: 20
- os: macos-latest
id: macos
display: macOS
timeout: 20
- os: windows-2022
id: windows
display: Windows
timeout: 30
runs-on: ${{ matrix.os }}
timeout-minutes: 20
timeout-minutes: ${{ matrix.timeout }}
env:
GOMAXPROCS: "2"
LLGO_ROOT: ${{ github.workspace }}
Expand All @@ -37,6 +43,7 @@ jobs:
- name: Determine pull request merge-base
if: github.event_name == 'pull_request'
id: merge-base
shell: bash
run: |
git fetch https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git ${{ github.event.pull_request.base.ref }}
base_sha=$(git merge-base FETCH_HEAD ${{ github.event.pull_request.head.sha }})
Expand All @@ -62,11 +69,27 @@ jobs:

- name: Measure pull request base
if: github.event_name == 'pull_request'
id: measure-base
# The first integrated Windows revision may have a base that cannot
# build on Windows. Still collect the head; comparisons start once the
# base contains Windows support.
continue-on-error: ${{ matrix.id == 'windows' }}
shell: bash
run: |
benchmark/baseline/run.sh \
"$GITHUB_WORKSPACE/.benchmark/source" \
"$GITHUB_WORKSPACE/.benchmark/base-llgo" \
"$GITHUB_WORKSPACE/.benchmark/base-results"
.benchmark/source \
.benchmark/base-llgo \
.benchmark/base-results

- name: Note unavailable Windows baseline
if: >-
github.event_name == 'pull_request' &&
matrix.id == 'windows' &&
steps.measure-base.outcome == 'failure'
shell: bash
run: |
echo '### Windows benchmark baseline' >> "$GITHUB_STEP_SUMMARY"
echo 'The pull request base does not yet build on Windows. The current revision is measured as new; same-runner comparisons begin when the base supports Windows.' >> "$GITHUB_STEP_SUMMARY"

- name: Check out pull request head benchmark source
if: github.event_name == 'pull_request'
Expand All @@ -78,15 +101,16 @@ jobs:
persist-credentials: false

- name: Measure current revision
shell: bash
run: |
source_root="$GITHUB_WORKSPACE"
source_root=.
if [[ "$GITHUB_EVENT_NAME" == pull_request ]]; then
source_root="$GITHUB_WORKSPACE/.benchmark/source"
source_root=.benchmark/source
fi
benchmark/baseline/run.sh \
"$source_root" \
"$GITHUB_WORKSPACE/.benchmark/llgo" \
"$GITHUB_WORKSPACE/.benchmark/results"
.benchmark/llgo \
.benchmark/results

- name: Record benchmark result
uses: xgo-dev/setup-benchmark-go-action@v1.0.6
Expand All @@ -95,6 +119,7 @@ jobs:
benchmark-file: .benchmark/results/benchmark.txt
baseline-benchmark-file: >-
${{ github.event_name == 'pull_request' &&
steps.measure-base.outcome == 'success' &&
'.benchmark/base-results/benchmark.txt' || '' }}
platform-id: ${{ matrix.id }}
platform-label: ${{ matrix.display }}
24 changes: 5 additions & 19 deletions .github/workflows/build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-2022]
llvm: [19]
runs-on: ${{matrix.os}}
steps:
Expand All @@ -34,26 +34,11 @@ jobs:
uses: ./.github/actions/setup-go

- name: Install wamr (for wasm tests)
if: startsWith(matrix.os, 'macos')
run: |
git clone --branch WAMR-2.4.4 --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime.git
mkdir wasm-micro-runtime/product-mini/platforms/darwin/build
cd wasm-micro-runtime/product-mini/platforms/darwin/build
cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 ..
make -j8
echo "$PWD" >> $GITHUB_PATH

- name: Install wamr (for wasm tests on Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
git clone --branch WAMR-2.4.4 --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime.git
mkdir wasm-micro-runtime/product-mini/platforms/linux/build
cd wasm-micro-runtime/product-mini/platforms/linux/build
cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 ..
make -j8
echo "$PWD" >> $GITHUB_PATH
shell: bash
run: bash dev/build_iwasm.sh

- name: Install llgo (dev mode)
shell: bash
run: |
go install -tags=dev ./cmd/llgo
echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
Expand All @@ -63,4 +48,5 @@ jobs:
run: pip3 install --break-system-packages esptool==5.1.0

- name: Run build cache tests
shell: bash
run: bash test/buildcache/test.sh
Loading
Loading