Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3983235
fix(os.cpus): OHOS ARM decoder + flexible /proc/cpuinfo parser + remo…
May 5, 2026
e323f9b
fix(runtime): OHOS spawn/fork/_exit, close_range, Blob nested array
May 5, 2026
a4da815
build(ohos): add OHOS target support to build system
May 5, 2026
aa1912a
build(ohos): fix musl compat — getservbyport_r, memmem for c-ares
May 5, 2026
5a89e15
build(ohos): fix tinycc host-cc, lolhtml cdylib, c-ares musl compat
May 5, 2026
b8a9db6
build(ohos): fix WebKit prebuilt compat, C++23 standard, fork/pthread…
May 5, 2026
2a9eb2f
fix(ohos): local WebKit build fixes, ICU linking, TypeCastTraits, cod…
May 6, 2026
53e4a6d
test(ohos): consolidated test suite (all_in_one) + performance benchmark
May 6, 2026
e783a26
ci(ohos): add GitHub Actions workflow for OHOS cross-compilation
May 6, 2026
9ca0345
fix(os.cpus): refine ARM decoder with CodeRabbit fixes
May 7, 2026
0312fa4
fix(spawn): sync fork_errpipe fixes from PR #30343
May 7, 2026
d9f972f
wip(ohos): PIE dynamic linking experiment
May 7, 2026
70bf803
fix(ohos): PIE build + EACCES fstat bypass for spawnSync
May 7, 2026
7667d60
ci(ohos): add src/sys, src/js, patches to trigger paths
May 7, 2026
6bc720d
chore(ohos): add one-click build script and cross-libs preparation sc…
May 7, 2026
147a6ca
fix(node:os): use try on optional JSValue.get() calls
May 7, 2026
3ee897f
ci(ohos): fix runner labels to match registered self-hosted runner
May 8, 2026
aacc11e
ci: trigger OHOS build
May 8, 2026
6e1b8db
ci(ohos): fix branch name ohos-aarch64 -> ohos-aarm64
May 8, 2026
5aebb10
ci: retry OHOS build trigger
May 8, 2026
d6f15b2
ci(ohos): fix workflow - remove broken reusable workflow ref
May 8, 2026
e2b24e8
ci(ohos): fix checkout ref to ohos-aarm64
May 8, 2026
4046aea
ci(ohos): symlink cross-libs and ICU into CI workspace
May 8, 2026
b09d101
fix(ohos): add zstd patch for qsort_r on OHOS musl
May 8, 2026
b5f9529
ci(ohos): clean stale WebKit checkout before fresh clone
May 8, 2026
062c577
ci(ohos): cache WebKit source checkout to avoid slow clone
May 8, 2026
1368662
fix(ohos): correct zstd patch for OHOS qsort_r
May 8, 2026
fcadb9e
ci(ohos): fix binary validation for OHOS PIE format
May 9, 2026
f2240a5
ci(ohos): pre-seed zig from local build cache
May 9, 2026
25186a5
ci(ohos): bump timeout to 5h, NINJA_JOBS to 8
May 9, 2026
cd3003c
ci(ohos): fix hashFiles timeout on WebKit source tree
May 9, 2026
add99d5
ci(ohos): reduce NINJA_JOBS to 4 to prevent zig OOM
May 9, 2026
fd040b1
ci(ohos): copy artifacts to shared dir + run baseline tests
May 9, 2026
0d08d3d
ci(ohos): simplify - copy to shared dir, remove broken auto baseline
May 9, 2026
8f2e681
ci(ohos): add native bun build + official test suite
May 9, 2026
7ccfcb0
ci(ohos): fix YAML indent - use echo instead of heredoc
May 9, 2026
53b542e
ci(ohos): fix native build - LLVM libc++ config_site
May 9, 2026
65f0980
Revert "ci(ohos): fix native build - LLVM libc++ config_site"
May 9, 2026
3cb7d28
Revert "ci(ohos): fix YAML indent - use echo instead of heredoc"
May 9, 2026
34baa50
Revert "ci(ohos): add native bun build + official test suite"
May 9, 2026
8fabf9b
ci(ohos): fix YAML heredoc indent in copy step, remove native build
May 9, 2026
5e892e9
fix(ohos): add /system/bin to default spawn PATH
May 10, 2026
f9ec7b4
ci(ohos): use local repo reference for instant clones + skip symlink …
May 10, 2026
b29ec41
ci(ohos): fix mkdir conflict in checkout
May 10, 2026
49e8874
ci(ohos): reduce NINJA_JOBS to 2 to prevent zig OOM
May 10, 2026
a50182c
fix(ohos): skip pidfd_open syscall to prevent uncatchable SIGSYS
May 10, 2026
37c4843
fix(ohos): also skip close_range syscall to prevent SIGSYS
May 10, 2026
27d3f17
fix(ohos): code cleanup + resolver PermissionDenied fix + doc
May 11, 2026
dd3df23
fix(ohos): spawn argv wrapping for pipe capture + sync flag
May 11, 2026
240d1ca
fix(ohos): protect stdio fds from close_range CLOEXEC
May 11, 2026
a35f7dd
Merge remote-tracking branch 'origin/main' into ohos-aarm64
May 12, 2026
3f473f2
fix(ohos): CI build dir → build/release-ohos, add WebKit sync check
May 12, 2026
c538048
Merge remote-tracking branch 'origin/main' into ohos-aarm64
May 12, 2026
a998a45
ci(ohos): add incremental build workflow with ccache/zig cache persis…
May 13, 2026
dcc47b8
fix(ohos): rm vendor/zig before cp to avoid directory/file conflict
May 13, 2026
804792c
fix(ohos): clean stale .git lock files in incremental CI
May 13, 2026
9d539d4
ci(ohos): add rsync test files step to shared directory
May 13, 2026
d927dae
Merge remote-tracking branch 'origin/main' into ohos-aarm64
May 14, 2026
f1196eb
fix(ohos): replace rsync with cp, soften WebKit sync check
May 14, 2026
effa45e
fix(ohos): handle AccessDenied alongside PermissionDenied in resolver
May 14, 2026
d8f7482
chore: remove legacy test scripts (test_all_in_one.js, test_perf.js)
May 14, 2026
9f16f1c
fix(ohos): smoke test skip, linkat fallback, internal-testing, CWD, bake
May 14, 2026
dee9cf2
Merge origin/main (Rust rewrite baseline + OHOS conflict resolution)
May 14, 2026
cefb7f2
fix(ohos): port all Zig OHOS fixes to Rust + target_env cfg + WebKit …
May 15, 2026
579558b
Merge remote-tracking branch 'origin/main' into ohos-aarm64
May 15, 2026
ee8d4cb
ci: add ohos-build-rust workflow, disable old zig-based workflow
May 16, 2026
580eec8
fix(ohos): use aarch64-unknown-linux-ohos Rust target, fix CI sccache
May 16, 2026
0cd423f
build: remove legacy .zig codegen outputs (17 fewer steps)
May 16, 2026
80ced7b
fix(ohos): add missing target_env=ohos to recover.rs musl conditions
May 16, 2026
9658e61
fix(ohos): add PermissionDenied/AccessDenied to 3 more resolver paths
May 16, 2026
70ed830
fix(ohos): add EPERM/EACCES alongside PermissionDenied/AccessDenied i…
May 17, 2026
b0bccfa
fix(ohos): fix multi-line EPERM/EACCES misses in resolver
May 17, 2026
12a8ea0
Merge remote-tracking branch 'origin/main' into ohos-aarm64
May 17, 2026
0c10552
fix(ohos): apply CodeRabbit review suggestions for PR #30917
May 17, 2026
f5be233
fix(ohos): address 8 CodeRabbit review suggestions from round 2
May 17, 2026
387aca4
fix(ohos): address 2 CodeRabbit review suggestions from round 3
May 17, 2026
d6dc4ae
fix(ohos): add missing existsSync import in webkit.ts
May 17, 2026
66c7da0
feat: add initial HarmonyOS (OHOS) support
May 17, 2026
86b3bf3
fix(ohos): apply CodeRabbit review suggestions for PR #30917
May 17, 2026
1267e5d
fix(ohos): address 8 CodeRabbit review suggestions from round 2
May 17, 2026
f8c9339
fix(ohos): address 2 CodeRabbit review suggestions from round 3
May 17, 2026
086a08e
fix(ohos): add missing existsSync import in webkit.ts
May 17, 2026
03ae110
fix(ohos): fix zstd qsort_r patch corruption from CodeRabbit edit
May 17, 2026
d64cd7c
fix(ci): fix WebKit checkout reference path
May 18, 2026
e1d25b0
Merge branch 'main' into pr/ohos-platform-support
springmin May 19, 2026
7a5e55c
Merge upstream/main (35 commits) into ohos-aarm64
May 20, 2026
f3f7a02
Merge upstream/main (36 more commits) into ohos-aarm64
May 20, 2026
b92b8f9
ci(ohos): optimize WebKit cache key, fix sync step push command
May 20, 2026
a0f2112
Merge branch 'main' into pr/ohos-platform-support
springmin May 20, 2026
da6666d
Sync pr/ohos-platform-support with ohos-aarm64
May 20, 2026
be4b335
Merge branch 'main' into pr/ohos-platform-support
springmin May 20, 2026
252a797
Merge upstream/main (10 more commits) into ohos-aarm64
May 20, 2026
961f993
fix(test): remove outdated .failing on double-connect (upstream fixed)
May 20, 2026
bd3ad3c
Merge pr/ohos-platform-support into ohos-aarm64
May 20, 2026
a72c1d7
fix(ohos): adapt CloseOnDrop::file removal to upstream RAII File
May 20, 2026
25cee2d
fix(ohos): fix zstd patch corruption re-introduced by PR branch merge
May 20, 2026
9c72310
Merge branch 'main' into pr/ohos-platform-support
springmin May 20, 2026
3cfe305
fix(ohos): resolve merge conflicts in src/sys/{lib,linux_syscall}.rs
May 20, 2026
2a2d697
Merge pr/ohos-platform-support (maintainer updates) into ohos-aarm64
May 20, 2026
a23f4a8
Merge upstream/main (3 commits: clippy, FileSink, lexer) into ohos-aa…
May 21, 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
215 changes: 215 additions & 0 deletions .github/workflows/ohos-build-incremental.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Bun OHOS Incremental Build CI
#
# Uses persistent self-hosted runner workspace + ccache + zig cache for
# near-instant incremental rebuilds. Typically completes in 1-3 minutes
# for small changes (vs 30-60 min for a full clean build).
#
# Principles:
# - Workspace persists between runs (self-hosted runner never cleans it)
# - ninja's depfile + ccache handle C++ incrementality automatically
# - zig's own cache handles zig incrementality
# - Only reconfigure when build scripts change
# - WebKit build cached separately (only rebuilds on version change)
#
# Trigger: manual (workflow_dispatch) or push to ohos-aarm64

name: OHOS Build (incremental)

on:
push:
branches:
- ohos-aarm64
paths-ignore:
- 'docs/**'
- '**.md'
- 'test/**'
workflow_dispatch:

concurrency:
group: ohos-build-incr-${{ github.ref }}
cancel-in-progress: true

env:
OHOS_SDK_ROOT: /home/user/setup-ohos-sdk
OHOS_SYSROOT: /home/user/setup-ohos-sdk/ohos/native/sysroot
OHOS_CROSS_LIBS: /home/user/sources/bun/build/ohos-cross-libs
OHOS_ICU_DIR: /home/user/sources/bun/build/ohos-icu/target
NINJA_JOBS: 2
WEBKIT_FORK: springmin/WebKit
WEBKIT_REF: ohos-aarch64

jobs:
build:
name: Incremental Build OHOS
runs-on: [self-hosted, Linux, ARM64]
timeout-minutes: 60 # incremental builds are fast

steps:
- name: Checkout Bun source (incremental — preserve workspace)
uses: actions/checkout@v4
with:
repository: springmin/bun
ref: ohos-aarm64
fetch-depth: 1
# Do NOT clean — keep build artifacts for incremental rebuild
clean: false

- name: Restore zig compiler from local cache
run: |
rm -rf vendor/zig
if [ -d /home/user/sources/bun/vendor/zig ]; then
cp -a /home/user/sources/bun/vendor/zig vendor/zig
echo "✅ Copied zig from local build"
else
echo "⚠️ No local zig found, will download during build"
fi

