Skip to content

Conversation

@crazywhalecc
Copy link
Owner

What does this PR do?

Some framework updates and refactoring frankenphp deps download method.

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@crazywhalecc crazywhalecc changed the base branch from main to sapi/frankenphp June 18, 2025 12:58
Comment on lines 530 to 532
if (!$this->getLib('libxml2')) {
throw new WrongUsageException('FrankenPHP SAPI requires libxml2 library, please include `xml` extension in your build.');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a requirement on macos? FrankenPHP itself doesn't need libxml2, it needs brotli and watcher for all the default functionality, but that's what -nowatcher and -nobrotli tags are for.

Copy link
Owner Author

@crazywhalecc crazywhalecc Jun 18, 2025

Choose a reason for hiding this comment

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

Yes. When I build only one extension without dependencies, it fails to build, saying it can't find libxml-2.0. But this seems to be a problem with FrankenPHP itself. It will force add the system's homebrew and /usr/local directories as LDFLAGS, which will make the spc build unstable. I don't know much about FrankenPHP's build system, but it seems to hardcode the LDFLAGS in the go source.

EDIT: libxml2 missing seems not related to hardcoded LDFLAGS things. These are two problems.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That seems to be macos specific then? I'm able to build without libxml

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dunglas https://github.com/php/frankenphp/blob/main/frankenphp.go#L17

why are libxml2 and the brew paths required on MacOS? This may introduce problems with potentially linking to dynamic libraries or oldrr versions, depending on the order the linker iterates through the library paths

Copy link
Collaborator

@henderkes henderkes Jun 18, 2025

Choose a reason for hiding this comment

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

this may also introduce issues on linux when a user has the php-devel package installed

is there a way to make Go ignore these linker comments?

@henderkes henderkes merged commit 1a164fa into sapi/frankenphp Jun 19, 2025
@henderkes henderkes deleted the sapi/frankenphp-prerequisites branch June 19, 2025 01:55
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