Skip to content

Build PHP binaries --with-suggested-libs - #4502

Open
fredrikekelund wants to merge 1 commit into
trunkfrom
f26d/php-builds-with-suggested-libs
Open

Build PHP binaries --with-suggested-libs#4502
fredrikekelund wants to merge 1 commit into
trunkfrom
f26d/php-builds-with-suggested-libs

Conversation

@fredrikekelund

Copy link
Copy Markdown
Contributor

Related issues

  • N/A

How AI was used in this PR

N/A

Proposed Changes

static-php-cli omits certain external libraries by default, like libjpeg. These are listed as "suggestions" rather than "dependencies". We previously ran into trouble with the PHP gd module missing some external libraries and fixed it in #3927.

However, it turns out that there's a better approach to including these external libraries than the one we took in the previous PR. Instead of explicitly listing which libraries to include, we can use --with-suggested-libs to have static-php-cli automatically include the suggested libraries. This PR makes that change.

Testing Instructions

I will manually trigger a PHP build and verify that gd still has all the libraries we need.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@fredrikekelund
fredrikekelund requested review from a team and bcotrim August 11, 2026 08:40
@fredrikekelund fredrikekelund self-assigned this Aug 11, 2026
@fredrikekelund
fredrikekelund requested a review from a team as a code owner August 11, 2026 08:40

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

It would be interesting to compare the binaries size once we run the builds, assuming suggested libs can add libs we didn't have initially

"$static_extensions"
# Give gd JPEG/WebP image support and FreeType (TrueType text).
--with-libs=freetype,libjpeg,libwebp
--with-suggested-libs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the trail correctly, it looks like this change fails in the Linux GHA environments.

Image

Given the PR is approved, I'm going to request changes just to avoid it's accidentally merged.

@mokagio

mokagio commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@bcotrim

It would be interesting to compare the binaries size once we run the builds, assuming suggested libs can add libs we didn't have initially

I haven't verified it myself, but when I asked Claude to check on the GHA status for the changes here, it read your comment and reported:

Size cost, measured against the same-version baseline (run 30920247147): macos-aarch64 26.0 → 29.5 MB (+13.4%), macos-x86_64 26.5 → 30.5 MB (+15.0%).

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.

3 participants