Update EMSDK to 5.0.0 (#479)

Emscripten 4.0.12 introduced breaking change by changing module factory
to always return promise even if `WASM_ASYNC_COMPILATION=0`. To overcome this, build emscripten compiler without MODULARIZE with custom export of `createRevive`.
This commit is contained in:
kvpanch authored and GitHub committed 2026-02-23 15:48:07 -05:00
1 parent 71d584dd6e
commit 810a36b18b
9 files changed
+19 -6

No files matched your search

+2 -2
View File
@@ -5,9 +5,9 @@ rustflags = [
"-Clink-arg=-sEXIT_RUNTIME=1", "-Clink-arg=-sEXIT_RUNTIME=1",
"-Clink-arg=-sALLOW_MEMORY_GROWTH=1", "-Clink-arg=-sALLOW_MEMORY_GROWTH=1",
"-Clink-arg=-sEXPORTED_RUNTIME_METHODS=FS,callMain,stringToNewUTF8", "-Clink-arg=-sEXPORTED_RUNTIME_METHODS=FS,callMain,stringToNewUTF8",
"-Clink-arg=-sMODULARIZE=1",
"-Clink-arg=-sEXPORT_NAME=createRevive",
"-Clink-arg=-sWASM_ASYNC_COMPILATION=0", "-Clink-arg=-sWASM_ASYNC_COMPILATION=0",
"-Clink-arg=--extern-pre-js=js/emscripten/embed/extern-pre.js",
"-Clink-arg=--extern-post-js=js/emscripten/embed/extern-post.js",
"-Clink-arg=-sDYNAMIC_EXECUTION=0", "-Clink-arg=-sDYNAMIC_EXECUTION=0",
"-Clink-arg=-sALLOW_TABLE_GROWTH=1", "-Clink-arg=-sALLOW_TABLE_GROWTH=1",
"-Clink-arg=--js-library=js/emscripten/embed/soljson_interface.js", "-Clink-arg=--js-library=js/emscripten/embed/soljson_interface.js",
+1 -1
View File
@@ -3,7 +3,7 @@ inputs:
version: version:
description: "" description: ""
required: false required: false
default: "4.0.9" default: "5.0.0"
runs: runs:
+4
View File
@@ -79,6 +79,10 @@ jobs:
rustflags: "" rustflags: ""
cache-key: ${{ matrix.target }} cache-key: ${{ matrix.target }}
- name: Enable long paths (Windows)
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: Install Dependencies - name: Install Dependencies
if: ${{ matrix.host == 'linux' }} if: ${{ matrix.host == 'linux' }}
run: | run: |
+1
View File
@@ -18,6 +18,7 @@ This is a development pre-release.
- Updated `musl` to `1.2.5` - Updated `musl` to `1.2.5`
- Updated `inkwell` to `0.8.0` - Updated `inkwell` to `0.8.0`
- Updated `polkavm-*` to `0.31.0` - Updated `polkavm-*` to `0.31.0`
- Updated `EMSDK` to `5.0.0`
## v1.0.0 ## v1.0.0
+1 -1
View File
@@ -38,7 +38,7 @@ pub const MUSL_SNAPSHOTS_URL: &str = "https://git.musl-libc.org/cgit/musl/snapsh
pub const EMSDK_SOURCE_URL: &str = "https://github.com/emscripten-core/emsdk.git"; pub const EMSDK_SOURCE_URL: &str = "https://github.com/emscripten-core/emsdk.git";
/// The emscripten SDK version. /// The emscripten SDK version.
pub const EMSDK_VERSION: &str = "4.0.9"; pub const EMSDK_VERSION: &str = "5.0.0";
/// The subprocess runner. /// The subprocess runner.
/// ///
+6
View File
@@ -0,0 +1,6 @@
return Module;
}
if (typeof module === "object" && typeof module.exports === "object") {
module.exports = createRevive;
} else if (typeof define === "function" && define["amd"])
define([], () => createRevive);
+2
View File
@@ -0,0 +1,2 @@
function createRevive(moduleArg) {
var Module = moduleArg || {};
+1 -1
View File
@@ -1,7 +1,7 @@
const soljson = require("solc/soljson"); const soljson = require("solc/soljson");
const createRevive = require("./resolc.js"); const createRevive = require("./resolc.js");
async function compile(standardJsonInput) { function compile(standardJsonInput) {
if (!standardJsonInput) { if (!standardJsonInput) {
throw new Error("Input JSON for the Solidity compiler is required."); throw new Error("Input JSON for the Solidity compiler is required.");
} }
+1 -1
View File
@@ -1,7 +1,7 @@
importScripts("./resolc_web.js"); importScripts("./resolc_web.js");
// Handle messages from the main thread // Handle messages from the main thread
onmessage = async function (e) { onmessage = function (e) {
const m = createRevive(); const m = createRevive();
// Set input data for stdin // Set input data for stdin