Skip to content

Conversation

@brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Nov 13, 2025

Motivation for the change, related issues

Our system call overrides are not type checked, and any change to them requires rebuilding php-wasm JS files.

If we can separate our customization into TS modules and inject them into the php-wasm JS, we can benefit from type checking and reduce the number of slow php-wasm rebuilds we perform.

Implementation details

TBD

Testing Instructions (or ideally a Blueprint)

  • CI

@brandonpayton brandonpayton changed the title Make file-locking system calls testable and subject to the type system Type check system call overrides and allow changes without php-wasm rebuilds Nov 14, 2025
@brandonpayton brandonpayton changed the title Type check system call overrides and allow changes without php-wasm rebuilds Type check Emscripten JS overrides and allow changes without php-wasm rebuilds Nov 14, 2025
@brandonpayton brandonpayton marked this pull request as draft November 14, 2025 03:52
@brandonpayton
Copy link
Member Author

At first, I thought we could make our php-wasm JS customizations (i.e., our fcntl() override) more testable by separating them into TS modules that can be examined independently and injected into php-wasm JS at run time.

But as I explore these changes, it looks like the most economical way to test our customizations is in their usual context with further integration tests.

That said, separating into TS modules would:

  • Make critical php-wasm overrides subject to type checking
  • Reduce php-wasm rebuilds. The main reason a rebuild would be required when our customizations change is if their bindings require additions (for example, relaying a new constant from Emscripten cDefs).

So I plan to continue working on this PR, but for the moment, I will pivot to:

  • Add simple integration tests for file locking between multiple php-wasm instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants