Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript: Re-enable build for 4.0 now that WebGL 2 works #62

Merged
merged 1 commit into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions build-javascript/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
# Config

export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
export OPTIONS="production=yes"
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes mono_prefix=/root/mono-installs/wasm-runtime-release use_lto=no"
export OPTIONS="production=yes use_thinlto=yes"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Faless We'd have to do a proper benchmark but I think using ThinLTO for the Web platform would be better than (full) LTO. Clang/Emscripten's full LTO is single thread and just takes hours despite running on a ThreadRipper. While ThinLTO is multithreaded and takes minutes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As seen in #66 this isn't the best option in the end so I'm reverting this change in #67.

export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes mono_prefix=/root/mono-installs/wasm-runtime-release use_lto=no use_thinlto=no"
export TERM=xterm

rm -rf godot
Expand All @@ -24,17 +24,14 @@ if [ "${CLASSICAL}" == "1" ]; then
$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no
$SCONS platform=javascript ${OPTIONS} target=release tools=no

$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no threads_enabled=yes
$SCONS platform=javascript ${OPTIONS} target=release tools=no threads_enabled=yes

$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no gdnative_enabled=yes
$SCONS platform=javascript ${OPTIONS} target=release tools=no gdnative_enabled=yes

mkdir -p /root/out/templates
cp -rvp bin/*.zip /root/out/templates
rm -f bin/*.zip

$SCONS platform=javascript ${OPTIONS} target=release_debug tools=yes threads_enabled=yes use_closure_compiler=yes
$SCONS platform=javascript ${OPTIONS} target=release_debug tools=yes use_closure_compiler=yes

mkdir -p /root/out/tools
cp -rvp bin/*.zip /root/out/tools
Expand Down
31 changes: 14 additions & 17 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,20 @@ if [ "${build_classical}" == "1" ]; then
rm -rf macos_template.app
sign_macos_template ${templatesdir} 0

# ## Javascript (Classical) ##
#
# # Editor
# unzip out/javascript/tools/godot.javascript.opt.tools.threads.zip -d ${webdir}/
# brotli --keep --force --quality=11 ${webdir}/*
# binname="${godot_basename}_web_editor.zip"
# cp out/javascript/tools/godot.javascript.opt.tools.threads.zip ${reldir}/${binname}
#
# # Templates
# cp out/javascript/templates/godot.javascript.opt.zip ${templatesdir}/webassembly_release.zip
# cp out/javascript/templates/godot.javascript.opt.debug.zip ${templatesdir}/webassembly_debug.zip
#
# cp out/javascript/templates/godot.javascript.opt.threads.zip ${templatesdir}/webassembly_threads_release.zip
# cp out/javascript/templates/godot.javascript.opt.debug.threads.zip ${templatesdir}/webassembly_threads_debug.zip
#
# cp out/javascript/templates/godot.javascript.opt.gdnative.zip ${templatesdir}/webassembly_gdnative_release.zip
# cp out/javascript/templates/godot.javascript.opt.debug.gdnative.zip ${templatesdir}/webassembly_gdnative_debug.zip
## Javascript (Classical) ##

# Editor
unzip out/javascript/tools/godot.javascript.opt.tools.threads.zip -d ${webdir}/
brotli --keep --force --quality=11 ${webdir}/*
binname="${godot_basename}_web_editor.zip"
cp out/javascript/tools/godot.javascript.opt.tools.threads.zip ${reldir}/${binname}

# Templates
cp out/javascript/templates/godot.javascript.opt.threads.zip ${templatesdir}/webassembly_threads_release.zip
cp out/javascript/templates/godot.javascript.opt.debug.threads.zip ${templatesdir}/webassembly_threads_debug.zip

cp out/javascript/templates/godot.javascript.opt.gdnative.threads.zip ${templatesdir}/webassembly_gdnative_threads_release.zip
cp out/javascript/templates/godot.javascript.opt.debug.gdnative.threads.zip ${templatesdir}/webassembly_gdnative_threads_debug.zip
Comment on lines +257 to +261
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we now only supports threads enabled, the _threads suffix might be redundant? The _gdnative one should likely also be updated to match GDExtension. And I guess the Regular and GDNative without Threads export options should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved in #67.


## Android (Classical) ##

Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ ${podman_run} -v ${basedir}/build-windows:/root/build -v ${basedir}/out/windows:
mkdir -p ${basedir}/out/linux
${podman_run} -v ${basedir}/build-linux:/root/build -v ${basedir}/out/linux:/root/out localhost/godot-linux:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/linux

#mkdir -p ${basedir}/out/javascript
#${podman_run} -v ${basedir}/build-javascript:/root/build -v ${basedir}/out/javascript:/root/out localhost/godot-javascript:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/javascript
mkdir -p ${basedir}/out/javascript
${podman_run} -v ${basedir}/build-javascript:/root/build -v ${basedir}/out/javascript:/root/out localhost/godot-javascript:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/javascript

mkdir -p ${basedir}/out/macos
${podman_run} -v ${basedir}/build-macos:/root/build -v ${basedir}/out/macos:/root/out -v ${basedir}/deps/vulkansdk-macos:/root/vulkansdk localhost/godot-osx:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/macos
Expand Down