- name: Checkout/update WebKit fork
run: |
if [ -d vendor/WebKit/.git ]; then
# Clean stale lock files from cancelled runs
rm -f vendor/WebKit/.git/shallow.lock vendor/WebKit/.git/index.lock
cd vendor/WebKit
git fetch origin ${{ env.WEBKIT_REF }} --depth=1
git checkout -f FETCH_HEAD
echo "✅ WebKit updated incrementally"
else
rm -rf vendor/WebKit
git clone --depth 1 --branch ${{ env.WEBKIT_REF }} \
https://github.com/${{ env.WEBKIT_FORK }}.git vendor/WebKit
echo "✅ WebKit cloned fresh"
fi

- name: WebKit version sync check
run: |
WK_HASH=$(grep "^export const WEBKIT_VERSION" scripts/build/deps/webkit.ts | grep -oE '[a-f0-9]{40}')
echo "scripts/build/deps/webkit.ts pins: $WK_HASH"
if git -C vendor/WebKit cat-file -e "${WK_HASH}" 2>/dev/null; then
echo "✅ vendor/WebKit already contains ${WK_HASH}"
else
echo "⚠️ vendor/WebKit missing ${WK_HASH} — trying to fetch..."
cd vendor/WebKit
git remote add upstream https://github.com/oven-sh/WebKit.git 2>/dev/null || true
git fetch upstream main --depth=100 2>/dev/null || echo "⚠️ Fetch failed (network), continuing anyway"
if git cat-file -e "${WK_HASH}" 2>/dev/null; then
git push origin origin/main:ohos-aarch64 2>/dev/null || true
echo "✅ Fork synced to ${WK_HASH}"
else
echo "⚠️ Cannot verify commit ${WK_HASH} in fork. Build will continue."
fi
fi

