gh-124928: Emscripten node support: Clean up old node <= 16 flags (#124929)

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.
This commit is contained in:
Hood Chatham 2024-10-29 07:28:54 +01:00 committed by GitHub
parent 85799f1ffd
commit dc2552d429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 83 deletions

View File

@ -0,0 +1 @@
Emscripten builds now require node >= 18.

View File

@ -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
configure generated vendored
View File

@ -7758,61 +7758,6 @@ else
fi fi
HOSTRUNNER="$NODE" HOSTRUNNER="$NODE"
# bigint for ctypes c_longlong, c_longdouble
# no longer available in Node 16
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for node --experimental-wasm-bigint" >&5
printf %s "checking for node --experimental-wasm-bigint... " >&6; }
if test ${ac_cv_tool_node_wasm_bigint+y}
then :
printf %s "(cached) " >&6
else $as_nop
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
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tool_node_wasm_bigint" >&5
printf "%s\n" "$ac_cv_tool_node_wasm_bigint" >&6; }
if test "x$ac_cv_tool_node_wasm_bigint" = xyes
then :
as_fn_append HOSTRUNNER " --experimental-wasm-bigint"
fi
if test "x$enable_wasm_pthreads" = xyes
then :
as_fn_append HOSTRUNNER " --experimental-wasm-threads"
# no longer available in Node 16
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for node --experimental-wasm-bulk-memory" >&5
printf %s "checking for node --experimental-wasm-bulk-memory... " >&6; }
if test ${ac_cv_tool_node_wasm_bulk_memory+y}
then :
printf %s "(cached) " >&6
else $as_nop
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
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tool_node_wasm_bulk_memory" >&5
printf "%s\n" "$ac_cv_tool_node_wasm_bulk_memory" >&6; }
if test "x$ac_cv_tool_node_wasm_bulk_memory" = xyes
then :
as_fn_append HOSTRUNNER " --experimental-wasm-bulk-memory"
fi
fi
if test "x$host_cpu" = xwasm64 if test "x$host_cpu" = xwasm64
then : then :
as_fn_append HOSTRUNNER " --experimental-wasm-memory64" as_fn_append HOSTRUNNER " --experimental-wasm-memory64"
@ -9578,6 +9523,7 @@ fi
then : then :
wasm_debug=yes wasm_debug=yes
fi fi
as_fn_append LDFLAGS_NODIST " --pre-js=\$(srcdir)/Tools/wasm/emscripten/node_pre.js"
as_fn_append LDFLAGS_NODIST " -sALLOW_MEMORY_GROWTH -sNODERAWFS" as_fn_append LDFLAGS_NODIST " -sALLOW_MEMORY_GROWTH -sNODERAWFS"
as_fn_append LINKFORSHARED " -sEXIT_RUNTIME" as_fn_append LINKFORSHARED " -sEXIT_RUNTIME"
WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map" WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map"

View File

@ -1622,34 +1622,6 @@ then
[Emscripten/node*], [ [Emscripten/node*], [
AC_PATH_TOOL([NODE], [node], [node]) AC_PATH_TOOL([NODE], [node], [node])
HOSTRUNNER="$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"])]) AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])])
], ],
dnl TODO: support other WASI runtimes dnl TODO: support other WASI runtimes
@ -2424,6 +2396,7 @@ AS_CASE([$ac_sys_system],
], ],
[node*], [ [node*], [
AS_VAR_IF([ac_sys_emscripten_target], [node-debug], [wasm_debug=yes]) 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([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sNODERAWFS"])
AS_VAR_APPEND([LINKFORSHARED], [" -sEXIT_RUNTIME"]) AS_VAR_APPEND([LINKFORSHARED], [" -sEXIT_RUNTIME"])
WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map" WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map"