Skip to content

Commit de612f8

Browse files
committed
Use Joel's test build of WASI-SDK with dylib support for building the engine
1 parent 6c6b39d commit de612f8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
run: |
3232
mkdir dist
3333
sudo apt-get update -y
34+
wget https://github.com/dicej/wasi-sdk/releases/download/filesystem-fix-v3/wasi-sdk-20.25g964191c91aac-linux.tar.gz
35+
tar -xvf wasi-sdk-20.25g964191c91aac-linux.tar.gz
36+
export WASI_SDK_PREFIX=$PWD/wasi-sdk-20.25g964191c91aac
3437
bash ./build-engine.sh release
3538
tar -a -cf dist/spidermonkey-wasm-static-lib_release.tar.gz release
3639
rm -rf release obj-release

build-engine.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ if [[ ! -a gecko-dev ]]; then
8282
origin "$(cat "$script_dir/gecko-repository")"
8383

8484
fetch_commits=1
85+
else
8586
fi
8687

8788
target_rev="$(cat "$script_dir/gecko-revision")"
8889
if [[ -n "$fetch_commits" ]] || \
8990
[[ "$(git -C gecko-dev rev-parse HEAD)" != "$target_rev" ]]; then
9091
git -C gecko-dev fetch --depth 1 origin "$target_rev"
9192
git -C gecko-dev checkout FETCH_HEAD
93+
else
9294
fi
9395

9496
# Use Gecko's build system bootstrapping to ensure all dependencies are
@@ -110,6 +112,15 @@ python3 \
110112

111113
cd "$working_dir"
112114

115+
if [[ -z "${WASI_SDK_PREFIX}" ]]; then
116+
echo "WASI_SDK_PREFIX not set, using default compiler and sysroot"
117+
else
118+
mv ~/.mozbuild/clang ~/.mozbuild/clang.orig
119+
mv ~/.mozbuild/sysroot-wasm32-wasi ~/.mozbuild/sysroot-wasm32-wasi.orig
120+
ln -s "${WASI_SDK_PREFIX}" ~/.mozbuild/clang
121+
ln -s "${WASI_SDK_PREFIX}/share/wasi-sysroot" ~/.mozbuild/sysroot-wasm32-wasi
122+
fi
123+
113124
# Build SpiderMonkey for WASI
114125
MOZCONFIG="${mozconfig}" \
115126
MOZ_FETCHES_DIR=~/.mozbuild \

0 commit comments

Comments
 (0)