- name: Setup environment
run: |
echo "OHOS_SDK_ROOT=${{ env.OHOS_SDK_ROOT }}" >> $GITHUB_ENV
echo "OHOS_SYSROOT=${{ env.OHOS_SYSROOT }}" >> $GITHUB_ENV
echo "OHOS_CROSS_LIBS=${{ env.OHOS_CROSS_LIBS }}" >> $GITHUB_ENV
echo "OHOS_ICU_DIR=${{ env.OHOS_ICU_DIR }}" >> $GITHUB_ENV
test -d "$OHOS_SDK_ROOT" || { echo "OHOS SDK not found"; exit 1; }
mkdir -p build
[ -L build/ohos-cross-libs ] && [ "$(readlink build/ohos-cross-libs)" = "$OHOS_CROSS_LIBS" ] || ln -sfn "$OHOS_CROSS_LIBS" build/ohos-cross-libs
[ -L build/ohos-icu ] && [ "$(readlink build/ohos-icu)" = "$(dirname $OHOS_ICU_DIR)" ] || ln -sfn "$(dirname $OHOS_ICU_DIR)" build/ohos-icu
test -d build/ohos-cross-libs/libcxx/lib || { echo "Cross libs not found"; exit 1; }
test -d build/ohos-icu/target/lib || { echo "ICU not found"; exit 1; }

