WordPress / WordPress/sqlite-database-integration

Add PIE support for native extension

Open
#504 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
363
Forks
67
Avg merge
2d 15h
Merged PRs (30d)
7

Description

I want to use the native extension with Static PHP, which is used to make static builds of frankenphp.

I had asked the team at Static PHP to consider adding the native parser extension to their static builds, but they felt it was a bit too niche to be appropriate. They also said that there would probably be problems due to the Rust toolchain

https://github.com/crazywhalecc/static-php-cli/issues/1239

They said that it would be ideal if PIE support could be added to the native extension, such that you could just do this

sudo apt install -y php-devel pie-zts
sudo pie-zts install wordpress/extension_name
and you're done. PIE compiles from source, so it'll take a bit, but this seems to be a very small extension so only a few seconds.

Is this something that could be done?

I see one comment in the codebase related to PIE, but I dont know what to make of/do with it.

https://github.com/WordPress/sqlite-database-integration/blob/4cfe40662e504d348561f259e94008ed91607f48/packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh#L158

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read wasm-spike/build-in-docker-rust.sh around line 158 and inspect how the native extension is currently built. Compare that setup with PIE's expected installation flow, then verify whether PIE can compile and install the extension successfully; done means the documented pie-zts install command works for the extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, rust
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.