Skip to content

Commit 805749f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into rpath-nested-deps
2 parents b86e1f0 + db8daf9 commit 805749f

File tree

2,382 files changed

+113569
-39130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,382 files changed

+113569
-39130
lines changed

.circleci/ccache.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
debug = true
2+
debug_level = 1
3+
compiler_check = none

.circleci/config.yml

Lines changed: 287 additions & 101 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature deprecation
3+
about: Use this template for removal of features from emscripten.
4+
title: 'Deprecation proposal for <FEATURE>'
5+
labels: 'deprecation'
6+
assignees: ''
7+
8+
---
9+
10+
Tracking issue for the deprecation and removal of <FEATURE>.
11+
12+
The process for deprecating and removing features from emscripten is laid out out in https://github.com/emscripten-core/emscripten/blob/main/docs/process.md#deprecating-settings-and-features.
13+
14+
At any point in the process we may decide to delay or abort the deprecation and close this issue.
15+
16+
Deprecation checklist:
17+
18+
- [ ] Open an issue (this)
19+
- [ ] Perform global search for usage in public repos
20+
- [ ] Send message to emscripten-discuss
21+
- [ ] Add "deprecation" warning to emcc
22+
- [ ] Wait at least 4 releases or 2 months
23+
- [ ] Remove feature from codebase

.github/workflows/ci.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
name: emscripten-${{ env.VERSION }}
2828
path: emscripten-${{ env.VERSION }}.tar.bz2
2929

30-
check-expectations:
31-
name: Check Expectations
30+
codesize-checks:
31+
name: Codesize Checks
3232
runs-on: ubuntu-latest
3333
if: github.event_name == 'pull_request'
3434
steps:
@@ -45,30 +45,41 @@ jobs:
4545
- name: Install emsdk
4646
run: |
4747
EM_CONFIG=$HOME/emsdk/.emscripten
48-
echo $EM_CONFIG
48+
echo "emscripten config file: $EM_CONFIG"
4949
echo "EM_CONFIG=$EM_CONFIG" >> $GITHUB_ENV
5050
curl -# -L -o ~/emsdk-main.tar.gz https://github.com/emscripten-core/emsdk/archive/main.tar.gz
5151
tar -C ~ -xf ~/emsdk-main.tar.gz
5252
mv ~/emsdk-main ~/emsdk
5353
cd ~/emsdk
5454
./emsdk install tot
5555
./emsdk activate tot
56-
echo "JS_ENGINES = [NODE_JS]" >> $EM_CONFIG
57-
echo "final config:"
56+
echo "emscripten config file ($EM_CONFIG) contents:"
5857
cat $EM_CONFIG
5958
- name: Check test expectations on target branch
59+
# Skip this step for rebaseline PRs, since the target branch is expected
60+
# to be out of date in this case.
61+
if: "!contains(github.event.pull_request.title, 'Automatic rebaseline of codesize expectations')"
6062
run: |
6163
echo "Checking out ${{ github.base_ref }}"
6264
git checkout ${{ github.base_ref }}
6365
git rev-parse HEAD
64-
# Hack to honor changes to rebaseline_tests.py in the current PR
65-
git checkout - ./tools/maint/rebaseline_tests.py
66+
# Uncomment this like to pull the rebaseline_tests.py from the
67+
# current branch:
68+
# git checkout - ./tools/maint/rebaseline_tests.py
6669
./bootstrap
6770
if ! ./tools/maint/rebaseline_tests.py --check-only; then
71+
echo ""
6872
echo "Test expectations are out-of-date on the target branch."
69-
echo "You can run './tools/maint/rebaseline_tests.py --new-branch'"
70-
echo "and use it to create a seperate PR."
71-
echo "-- This failure is only a warning and can be ignored"
73+
echo "Please run the 'Rebaseline Tests' github action on the target"
74+
echo "branch (normally 'main') before proceeding. You can do this"
75+
echo "from the web UI or from the command line:"
76+
echo ""
77+
echo " gh workflow run rebaseline-tests.yml"
78+
echo ""
79+
echo "You can also run the following command locally and upload"
80+
echo "your own PR:"
81+
echo ""
82+
echo " ./tools/maint/rebaseline_tests.py --new-branch'"
7283
exit 1
7384
fi
7485
- name: Check test expectations on PR branch
@@ -83,7 +94,7 @@ jobs:
8394
echo "Test expectations are out-of-date on the PR branch."
8495
echo "You can run './tools/maint/rebaseline_tests.py' to"
8596
echo "create a commit updating the expectations."
86-
echo "Be sure to have `emsdk install tot` first."
97+
echo "Be sure to have 'emsdk install tot' first."
8798
echo "-- This failure is only a warning and can be ignored"
8899
exit 1
89100
fi

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ jobs:
5252

