Skip to content

Updates to build-emscripten script #1224

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

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

EzraH442
Copy link
Contributor

@EzraH442 EzraH442 commented Jul 5, 2024

This PR fixes some issues related to the build-emscripten.sh script and adds some more options. Specifically:

  • updates the script and CI to use emscripten v3.1.61 (from 3.1.47)
  • updates the libde265 version of the emscripten script to 1.0.15 (from 1.0.12)
  • adds an option to generate typescript definitions when not making a standalone build (enabled by default)
  • fixes some path issues when building from inside a directory that is not the source dir (causes the issue here: Build error file not found #1151)
  • adds an option to disable dynamic execution to avoid 'unsafe-eval' csp errors (referenced by Refused to evaluate a string as JavaScript because 'unsafe-eval' #173)

I chose to enable the generation of typescript definitions by default (for non-standalone builds) to make the library be more user-friendly for JS users so that they don't need to do as much digging into the libheif source code to figure out things like what functions are exported in the module and function signatures.

EzraH442 added 4 commits July 5, 2024 09:32
…n.sh

Currently when running the build-emscripten.sh script from another
directory (as the script suggests) the base path for libde265 set in
$LIBARY_LINKER_FLAGS and $LIBRARY_INCLUDE_FLAGS for get set to
(if the src dir of the project is / and the build dir is /buildjs)
/libde265-1.0.12 instead of /buildjs/libde265-1.0.12. This causes
the compiler to fail to find libde265.

This isn't caught in ./scripts/run-ci.sh because the script (on line 246)
has "source ./emscripten/emsdk/emsdk_env.sh && USE_WASM=0 ./build-emscripten.sh ."
using the same directory as both the source directory and the build directory.

make the same fixes for aom
The --memory-init-file emcc flag was removed in version 3.1.55 so it has
to be removed. Another emscripten option to generate typescript definitions
was also added so this is added to the build-emscripten script.
@farindk farindk merged commit 0d56f46 into strukturag:master Jul 8, 2024
35 checks passed
@farindk
Copy link
Contributor

farindk commented Jul 8, 2024

Thank you!

@thomas5280
Copy link

Thank you! Would you be able to provide release assets with dynamic execution disabled? I'll be happy to test and provide some validation in that ongoing thread.

Would be amazing if we could update the HTML/web-based demo with this

@thomas5280
Copy link

@farindk see new flag in this updated build script here including USE_UNSAFE_EVAL param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants