Skip to content

Commit 9fc8bd1

Browse files
authored
Merge branch 'main' into issue-20983
2 parents d489b58 + db42d3f commit 9fc8bd1

File tree

174 files changed

+3429
-15273
lines changed

Some content is hidden

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

174 files changed

+3429
-15273
lines changed

.circleci/ccache.conf

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

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
version: 2.1
22

3+
34
orbs:
45
win: circleci/windows@5.0
56

@@ -1057,7 +1058,7 @@ jobs:
10571058
- run-tests-linux:
10581059
# some native-dependent tests fail because of the lack of native
10591060
# headers on emsdk-bundled clang
1060-
test_targets: "other skip:other.test_native_link_error_message"
1061+
test_targets: "other jslib skip:other.test_native_link_error_message"
10611062
test-browser-chrome:
10621063
executor: focal
10631064
environment:

ChangeLog.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ to browse the changes between the tags.
1818

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

21-
4.0.17 (in development)
21+
4.0.18 (in development)
2222
-----------------------
23+
- The `emrun.py` script no longer support running on python2. (#25597)
24+
- `-sUSE_WEBGPU` was removed in favor of the external port Emdawnwebgpu which
25+
are used via `--use-port=emdawnwebgpu`. See 4.0.10 release notes for details.
26+
- A new `CROSS_ORIGIN` setting was added in order to work around issues hosting
27+
emscripten programs across different origins (#25581)
28+
29+
4.0.17 - 10/17/25
30+
-----------------
31+
- Mutable Wasm globals can now be exported from native code. Currently these
32+
cannot be declared in C/C++ but can be defined and exported in assembly code.
33+
This currently only works for mutable globals since immutables are already
34+
(and continue to be) exported as plain JS numbers. (#25530)
2335
- Minimum Firefox version was bumped up to Firefox 68 ESR, since older Firefox
2436
versions are not able to run the parallel browser harness: (#25493)
2537
- Firefox: v65 -> v68

docs/process.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,46 @@ To update our libraries to a newer musl release:
291291
[`update_musl.py`][update_musl_emscripten] for that.
292292

293293

294+
## Deprecating settings and features
295+
296+
Emscripten has a lot of settings and features which makes combinatorial testing
297+
practically unfeasible. In order to manage the complexity and reduce
298+
technical debt we constantly strive to deprecate and remove settings and features
299+
that are no longer in use.
300+
301+
In order to manage these deprecations in a way that minimizes user impact and
302+
unintended consequences we have designed the following process. A primary
303+
purpose of this process is to engage with the user community in order to assess
304+
the impact of removing a given feature. At any point in the process we could
305+
decide collectively to abandon the deprecation, or to delay it.
306+
307+
1. Create an "Intent to deprecate" bug for the setting or feature.
308+
309+
2. Send a message to the emscripten-discuss mailing with the title `[PSA] Indent
310+
to deprecate XXX` where `XXX` is the name of the feature or setting in
311+
question. Please include a link to the bug created above.
312+
313+
3. If possible, update emscripten such that it will generate a `deprecated`
314+
warning when the feature is used. For settings this is normally as simple
315+
as adding it to `DEPRECATED_SETTINGS` in `settings.py`.
316+
317+
4. Perform a global search of public github repositories for usage of the
318+
feature. If you work for a company with a large internal codebase (e.g.
319+
Google) please also search globally there.
320+
321+
5. Feedback from steps (2), (3) and (4) should be summarized in the bug where
322+
discussions about the impact of deprecation can then proceed.
323+
324+
6. After at least 4 emscripten releases, or 2 months (whichever is shorter) a
325+
final decision on the deprecation may be agreed upon. The final decision
326+
will be made by the Emscripten maintainers.
327+
328+
7. If the decision is to proceed the feature can then be removed. If the
329+
decision goes the other way the deprecation warning should be removed. When
330+
the feature is removed, it should, where possible, continue to be detected
331+
by the code so that users of the old feature see an actionable message. An
332+
entry in `ChangeLog.md` should also be added.
333+
294334
[site_repo]: https://github.com/kripken/emscripten-site
295335
[releases_repo]: https://chromium.googlesource.com/emscripten-releases
296336
[waterfall]: https://ci.chromium.org/p/emscripten-releases/g/main/console

em++.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
import sys
8+
89
import emcc
910
from tools import shared
1011

em-config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
is found, or exits with 1 if the variable does not exist.
1515
"""
1616

17-
import sys
1817
import re
18+
import sys
19+
1920
from tools import config
2021

2122

emar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
import sys
11+
1112
from tools import shared
1213

1314
shared.exec_process([shared.LLVM_AR] + sys.argv[1:])

embuilder.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@
2020
import time
2121
from contextlib import contextmanager
2222

23-
from tools import cache
24-
from tools import shared
25-
from tools import system_libs
26-
from tools import ports
27-
from tools import utils
23+
from tools import cache, ports, shared, system_libs, utils
2824
from tools.settings import settings
2925
from tools.system_libs import USE_NINJA
3026

31-
3227
# Minimal subset of targets used by CI systems to build enough to be useful
3328
MINIMAL_TASKS = [
3429
'libcompiler_rt',
@@ -100,8 +95,6 @@
10095
'libunwind-legacyexcept',
10196
'libunwind-wasmexcept',
10297
'libnoexit',
103-
'libwebgpu',
104-
'libwebgpu_cpp',
10598
'bullet',
10699
]
107100

@@ -134,6 +127,9 @@
134127
'libwasmfs-debug',
135128
'libwasmfs_no_fs',
136129
'giflib',
130+
'sdl2',
131+
'sdl2_gfx',
132+
'sdl3',
137133
]
138134

139135
PORTS = sorted(list(ports.ports_by_name.keys()) + list(ports.port_variants.keys()))

emcc.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,38 @@
2020
slows down compilation).
2121
"""
2222

23-
from tools.toolchain_profiler import ToolchainProfiler
24-
2523
import logging
2624
import os
2725
import shlex
2826
import shutil
2927
import sys
30-
import time
3128
import tarfile
29+
import time
3230
from dataclasses import dataclass
3331
from enum import Enum, auto, unique
3432

35-
36-
from tools import shared, system_libs, utils, cmdline
37-
from tools import diagnostics, building, compile
38-
from tools.shared import unsuffixed_basename, get_file_suffix
39-
from tools.shared import exit_with_error, DEBUG
40-
from tools.shared import in_temp
41-
from tools.shared import DYLIB_EXTENSIONS
33+
from tools import (
34+
building,
35+
cache,
36+
cmdline,
37+
compile,
38+
config,
39+
diagnostics,
40+
shared,
41+
system_libs,
42+
utils,
43+
)
4244
from tools.cmdline import CLANG_FLAGS_WITH_ARGS
4345
from tools.response_file import substitute_response_files
44-
from tools import config
45-
from tools import cache
46-
from tools.settings import default_setting, user_settings, settings, COMPILE_TIME_SETTINGS
47-
from tools.utils import read_file
46+
from tools.settings import (
47+
COMPILE_TIME_SETTINGS,
48+
default_setting,
49+
settings,
50+
user_settings,
51+
)
52+
from tools.shared import DEBUG, DYLIB_EXTENSIONS, exit_with_error, in_temp
53+
from tools.toolchain_profiler import ToolchainProfiler
54+
from tools.utils import get_file_suffix, read_file, unsuffixed_basename
4855

4956
logger = logging.getLogger('emcc')
5057

@@ -250,10 +257,6 @@ def run(args):
250257
print(f'libraries: ={cache.get_lib_dir(absolute=True)}')
251258
return 0
252259

253-
if '-print-resource-dir' in args:
254-
shared.check_call([clang] + args)
255-
return 0
256-
257260
if '-print-libgcc-file-name' in args or '--print-libgcc-file-name' in args:
258261
settings.limit_settings(None)
259262
compiler_rt = system_libs.Library.get_usable_variations()['libcompiler_rt']
@@ -292,6 +295,10 @@ def run(args):
292295

293296
phase_setup(options, state)
294297

298+
if '-print-resource-dir' in args or any(a.startswith('--print-prog-name') for a in args):
299+
shared.exec_process([clang] + compile.get_cflags(tuple(args)) + args)
300+
assert False, 'exec_process should not return'
301+
295302
if '--cflags' in args:
296303
# Just print the flags we pass to clang and exit. We need to do this after
297304
# phase_setup because the setup sets things like SUPPORT_LONGJMP.
@@ -308,7 +315,7 @@ def run(args):
308315
linker_args = separate_linker_flags(newargs)[1]
309316
linker_args = [f.value for f in linker_args]
310317
# Delay import of link.py to avoid processing this file when only compiling
311-
from tools import link
318+
from tools import link # noqa: PLC0415
312319
link.run_post_link(options.input_files[0], options, linker_args)
313320
return 0
314321

@@ -513,7 +520,7 @@ def get_clang_command_asm():
513520
else:
514521
cmd = get_clang_command() + newargs
515522
shared.exec_process(cmd)
516-
assert False, 'exec_process does not return'
523+
assert False, 'exec_process should not return'
517524

518525
# In COMPILE_AND_LINK we need to compile source files too, but we also need to
519526
# filter out the link flags
@@ -566,7 +573,7 @@ def compile_source_file(input_file):
566573
if not shared.SKIP_SUBPROCS:
567574
assert os.path.exists(output_file)
568575
if options.save_temps:
569-
shutil.copyfile(output_file, shared.unsuffixed_basename(input_file) + '.o')
576+
shutil.copyfile(output_file, utils.unsuffixed_basename(input_file) + '.o')
570577
return output_file
571578

572579
# Compile input files individually to temporary locations.

emcmake.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
import shlex
99
import shutil
1010
import sys
11-
from tools import shared
12-
from tools import config
13-
from tools import utils
11+
12+
from tools import config, shared, utils
1413

1514

1615
#

0 commit comments

Comments
 (0)