5353
# Upload the results to GitHub's code scanning dashboard.
5454
- name: "Upload to code-scanning"
55-
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
55+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
5656
with:
5757
sarif_file: results.sarif

.gitignore

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,52 @@ coverage.xml
3030
# Test output
3131
/out/
3232

33-
# All the ps1 files are generated by bootstrap...
33+
# Windows ps1 launchers (created by ./tools/maint/create_entry_points.py)
3434
*.ps1
3535
# ...except the templates.
3636
!/tools/run_python.ps1
3737
!/tools/run_python_compiler.ps1
38+
39+
# Shell scripts (created by ./tools/maint/create_entry_points.py)
40+
em-config
41+
emar
42+
embuilder
43+
emcmake
44+
emconfigure
45+
emdump
46+
emdwp
47+
emmake
48+
emnm
49+
empath-split
50+
emprofile
51+
emranlib
52+
emrun
53+
emscan-deps
54+
emscons
55+
emsize
56+
emstrip
57+
emsymbolizer
58+
tools/file_packager
59+
tools/webidl_binder
60+
61+
# Windows .bat files (created by ./tools/maint/create_entry_points.py)
62+
em-config.bat
63+
emar.bat
64+
embuilder.bat
65+
emcmake.bat
66+
emconfigure.bat
67+
emdump.bat
68+
emdwp.bat
69+
emmake.bat
70+
emnm.bat
71+
empath-split.bat
72+
emprofile.bat
73+
emranlib.bat
74+
emrun.bat
75+
emscan-deps.bat
76+
emscons.bat
77+
emsize.bat
78+
emstrip.bat
79+
emsymbolizer.bat
80+
tools/file_packager.bat
81+
tools/webidl_binder.bat

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,3 +601,4 @@ a license to everyone to use it as detailed in LICENSE.)
601601
* Artur Gatin <[email protected]> (copyright owned by Teladoc Health, Inc.)
602602
* Christian Lloyd <[email protected]> (copyright owned by Teladoc Health, Inc.)
603603
* Sean Morris <[email protected]>
604+
* Mitchell Wills <[email protected]> (copyright owned by Google, Inc.)

ChangeLog.md

Lines changed: 178 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,175 @@ to browse the changes between the tags.
1818

1919
See docs/process.md for more on how version tagging works.
2020

