Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop crash with PHP extension update #2165

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Mar 7, 2025

Motivation for the change, related issues

This PR includes a couple of commits that have appeared to resolve PHP-related crashes in a private Playground instance.

cc @bph

Implementation details

There are two commits:

  1. Upgrade Emscripten to v3.1.74
  2. Move DNS polyfills to a PHP extension and add missing constants

Testing Instructions (or ideally a Blueprint)

  • CI

Brandon Payton and others added 2 commits March 7, 2025 00:23
Note: This work is continued from a PR started under the WordPress GH
org.

There are a couple of reasons for this upgrade:

1. I am having trouble rebuilding php-wasm on my current system.
References to older ubuntu images and emscripten versions [has given me
trouble](#2038 (comment)).
2. We want [this Emscripten
fix](emscripten-core/emscripten#22932) from
@jeroenpf and @bgrgicak which was first included in Emscripten 3.1.73.

This PR:
- Bumps the ubuntu docker image version due to build errors related to
missing image. Referencing a newer ubuntu image seemed to fix the
"missing image" errors.
- Bumps Emscripten version
- Adjusts Playground-specific patches to Emscripten output since the
latest breaks that patching.

- CI (once we can run GH actions on A8C's GHE instance)

---------

Co-authored-by: Brandon Payton <[email protected]>
The original implementation of the DNS polyfill didn't register `DNS_*`
constants which are [expected to exist in
PHP](https://www.php.net/manual/en/network.constants.php#constant.dns-any).
To fix this this PR registered the required DNS constants.

The constants were already defined in the polyfill and now we register
them as PH constants using `REGISTER_LONG_CONSTANT`.

I didn't want to add more code to the `php_wasm.c` file that wasn't
directly related to PHP-wasm, so I moved the DNS polyfill code to an
extension.

- CI
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Package][@php-wasm] Web labels Mar 7, 2025
@brandonpayton brandonpayton self-assigned this Mar 7, 2025
@brandonpayton brandonpayton requested a review from a team as a code owner March 7, 2025 05:34
@brandonpayton
Copy link
Member Author

Let's wait for CI tests to pass.

And before merging, I would like to temporarily allow merging discrete commits from PRs in order to keep the two commits separate on trunk. The change should only remain for a moment so we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@php-wasm] Web [Type] Bug An existing feature does not function as intended
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

2 participants