Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add -s STRICT=1 flag emscripten build #296

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcbarton
Copy link
Collaborator

Description

Please include a summary of changes, motivation and context for this PR.

Taken from Emscripten documentation here https://emscripten.org/docs/tools_reference/settings_reference.html

Emscripten ‘strict’ build mode: Drop supporting any deprecated build options. Set the environment variable EMCC_STRICT=1 or pass -sSTRICT to test that a codebase builds nicely in forward compatible manner. Changes enabled by this:

        The C define EMSCRIPTEN is not defined (__EMSCRIPTEN__ always is, and is the correct thing to use).

        STRICT_JS is enabled.

        IGNORE_MISSING_MAIN is disabled.

        AUTO_JS_LIBRARIES is disabled.

        AUTO_NATIVE_LIBRARIES is disabled.

        DEFAULT_TO_CXX is disabled.

        USE_GLFW is set to 0 rather than 2 by default.

        ALLOW_UNIMPLEMENTED_SYSCALLS is disabled.

        INCOMING_MODULE_JS_API is set to empty by default.

Making sure the Emscripten build is done in such a way as to be forward compatible feels like a good feature to have.

Fixes # (issue)

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Added/removed dependencies
  • Required documentation updates

@mcbarton mcbarton requested review from vgvassilev and anutosh491 May 12, 2025 19:30
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.78%. Comparing base (3c5328d) to head (ba47df0).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #296   +/-   ##
=======================================
  Coverage   81.78%   81.78%           
=======================================
  Files          20       20           
  Lines         950      950           
  Branches       87       87           
=======================================
  Hits          777      777           
  Misses        173      173           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -441,6 +441,8 @@ if(EMSCRIPTEN)
PUBLIC "SHELL: --preload-file ${XEUS_CPP_DATA_DIR}@/share/xeus-cpp"
PUBLIC "SHELL: --preload-file ${XEUS_CPP_CONF_DIR}@/etc/xeus-cpp"
PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_SOURCE_DIR}/wasm_patches/post.js"
PUBLIC "SHELL: -s STRICT=1"
PUBLIC "SHELL: --no-entry"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This --no-entry flag is to deal with the error here https://github.com/compiler-research/xeus-cpp/pull/296/checks?sha=4042234c05975b3bb37749ddd2cb6be932e4a638#step:5:167 , which comes after we make our build have strict=1 (e.g. have forwards compatibility)

@mcbarton mcbarton force-pushed the Add-strict-flag-emscripten-build branch from fc9aead to ba47df0 Compare May 12, 2025 19:55
@anutosh491
Copy link
Collaborator

Hi,

Xeus-cpp's interpreter is based on xeus' xinterpreter, so we don't add flags directly here unless they are xeus-cpp specific (like the preloads). You should raise a PR for any generic flag here https://github.com/jupyter-xeus/xeus/blob/main/cmake/WasmBuildOptions.cmake#L21-L40 as these flags are propagated through this line

xeus_wasm_link_options(xcpp "web,worker")

@mcbarton mcbarton marked this pull request as draft May 13, 2025 07:51
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