Skip to content

Commit

Permalink
Reconcile more trunk changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Dec 1, 2023
1 parent 10a2626 commit 73418e0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/php-wasm/compile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ RUN if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; \
"dynCall_viiiii",\
"dynCall_viiiiiii",\
"dynCall_viiiiiiii",'; \
export ASYNCIFY_ONLY=$'"zif_array_filter",\"__fwritex",\
export ASYNCIFY_ONLY=$'"zif_array_filter",\
"__fwritex",\
"zif_sleep",\
"zif_stream_get_contents",\
"php_stdiop_read",\
Expand Down Expand Up @@ -970,7 +971,7 @@ RUN if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; \
if [ "${PHP_VERSION:0:1}" -lt "8" ]; then \
export ASYNCIFY_ONLY="$ASYNCIFY_ONLY,"$(echo "$ASYNCIFY_ONLY" | sed -E $'s/"([a-zA-Z])/"byn$fpcast-emu$\\1/g'); \
fi; \
echo -n ' -s ASYNCIFY_ONLY=['$ASYNCIFY_ONLY_UNPREFIXED$ASYNCIFY_ONLY'] '| tr -d "\n" >> /root/.emcc-php-wasm-flags; \
echo -n ' -s ASYNCIFY_ONLY=['$ASYNCIFY_ONLY_UNPREFIXED$ASYNCIFY_ONLY'] '| tr -d "\n" >> /root/.emcc-php-wasm-flags; \
fi;

# Build the final .wasm file
Expand Down Expand Up @@ -1143,7 +1144,7 @@ RUN set -euxo pipefail; \
# Make the php.wasm URL configurable via the dependencyFilename loader argument:
/root/replace.sh $'s/["\']php\.wasm[\'"]/dependencyFilename/g' /root/output/php.js; \
# Patch a "property undefined" error
# Emscripten produces an if that checkes a stream.stream_ops.poll property. However,
# Emscripten produces an if that checks a stream.stream_ops.poll property. However,
# stream.stream_ops is sometimes undefined and the check fails. Let's adjust it to
# tolerate a null stream.stream_ops value.
/root/replace.sh "s/if\s*\(stream\.stream_ops\.poll\)/if (stream.stream_ops?.poll)/g" /root/output/php.js; \
Expand All @@ -1155,10 +1156,12 @@ RUN set -euxo pipefail; \
/root/replace.sh $'s/if\s*\(\s*["\']string["\']\s*===\s*typeof Module\[["\']websocket["\']\]\[["\']url["\']\]\s*\)/if("function"===typeof Module["websocket"]["url"]) {\nurl = Module["websocket"]["url"](...arguments);\n}else if ("string" === typeof Module["websocket"]["url"])/g' \
/root/output/php.js; \
# Enable custom WebSocket constructors to support socket options.
/root/replace.sh "s/ws\s*=\s*new WebSocketConstructor/if (Module['websocket']['decorator']) {WebSocketConstructor = Module['websocket']['decorator'](WebSocketConstructor);}ws = new WebSocketConstructor/g" /root/output/php.js; \
/root/replace.sh "s/ws\s*=\s*new WebSocketConstructor/if (Module['websocket']['decorator']) {WebSocketConstructor = Module['websocket']['decorator'](WebSocketConstructor);}ws = new WebSocketConstructor/g" /root/output/php.js && \
if [ "$EMSCRIPTEN_ENVIRONMENT" = "node" ]; then \
if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; then \
/root/replace.sh "s/sock\.server\s*=\s*new WebSocketServer/if (Module['websocket']['serverDecorator']) {WebSocketServer = Module['websocket']['serverDecorator'](WebSocketServer);}sock.server = new WebSocketServer/g" /root/output/php.js; \
fi; \
fi; \
# Add MSG_PEEK flag support in recvfrom
#
# Emscripten ignores the flags argument to ___syscall_recvfrom.
Expand Down

0 comments on commit 73418e0

Please sign in to comment.