Skip to content

Commit 4b2b395

Browse files
committed
Support using debug and release builds side-by-side
Specifically, by moving the `lib` and `include` directories into `debug` and `release` directories which can coexist. This is a breaking change that requires adapting embedding build scripts.
1 parent 208d747 commit 4b2b395

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
run: |
3232
mkdir dist
3333
bash ./build-engine.sh release
34-
tar -a -cf dist/spidermonkey-wasm-static-lib_release.tar.gz include lib
35-
rm -rf include lib obj
34+
tar -a -cf dist/spidermonkey-wasm-static-lib_release.tar.gz release
35+
rm -rf release obj-release
3636
bash ./build-engine.sh debug
37-
tar -a -cf dist/spidermonkey-wasm-static-lib_debug.tar.gz include lib
37+
tar -a -cf dist/spidermonkey-wasm-static-lib_debug.tar.gz debug
3838
3939
- name: Calculate tag name
4040
run: |

build-engine.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,27 @@ python3 \
4343

4444
cd ${working_dir}
4545

46+
mode="release"
4647
flags="--optimize --no-debug --build-only"
47-
rust_lib_dir="release"
4848
if [[ $1 == 'debug' ]]
4949
then
50+
mode="debug"
5051
flags="--optimize --debug"
51-
rust_lib_dir="debug"
5252
fi
53+
rust_lib_dir=$mode
54+
objdir=obj-$mode
55+
outdir=$mode
5356

5457
echo $flags $rust_lib_dir
5558

5659
# Build SpiderMonkey for WASI
57-
MOZ_FETCHES_DIR=~/.mozbuild CC=~/.mozbuild/clang/bin/clang gecko-dev/js/src/devtools/automation/autospider.py --objdir=obj $flags wasi
60+
MOZ_FETCHES_DIR=~/.mozbuild CC=~/.mozbuild/clang/bin/clang gecko-dev/js/src/devtools/automation/autospider.py --objdir=$objdir $flags wasi
5861

5962
# Copy header, object, and static lib files
60-
rm -rf lib include
61-
mkdir lib
63+
rm -rf $outdir
64+
mkdir -p $outdir/lib
6265

63-
cd obj
64-
cp -Lr dist/include ..
65-
cp $(cat $script_dir/object-files.list) ../lib
66-
cp js/src/build/libjs_static.a wasm32-wasi/${rust_lib_dir}/libjsrust.a ../lib
66+
cd $objdir
67+
cp -Lr dist/include ../$outdir
68+
cp $(cat $script_dir/object-files.list) ../$outdir/lib
69+
cp js/src/build/libjs_static.a wasm32-wasi/${rust_lib_dir}/libjsrust.a ../$outdir/lib

0 commit comments

Comments
 (0)