- name: Sync test files to shared directory
run: |
SHARE=/mnt/linux_share/ci-test/all-tests
mkdir -p $SHARE/test
find test/ -type f \( \
-name "*.test.ts" -o -name "*.test.tsx" -o -name "*.test.js" -o -name "*.test.jsx" \
-o -name "*.spec.ts" -o -name "*.spec.tsx" -o -name "*.spec.js" -o -name "*.spec.jsx" \
-o -name "*.test.mjs" -o -name "*.test.cjs" -o -name "*.spec.mjs" -o -name "*.spec.cjs" \
-o -name "*.test.mts" -o -name "*.test.cts" -o -name "*.spec.mts" -o -name "*.spec.cts" \) \
-exec sh -c 'd="$0/$(dirname "{}")"; mkdir -p "$d" && cp "{}" "$d/"' "$SHARE" \; 2>/dev/null || true
echo "✅ Test files synced"

- name: Restore ccache from persistent storage
run: |
CCACHE_DIR="$HOME/.cache/ccache-ohos"
mkdir -p "$CCACHE_DIR"
echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
echo "CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=4G" >> $GITHUB_ENV
# Link local build cache to speed up first run
if [ -d /home/user/.cache/ccache ] && [ ! -f "$CCACHE_DIR/initialized" ]; then
cp -a /home/user/.cache/ccache/* "$CCACHE_DIR/" 2>/dev/null || true
touch "$CCACHE_DIR/initialized"
echo "✅ Pre-seeded ccache from local build"
fi
ccache -s 2>&1 | grep -E "Cache size|Hits|Misses"

- name: Restore zig build cache from persistent storage
run: |
ZIG_CACHE="$HOME/.cache/zig-ohos"
mkdir -p "$ZIG_CACHE"
echo "ZIG_GLOBAL_CACHE_DIR=$ZIG_CACHE" >> $GITHUB_ENV
if [ -d /home/user/.bun/build-cache/zig/global ] && [ ! -f "$ZIG_CACHE/initialized" ]; then
cp -a /home/user/.bun/build-cache/zig/global/* "$ZIG_CACHE/" 2>/dev/null || true
touch "$ZIG_CACHE/initialized"
echo "✅ Pre-seeded zig cache from local build"
fi

- name: Configure Bun build (incremental — only regen build.ninja)
run: |
bun run build:release \
--os=ohos \
--arch=aarch64 \
--webkit=local \
--build-dir=build/release-ohos \
--ohos-sysroot=$OHOS_SYSROOT \
--configure-only
env:
CI: true

- name: Build Bun (incremental — ninja skips unchanged targets)
run: |
ninja -C build/release-ohos bun -j$NINJA_JOBS
echo "✅ Incremental build complete"

- name: Verify binary
run: |
file build/release-ohos/bun
ls -lh build/release-ohos/bun
file build/release-ohos/bun | grep -q "ELF.*ARM aarch64" || {
echo "ERROR: Not an ARM64 ELF binary"
exit 1
}
echo "✅ Binary validation passed"

- name: Package binary
run: |
VERSION=$(build/release-ohos/bun --version 2>/dev/null || echo "1.3.14")
COMMIT=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d_%H%M%S)
NAME="bun-ohos-aarch64-incr-${VERSION}-${COMMIT}-${DATE}"
mkdir -p /tmp/bun-release/${NAME}
cp build/release-ohos/bun /tmp/bun-release/${NAME}/bun
cd /tmp/bun-release
tar czf ${NAME}.tar.gz ${NAME}/
echo "artifact_name=${NAME}" >> $GITHUB_ENV
echo "artifact_path=/tmp/bun-release/${NAME}.tar.gz" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: ${{ env.artifact_path }}
retention-days: 14

- name: Upload binary (raw)
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}.bun
path: build/release-ohos/bun
retention-days: 14

- name: Copy to shared directory
run: |
SHARE=/mnt/linux_share/ci-test
mkdir -p $SHARE
cp build/release-ohos/bun $SHARE/bun-ohos-incr-${{ env.artifact_name }}.elf
echo "✅ Copied to $SHARE/bun-ohos-incr-${{ env.artifact_name }}.elf"

- name: Print ccache stats
run: ccache -s
Loading