21-
4.0.10 (in development)
22-
----------------------
21+
4.0.20 (in development)
22+
-----------------------
23+
24+
4.0.19 - 11/04/25
25+
-----------------
26+
- The `RETAIN_COMPILER_SETTINGS` setting and the corresponding
27+
`emscripten_get_compiler_setting` API no longer store or report internal
28+
compiler settings (those listed in `setttings_internal.js`). We made an
29+
exception here for `EMSCRIPTEN_VERSION` which is the only internal setting
30+
where we could find usage of `emscripten_get_compiler_setting` (in a global
31+
GitHub search). (#25667)
32+
- When using dynamic linking the main module is no longer built as a relocatable
33+
binary. This will significantly reduce the overhead of dynamic linking for
34+
the main program, for example, eliminating all internal relocations. If you
35+
encounter any issues with new default it is possible to revert to the old
36+
behaviour by adding `-sRELOCATABLE` when linking the main module. (#25522)
37+
38+
4.0.18 - 10/24/25
39+
-----------------
40+
- The `emrun.py` script no longer support running on python2. (#25597)
41+
- `-sUSE_WEBGPU` was removed in favor of the external port Emdawnwebgpu which
42+
are used via `--use-port=emdawnwebgpu`. See 4.0.10 release notes for details.
43+
- A new `CROSS_ORIGIN` setting was added in order to work around issues hosting
44+
emscripten programs across different origins (#25581)
45+
- The binary data encoding for `SINGLE_FILE` mode was changed from base64 to
46+
directly embed binary data into UTF-8 string. Users who use the `SINGLE_FILE`
47+
mode along with a custom HTML file should declare the files to have UTF-8
48+
encoding. See `src/settings.js` docs on `SINGLE_FILE`. Use the option
49+
`-sSINGLE_FILE_BINARY_ENCODE=0` to fall back to base64 encoding. (#25599)
50+
51+
4.0.17 - 10/17/25
52+
-----------------
53+
- Mutable Wasm globals can now be exported from native code. Currently these
54+
cannot be declared in C/C++ but can be defined and exported in assembly code.
55+
This currently only works for mutable globals since immutables are already
56+
(and continue to be) exported as plain JS numbers. (#25530)
57+
- Minimum Firefox version was bumped up to Firefox 68 ESR, since older Firefox
58+
versions are not able to run the parallel browser harness: (#25493)
59+
- Firefox: v65 -> v68
60+
- For windows users, colored console output for error messages and logging now
61+
requires Windows 10 or above. (#25502)
62+
- Fixed an issue from previous release 4.0.16 where "-sENVIRONMENT=worker" was
63+
erroneously made to imply "-sENVIRONMENT=web,worker" (#25514)
64+
- Passing '-sENVIRONMENT=worker' is now disallowed due to being ambiguous in
65+
its meaning. Instead, use '-sENVIRONMENT=web,worker' or
66+
'-sENVIRONMENT=node,worker' to refer to either Web or Node.js multithreading.
67+
68+
4.0.16 - 10/07/25
69+
-----------------
70+
- A warning was added about usage of embind without C++17 or above. (#25424)
71+
- The minimum supported versions of Node, Chrome and Firefox were bumped
72+
enabling the removal of the `globalThis` polyfill and universally enabling
73+
mutable globals: (#25375, #25385)
74+
- Node: v10.19.0 -> v12.22.9
75+
- Chrome: v70 -> v74
76+
- Firefox: v55 -> v65
77+
- The Embind `val` functions `call`, `operator()`, and `new_` now support
78+
passing `pointer`s by using the `allow_raw_pointers()` argument. This feature
79+
is only enabled with C++17 and newer. Older versions will allow pointers by
80+
default.
81+
82+
4.0.15 - 09/17/25
83+
-----------------
84+
- The `RELOCATABLE` and `LINKABLE` settings were deprecated in favor the higher
85+
level and better supported `MAIN_MODULE` / `SIDE_MODULE` settings. (#25265)
86+
- The `-gsource-map` flag has been updated to be independent of other types of
87+
debugging effects (in particular it no longer causes the wasm binary to have
88+
a name section, and it no longer suppresses minification of the JS output).
89+
To get the previous behavior, add `-g2` along with `-gsource-map`.
90+
See also the newly updated
91+
[documentation](https://emscripten.org/docs/porting/Debugging.html) which
92+
covers debugging flags and use cases (#25238).
93+
- Ogg port updated to 1.3.5. (#25274)
94+
- Vorbis port updated to 1.3.7. (#25274)
95+
- SDL3 port updated to 3.2.22. (#25273)
96+
97+
4.0.14 - 09/02/25
98+
-----------------
99+
- The `-sASYNCIFY_LAZY_LOAD_CODE` setting and the corresponding C function
100+
`emscripten_lazy_load_code` were removed. (#25236)
101+
- The `addRunDependency` and `removeRunDependency` API are now optional and need
102+
to be included and/or exported using, for example,
103+
`DEFAULT_LIBRARY_FUNCS_TO_INCLUDE` or `EXPORTED_RUNTIME_METHODS`. (#24974)
104+
- The `LOAD_SOURCE_MAP` setting was made an internal setting. This was always
105+
an internal detail of the sanitizers, which is enabled automatically when
106+
needed, so setting it explicitly should never be needed. (#24967)
107+
- The wasm offset converter was removed along with the `USE_OFFSET_CONVERTER`
108+
setting. This feature only existed to work around an old v8 bug that was fixed
109+
back in 2019. (#24963)
110+
111+
4.0.13 - 08/14/25
112+
-----------------
113+
- The `handle` callback on the `preloadPlugins` used by `--use-preload-plugins`
114+
(and `FS_createPreloadedFile` API`) was converted from callbacks to async.
115+
Any externally managed plugins would need to be updated accordingly. An
116+
assertion will detect any such non-async plugins in the wild. (#24914)
117+
- SDL2 updated from 2.32.0 to 2.32.8. (#24912/)
118+
- `sdl-config` and `sdl2-config` scripts were simplified to avoid using python
119+
and the `.bat` file versions were removed, matching upstream SDL. (#24907)
120+
- The `addRunDependency`/`removeRunDependency` now assert in debug builds if
121+
they are not passed an `id` parameter. We have been issuing warnings in
122+
this case since 2012 (f67ad60), so it seems highly unlikely anyone is not
123+
passing IDs here. (#24890).
124+
- The `-sMODULARIZE` setting generates a factory function that must be called
125+
before the program is instantiated that run. However, emscripten previously
126+
had very special case where this instantiation would happen automatically
127+
(with no parameterization) under certain specific circumstances: When
128+
`-sMINIMAL_RUNTIME`, `-sSINGLE_FILE` and `-sMODULARIZE` were used in
129+
combination with default html output. This special case was removed. If you
130+
want to instantiate the module on startup you can still do so by adding a call
131+
the factory function in `--extern-post-js`. (#24874)
132+
- emcc will now error if `MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION` is used
133+
when not generating html output. This was always incompatible but previously
134+
ignored. (#24849)
135+
- emcc will now error if `MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION` or
136+
`MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION` are used with `SINGLE_FILE`.
137+
These are fundamentally incompatible but were previously ignored. (#24849)
138+
- `--export-es6` flag was added to `file_packager.py` available when run
139+
standalone, to enable ES6 imports of generated JavaScript code (#24737)
140+
141+
4.0.12 - 08/01/25
142+
-----------------
143+
- The `#!` line that emscripten, under some circumstances, will add to the
144+
generated JS code no longer injects the `--experimental-wasm-bigint` node
145+
flag. This flag is not needed on recent versions of node, and in fact
146+
errors there, so it's not possible to know if it's safe to include. (#24808)
147+
- In `-sMODULARIZE` mode the factory function will now always return a promise,
148+
even when `WASM_ASYNC_COMPILATION` is disabled. This is because emscripten
149+
has other features that might also return async module creation (e.g. loading
150+
files over the network, or other users of the `addRunDependency` API). For
151+
consistency and simplicity we now *always* return a promise here. (#24727)
152+
- libcxx, libcxxabi, libunwind, and compiler-rt were updated to LLVM 20.1.8.
153+
(#24757)
154+
- The `fsblkcnt_t` and `fsfilcnt_t` types used by `statfs`/`statvfs` were
155+
changed from 32-bit to 64-bit. (#24769)
156+
- Support for `-sTEXT_DECODER=0` was removed, due to widespread support for
157+
`TextDecoder`. The remaining valid values for this setting are `=1`
158+
(conditional use of `TextDecoder` with fallback) and `=2` (unconditional use
159+
of `TextDecoder`). (#24700)
160+
161+
4.0.11 - 07/14/25
162+
-----------------
163+
- `emdump` tool/script was removed. This tool was mostly useful for analyzing
164+
asm.js code, which emscripten has not generated in a long time now.
165+
- Add support for [Source-based Code Coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html)
166+
To build with coverage enabled use `-fprofile-instr-generate -fcoverage-mapping`. (#24160)
167+
- The `ENVIRONMENT` setting will now be automatically updated to include
168+
`worker` if multi-threading is enabled. (#24525)
169+
- Removed the `HEADLESS` option. It tried to simulate a minimal browser-like
170+
environment before browser engines had real headless modes. For headless
171+
testing, users are now encouraged to use
172+
[Playwright](https://playwright.dev/), [Puppeteer](https://pptr.dev/) or
173+
Node.js with [JSDOM](https://github.com/jsdom/jsdom) instead. You can also
174+
use browser headless mode with `emrun` as follows:
175+
emrun --browser=chrome --browser-args=--headless [..]
176+
for chrome, or
177+
emrun --browser=firefox --browser-args=-headless [..]
178+
for firefox. (#24537)
179+
- When JSPI is enabled `async` library functions are no longer automatically
180+
wrapped with `WebAssembly.Suspending` functions. To automatically wrap library
181+
functions for use with JSPI they must now explicitly set
182+
`myLibraryFunction__async: true`.
183+
- Removed special casing for `size_t` in Embind, since it was also inadvertently
184+
affecting `unsigned long` on wasm64. Both will now match the behaviour of
185+
other 64-bit integers on wasm64 and will be passed as `bigint` instead of
186+
`number` to the JavaScript code. (#24678)
187+
188+
4.0.10 - 06/07/25
189+
-----------------
23190
- Emscripten ports now install pkg-config `.pc` files so they will show up, for
24191
example, when you run `pkg-config --list-all` or `pkg-config --cflags
25192
<portname>`. Bare in mind that the correct PKG_CONFIG_PATH needs to be set for
@@ -46,6 +213,14 @@ See docs/process.md for more on how version tagging works.
46213
- The field `responseUrl` is added to `emscripten_fetch_t`. This is notably
47214
usable for obtaining resolved URL, in line with JS `XMLHttpRequest.responseURL`
48215
field. (#24414)
216+
- `emscripten_fetch_get_response_headers_length` now excludes the trailing
217+
null character from the length calculation to match the documented behaviour.
218+
(#24486)
219+
- `--closure=1` can now be used while preserving readable function names with
220+
`-g2` or `-g`.
221+
- Functions `UTF8ToString`, `UTF16ToString` and `UTF32ToString` take a new
222+
optional `ignoreNul` parameter that allows to ignore the NUL characters and
223+
read the entire string up to the specific byte length. (#24487)
49224

50225
4.0.9 - 05/19/25
51226
----------------
@@ -194,7 +369,7 @@ See docs/process.md for more on how version tagging works.
194369
- Emscripten version was bumped to 4.0.0. Happy new year, happy new major
195370
version! While version has a few interesting changes, there is nothing huge
196371
that makes it different from any other release. (#19053)
197-
- `-sWASM_LEAGCY_EXCEPTIONS` option is added. (#23365) If true, it will emit
372+
- `-sWASM_LEGACY_EXCEPTIONS` option is added. (#23365) If true, it will emit
198373
instructions for the legacy Wasm exception handling proposal
199374
(https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/legacy/Exceptions.md),
200375
and if false, the new standardized exception handling proposal

bootstrap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# To make modifications to this file, edit `tools/run_python.sh` and then run
1212
# `tools/maint/create_entry_points.py`
1313

14-
# $PYTHON -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal
15-
# of cpython used in cross compilation via setup.py.
14+
# $PYTHON -E does not ignore _PYTHON_SYSCONFIGDATA_NAME, an internal of cpython
15+
# used in cross compilation via setup.py, so we unset it explicitly here.
1616
unset _PYTHON_SYSCONFIGDATA_NAME
1717

1818
if [ -z "$PYTHON" ]; then

bootstrap.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
:: %~dp0 expansions will not work.
2424
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH.
2525
@if exist "%~f0" (
26-
set MYDIR=%~dp0
26+
set "MYDIR=%~dp0"
2727
goto FOUND_MYDIR
2828
)
2929
@for %%I in (%~n0.bat) do (

0 commit comments

Comments
 (0)