From b9986cdadfca866130fc3dda1b8c4b80f29a740a Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Sat, 27 Jun 2026 17:00:51 +0200 Subject: [PATCH] Change: upgrade emscripten from 3.1.57 to 6.0.1 (#15780) --- .github/workflows/ci-emscripten.yml | 11 ++--------- .github/workflows/preview-build.yml | 11 ++--------- CMakeLists.txt | 2 +- os/emscripten/Dockerfile | 5 +---- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-emscripten.yml b/.github/workflows/ci-emscripten.yml index 271fc01638..b310c3a0cf 100644 --- a/.github/workflows/ci-emscripten.yml +++ b/.github/workflows/ci-emscripten.yml @@ -14,7 +14,7 @@ jobs: container: # If you change this version, change the numbers in the cache step, # .github/workflows/preview-build.yml (2x) and os/emscripten/Dockerfile too. - image: emscripten/emsdk:3.1.57 + image: emscripten/emsdk:6.0.1 steps: - name: Checkout @@ -24,20 +24,13 @@ jobs: run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Update to modern GCC - run: | - apt-get update - apt-get install -y gcc-12 g++-12 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 - - name: Setup cache uses: actions/cache@v5 with: # If you change this version, change the numbers in the image configuration step, # .github/workflows/preview-build.yml (2x) and os/emscripten/Dockerfile too. path: /emsdk/upstream/emscripten/cache - key: 3.1.57-${{ runner.os }} + key: 6.0.1-${{ runner.os }} - name: Add liblzma support run: | diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 0018e182a5..9c6b929d52 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -11,7 +11,7 @@ jobs: container: # If you change this version, change the numbers in the cache step, # .github/workflows/ci-emscripten.yml (2x) and os/emscripten/Dockerfile too. - image: emscripten/emsdk:3.1.57 + image: emscripten/emsdk:6.0.1 steps: - name: Checkout @@ -24,20 +24,13 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE} git checkout -b pr${{ github.event.pull_request.number }} - - name: Update to modern GCC - run: | - apt-get update - apt-get install -y gcc-12 g++-12 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 - - name: Setup cache uses: actions/cache@v5 with: path: /emsdk/upstream/emscripten/cache # If you change this version, change the numbers in the image configuration step, # .github/workflows/ci-emscripten.yml (2x) and os/emscripten/Dockerfile too. - key: 3.1.57-${{ runner.os }} + key: 6.0.1-${{ runner.os }} - name: Add liblzma support run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index ce018f5bf9..46914bc78f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,7 +370,7 @@ if(EMSCRIPTEN) add_definitions(-s DISABLE_EXCEPTION_CATCHING=0) # Export functions to Javascript. - target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'") + target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXPORTED_RUNTIME_METHODS='[\"cwrap\", \"HEAPU8\"]'") # Preload all the files we generate during build. # As we do not compile with FreeType / FontConfig, we also have no way to diff --git a/os/emscripten/Dockerfile b/os/emscripten/Dockerfile index e429867f1d..713e01f0f0 100644 --- a/os/emscripten/Dockerfile +++ b/os/emscripten/Dockerfile @@ -1,11 +1,8 @@ # If you change this version, change the numbers in .github/workflows/ci-emscripten.yml (2x) # and .github/workflows/preview-build.yml (2x) too. -FROM emscripten/emsdk:3.1.57 +FROM emscripten/emsdk:6.0.1 RUN apt-get update \ - && apt-get install -y gcc-12 g++-12 \ - && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \ - && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*