Resolve DNS records in Node PHP runtimes - #4172
Draft
chubes4 wants to merge 3 commits into
Draft
Conversation
AI assistance: OpenAI gpt-5.6-terra via OpenCode regenerated PHP-WASM artifacts and verified the DNS runtime matrix.
This was referenced Aug 4, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the hardcoded DNS polyfill results with a Node resolver bridge for
dns_check_record()/checkdnsrr(),dns_get_record(), anddns_get_mx()/getmxrr().Supported records: A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, and TXT. Browser runtimes retain the existing unsupported false/empty behavior.
The bridge supports both Asyncify and JSPI, preserves PHP 5/7+ Zend ownership conventions, and returns PHP-compatible record and by-reference MX array shapes.
Closes #4171.
Verification
npx nx lint php-wasm-nodenpx tsc --noEmit -p packages/php-wasm/node/tsconfig.lib.jsonnpx vitest run src/lib/wasm-user-space.spec.ts --config vite.config.tsgit diff --checkThe focused runtime tests pass for rebuilt PHP 8.4 in both modes. Other checked-in PHP versions still carry the old binary until CI rebuilds them.
AI assistance
OpenCode with
openai/gpt-5.6-solwas used to inspect the PHP-WASM/Node bridge, draft the C and TypeScript implementation, diagnose build-order, Asyncify-stack, syscall-binding, and Zend by-reference issues, and add tests. Chris Huber reviewed the source and runtime evidence and remains responsible for the change.AI assistance: OpenAI gpt-5.6-sol via OpenCode was used to review and implement the follow-up fixes and tests.