Skip to content

Commit 5d4ac6f

Browse files
tdrztudorpmp-p
authored
build wasm with expected file paths; disable optimizations when build… (#32)
* build wasm with expected file paths; disable optimizations when building in DEBUG * mention why no -O0 * why change default /workspace to source path --------- Co-authored-by: tudor <tudor@swisstch.com> Co-authored-by: Paul m. p. Peny <mail.peny@free.fr>
1 parent a57e95e commit 5d4ac6f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

wasm-build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ else
6464
BUILD=emscripten
6565
if $DEBUG
6666
then
67-
export COPTS="-O2 -g3 --no-wasm-opt"
68-
export LOPTS=${LOPTS:-"-O2 -g3 --no-wasm-opt -sASSERTIONS=1"}
67+
# clang default to O0 but specifying -O0 may trigger memory start address bug in emsdk
68+
export COPTS="-g3 --no-wasm-opt"
69+
export LOPTS=${LOPTS:-"-g3 --no-wasm-opt -sASSERTIONS=1"}
6970
else
7071
# DO NOT CHANGE COPTS - optimized wasm corruption fix
7172
export COPTS="-O2 -g3 --no-wasm-opt"

wasm-build/build-with-docker.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ IMG_TAG="17.4_3.1.61.7bi"
99

1010
export WORKSPACE=${GITHUB_WORKSPACE:-$(pwd)}
1111

12+
# normally would default to /workspace but that may cause trouble with debug paths in some IDE
13+
export DOCKER_WORKSPACE=${DOCKER_WORKSPACE:-$WORKSPACE}
14+
1215
cd $(realpath ${WORKSPACE}/postgres-pglite)
1316

1417
[ -f ${BUILD_CONFIG:-postgres-pglite}/.buildconfig ] && cp ${BUILD_CONFIG:-postgres-pglite}/.buildconfig .buildconfig
@@ -32,8 +35,8 @@ fi
3235
docker run $@ \
3336
--rm \
3437
--env-file .buildconfig \
35-
--workdir=/workspace \
36-
-v ${WORKSPACE}/postgres-pglite:/workspace:rw \
38+
--workdir=${DOCKER_WORKSPACE} \
39+
-v ${WORKSPACE}/postgres-pglite:${DOCKER_WORKSPACE}:rw \
3740
-v ${WORKSPACE}/postgres-pglite/dist:/tmp/sdk/dist:rw \
3841
$IMG_NAME:$IMG_TAG \
3942
bash --noprofile --rcfile ${SDKROOT}/wasm32-bi-emscripten-shell.sh -ci "( ./wasm-build.sh ${WHAT:-\"contrib extra\"} $PROMPT"

0 commit comments

Comments
 (0)