Skip to content

Commit 331de58

Browse files
authored
Tudor/debug wasm (#27)
* map local folder as readonly inside docker, use copy such that the output of the build will not polute the host * fixes * remove code optimization flag when building debug variant * link dir such that when debugging expected pglite-wasm folder (symlink) points to the right place * add debug doc * moved DEBUGGING doc to pglite project
1 parent 7a7c244 commit 331de58

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ lib*.pc
5454
/pglite/dist/**
5555
/pglite/patches
5656
/patches/
57-
/dist/pglite
57+
/dist/pglite
58+
/dist

pglite-wasm

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./pglite-REL_17_4_WASM

wasm-build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export PGUSER=${PGUSER:-postgres}
4040

4141
if $DEBUG
4242
then
43-
export COPTS=${COPTS:-"-O2 -g3"}
44-
export LOPTS=${LOPTS:-"-O2 -g3 --no-wasm-opt -sASSERTIONS=1"}
43+
export COPTS=${COPTS:-"-g3"}
44+
export LOPTS=${LOPTS:-"-g3 --no-wasm-opt -sASSERTIONS=1"}
4545
else
4646
# DO NOT CHANGE COPTS - optimized wasm corruption fix
4747
export COPTS=${COPTS:-"-O2 -g3 --no-wasm-opt"}
@@ -432,7 +432,7 @@ fi
432432
# only build extra when targeting pglite-wasm .
433433

434434
# TODO link the good tag
435-
ln -s ${WORKSPACE}/pglite-REL_17_4_WASM ${WORKSPACE}/pglite-wasm
435+
ln -s ${WORKSPACE}/pglite-REL_17_4_WASM ${WORKSPACE}/pglite-wasm || true
436436

437437
if [ -f ${WORKSPACE}/pglite-wasm/build.sh ]
438438
then

wasm-build/build-with-docker.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cat .buildconfig
2222
docker run \
2323
--rm \
2424
--env-file .buildconfig \
25-
-v .:/workspace:rw \
25+
-v .:/tmp-workspace:ro \
2626
-v ./dist:/tmp/sdk/dist:rw \
2727
$IMG_NAME:$IMG_TAG \
28-
bash -c "source ${SDKROOT}/wasm32-bi-emscripten-shell.sh && ./wasm-build.sh ${WHAT:-\"contrib extra\"}"
28+
bash -c "cp -r /tmp-workspace/. /workspace && cd /workspace && source ${SDKROOT}/wasm32-bi-emscripten-shell.sh && ./wasm-build.sh ${WHAT:-\"contrib extra\"}"

0 commit comments

Comments
 (0)