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

Fix php bison dep for building on non-arm64 architectures #1115

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

brandonpayton
Copy link
Member

What is this PR doing?

This PR is an alternative to PR #871.

This PR fixes an error building php-wasm for PHP 7.3 and below on non-arm64 architectures. Those PHP versions depend on Bison 2.7. We have a prebuilt version of Bison 2.7 for arm64, but that naturally doesn't work on other CPU architectures. This PR builds Bison 2.7 as a stopgap.

On non-arm64 architectures, this extra build step runs once for each supported PHP version up to PHP 7.3. This is not ideal but can be improved later.

Testing Instructions

Before applying this patch

On an intel machine, run npm run recompile:php:web and observe there is a build error.

After applying this patch

On an intel machine, run npm run recompile:php:web and observe there are no longer build errors.

On an arm64 machine, run the following to make sure there are no build regressions:
npm run recompile:php:web

The prebuilt bison 2.7 files are for arm64 architecture and do not work
for other architectures such as x86_64.  In these cases, we can at least
build bison 2.7 from source.  We could be more efficient and build a
version that is cached across all PHP builds that need it, but let's get
the builds working again first.
@adamziel adamziel merged commit 6e84c8f into WordPress:trunk Mar 19, 2024
5 checks passed
@adamziel
Copy link
Collaborator

Works like a charm on arm64. I couldn't test on intel, but the change looks good and I understand it enabled building the project on your machine 👍

@brandonpayton
Copy link
Member Author

Thank you, @adamziel !

@brandonpayton brandonpayton deleted the fix-php-bison-dep-for-intel branch March 19, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants