Skip to content

Commit

Permalink
gh-124928: Emscripten node support: Clean up old node <= 16 flags (#1…
Browse files Browse the repository at this point in the history
…24929)

Clean up configure flags for old node versions

These flags are only needed for node <= 16. Node 16 has been end of life since
October of 2023.
  • Loading branch information
hoodmane authored Oct 29, 2024
1 parent 85799f1 commit dc2552d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Emscripten builds now require node >= 18.
9 changes: 9 additions & 0 deletions Tools/wasm/emscripten/node_pre.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// If process is undefined, we're not running in the node runtime let it go I
// guess?
if (typeof process !== "undefined") {
const nodeVersion = Number(process.versions.node.split('.',1)[0]);
if (nodeVersion < 18) {
process.stderr.write(`Node version must be >= 18, got version ${process.version}\n`);
process.exit(1);
}
}
56 changes: 1 addition & 55 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 1 addition & 28 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1622,34 +1622,6 @@ then
[Emscripten/node*], [
AC_PATH_TOOL([NODE], [node], [node])
HOSTRUNNER="$NODE"
# bigint for ctypes c_longlong, c_longdouble
# no longer available in Node 16
AC_CACHE_CHECK([for node --experimental-wasm-bigint], [ac_cv_tool_node_wasm_bigint], [
if $NODE -v --experimental-wasm-bigint > /dev/null 2>&1; then
ac_cv_tool_node_wasm_bigint=yes
else
ac_cv_tool_node_wasm_bigint=no
fi
])
AS_VAR_IF([ac_cv_tool_node_wasm_bigint], [yes], [
AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bigint"])
])
AS_VAR_IF([enable_wasm_pthreads], [yes], [
AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-threads"])
# no longer available in Node 16
AC_CACHE_CHECK([for node --experimental-wasm-bulk-memory], [ac_cv_tool_node_wasm_bulk_memory], [
if $NODE -v --experimental-wasm-bulk-memory > /dev/null 2>&1; then
ac_cv_tool_node_wasm_bulk_memory=yes
else
ac_cv_tool_node_wasm_bulk_memory=no
fi
])
AS_VAR_IF([ac_cv_tool_node_wasm_bulk_memory], [yes], [
AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bulk-memory"])
])
])
AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])])
],
dnl TODO: support other WASI runtimes
Expand Down Expand Up @@ -2424,6 +2396,7 @@ AS_CASE([$ac_sys_system],
],
[node*], [
AS_VAR_IF([ac_sys_emscripten_target], [node-debug], [wasm_debug=yes])
AS_VAR_APPEND([LDFLAGS_NODIST], [" --pre-js=\$(srcdir)/Tools/wasm/emscripten/node_pre.js"])
AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sNODERAWFS"])
AS_VAR_APPEND([LINKFORSHARED], [" -sEXIT_RUNTIME"])
WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map"
Expand Down

0 comments on commit dc2552d

Please sign in to comment.