From ae80239189ec0596b18444a390a5efeb0b3b8dd5 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 4 Nov 2026 05:59:46 +0000 Subject: [PATCH] Update ports to remove -D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23 libc++'s LLVM 23 update (#28149) removed transitive includes (https://github.com/llvm/llvm-project/pull/195509), after which we some of our ports needed `-D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23` to compile. I've submitted fixes to those ports: - https://github.com/emscripten-ports/Cocos2d/pull/6 - https://github.com/google/dawn/pull/93, which was merged in https://github.com/google/dawn/commit/aaf03944262af82fed235caef5953943150aa5fc - https://github.com/pongasoft/emscripten-glfw/pull/33, after which its TAG and SHA was updated in #28166 This updates version numbers and SHAs for Cocos2d and dawn and removes the `-D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23` flag from our ports build. This also adds `-std=c++20` to two tests using Cocos2d because this update (which includes 6 months of work) includes C++20 features. --- test/test_browser.py | 4 ++-- test/test_other.py | 2 +- tools/ports/__init__.py | 7 +------ tools/ports/cocos2d.py | 4 ++-- tools/ports/emdawnwebgpu.py | 4 ++-- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/test/test_browser.py b/test/test_browser.py index 559885622e79e..9af227875466e 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -3173,7 +3173,7 @@ def test_sdl3_text(self): def test_cocos2d_hello(self): # cocos2d build contains a bunch of warnings about tiff symbols being missing at link time: # e.g. warning: undefined symbol: TIFFClientOpen - cocos2d_root = os.path.join(ports.Ports.get_dir(), 'cocos2d', 'Cocos2d-version_3_4') + cocos2d_root = os.path.join(ports.Ports.get_dir(), 'cocos2d', 'Cocos2d-version_3_5') preload_file = os.path.join(cocos2d_root, 'samples', 'Cpp', 'HelloCpp', 'Resources') + '@' self.reftest('cocos2d_hello.cpp', reference_slack=1, cflags=['-sUSE_COCOS2D=3', '-sERROR_ON_UNDEFINED_SYMBOLS=0', @@ -4368,7 +4368,7 @@ def test_webgl_simple_extensions(self, webgl_version, simple_enable_extensions): }) @requires_webgpu def test_webgpu_basic_rendering(self, args): - self.btest_exit('webgpu_basic_rendering.cpp', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'] + args) + self.btest_exit('webgpu_basic_rendering.cpp', cflags=['--use-port=emdawnwebgpu', '-std=c++20', '-sEXIT_RUNTIME'] + args) @requires_webgpu def test_webgpu_required_limits(self): diff --git a/test/test_other.py b/test/test_other.py index 083c60e3bec1b..0fdfb57339fa2 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12539,7 +12539,7 @@ def test_emdawnwebgpu_link_test(self, args): if config.FROZEN_CACHE and (self.is_wasm64() or '-sMAIN_MODULE=2' in args): # CI configuration doesn't run `embuilder` with wasm64 on ports self.skipTest("test doesn't work with frozen cache") - self.emcc(test_file('test_emdawnwebgpu_link_test.cpp'), ['--use-port=emdawnwebgpu', '-sASYNCIFY'] + args) + self.emcc(test_file('test_emdawnwebgpu_link_test.cpp'), ['--use-port=emdawnwebgpu', '-std=c++20', '-sASYNCIFY'] + args) def test_signature_mismatch(self): create_file('a.c', 'void foo(); int main() { foo(); return 0; }') diff --git a/tools/ports/__init__.py b/tools/ports/__init__.py index c400346571e79..6fa3f9912e678 100644 --- a/tools/ports/__init__.py +++ b/tools/ports/__init__.py @@ -245,11 +245,6 @@ def build_port(src_dir, output_path, port_name, includes=[], flags=[], cxxflags= srcs.append(os.path.join(root, f)) cflags = [*system_libs.get_base_cflags(build_dir), '-O2', '-I' + src_dir, *flags] - # emdawnwebgpu, contrib.glfw3, and cocos2d currently don't build without - # -D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23 after LLVM 23 removed transitive - # includes (https://github.com/llvm/llvm-project/pull/195509). - # TODO Update these ports and remove this flag. - cflags += ['-D_LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23'] for include in includes: cflags.append('-I' + include) @@ -300,7 +295,7 @@ def get_build_dir(): @staticmethod def fetch_project(name, url, sha512hash=None): - # To compute the sha512 hash, run `curl URL | sha512sum`. + # To compute the sha512 hash, run `curl -sSfL URL | sha512sum`. fullname = Ports.get_dir(name) if name not in Ports.name_cache: # only mention each port once in log diff --git a/tools/ports/cocos2d.py b/tools/ports/cocos2d.py index 94105ad16edce..617e18b93d7bf 100644 --- a/tools/ports/cocos2d.py +++ b/tools/ports/cocos2d.py @@ -8,8 +8,8 @@ from tools import diagnostics -TAG = 'version_3_4' -HASH = '38dc1406d679d05ecd89c11db05ceb72ac9feefae733e23c2f2bbb22e8b0728d8ec902cec53fa13eb3927a130e58e9ae4c7a4cd6479295d0fc6ad68b5168f930' +TAG = 'version_3_5' +HASH = '78d2a4e3c5ce3c2b22ddfb81d935e2cb07c213e341eb3b38831a9ebc97b299bdc70941812f8dc71f29de0fedea47b1077cb637961db9a4614b49703b7e30f79f' deps = ['libpng', 'zlib'] diff --git a/tools/ports/emdawnwebgpu.py b/tools/ports/emdawnwebgpu.py index 50f1915a34c46..2e9f2298d0ba7 100644 --- a/tools/ports/emdawnwebgpu.py +++ b/tools/ports/emdawnwebgpu.py @@ -151,14 +151,14 @@ print('Please see documentation inside this file for details on how to use this port.') sys.exit(1) -_VERSION = 'v20260423.175430' +_VERSION = 'v20261105.214757' # Remote-specific port information # - Where to download the port EXTERNAL_PORT = f'https://github.com/google/dawn/releases/download/{_VERSION}/emdawnwebgpu_pkg-{_VERSION}.zip' # - Hash to verify the download integrity -SHA512 = '42784f70b67197c614322f9fabb0f1dc64228a0de10e88f99941fa9d29bee9ad6683f4651d4eefd5a7a9fbd1f976eb522b190b683219ed1793e9b531c602ffa6' +SHA512 = 'ad5cfd55ee87d4b878360a180295e368eca53677c97029e7ab40f6a1b655b41d40579f3290edc9d4ba4d48246367860c893dd475bb0a71dd78c491a0e69a364c' # - Path of the port inside the zip file PORT_FILE = 'emdawnwebgpu_pkg/emdawnwebgpu.port.py'