Skip to content

set custom binary name for frankenphp, allow linking against system openssl (fix mssql issues)#1056

Merged
henderkes merged 6 commits intomainfrom
frankenphp-version
Mar 10, 2026
Merged

set custom binary name for frankenphp, allow linking against system openssl (fix mssql issues)#1056
henderkes merged 6 commits intomainfrom
frankenphp-version

Conversation

@henderkes
Copy link
Collaborator

@henderkes henderkes commented Mar 10, 2026

What does this PR do?

closes #1040

  • picked the useful patches from the shared branch
  • allows building against system openssl
  • sets custom binary name for frankenphp
  • reintroduces zig workaround because we use stable zig versions now
  • fixes removeConfiguraArgs in UnixAutoConfexecutor

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:
    • 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.

@henderkes henderkes marked this pull request as ready for review March 10, 2026 02:00
@henderkes henderkes requested a review from crazywhalecc March 10, 2026 02:01
@henderkes henderkes changed the title Frankenphp version set custom binary name for frankenphp, allow linking against system openssl (fix mssql issues) Mar 10, 2026
return false;
}
}
return true; // allow using system dependencies if pkg_config_path is explicitly defined
Copy link
Owner

Choose a reason for hiding this comment

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

Bypassing check could cause many problems in the future I think. Skipping building and using dynamic libraries should be two separate things, we cannot just do for checking though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This behaviour was already intended before, you even documented it: https://github.com/crazywhalecc/static-php-cli/blob/main/docs/en/develop/system-build-tools.md#pkg-config-compilation-nix-only

It was simply bugged before.

@crazywhalecc crazywhalecc added the mixed PR This PR contains multiple updates label Mar 10, 2026
@crazywhalecc
Copy link
Owner

What do you think of it: bin/spc build openssl,curl --build-cli --with-dynamic-libs=openssl (For example, adding a .so definition to the config, or something like shared-pkg-configs)

This allows us to explicitly and definitively determine whether the dynamic library exists and is correctly imported.

@henderkes
Copy link
Collaborator Author

Yes, it's a good idea, but after some consideration, I'm aiming that at v3. For now this is a good enough workaround that implements the logic we already promised.

@crazywhalecc
Copy link
Owner

crazywhalecc commented Mar 10, 2026

Yes, it's a good idea, but after some consideration, I'm aiming that at v3. For now this is a good enough workaround that implements the logic we already promised.

It was simply bugged before.

Yes, although its side effect is linking to system libraries, the system part is beyond our control if we really want to achieve this effect, unless we explicitly specify it and make it clear to ourselves what we want to do.

Passing shared libs explicitly, we could also determine and check lib*.so in SPCConfigUtil, including using system pkg-config.

@henderkes
Copy link
Collaborator Author

henderkes commented Mar 10, 2026

That's why this logic only triggers when PKG_CONFIG_PATH is explicitly set. So users will have to e.g. PKG_CONFIG_PATH=/usr/lib64/pkgconfig bin/spc build .... Otherwise, no system libraries are getting linked and we retain the regular static compilation logic.

Passing shared libs explicitly, we could also determine and check lib*.so in SPCConfigUtil, including using system pkg-config.

Generally, yes, I want this to be configurable. It's quite useful for the system packages to minimise disk space, actually. But I don't think we should showhorn it into v2 anymore and then merge it into v3. V3 already gives us better ways to configure and override library compilation logic, so it should be done there directly.

Co-authored-by: Jerry Ma <jesse2061@outlook.com>
@henderkes henderkes merged commit 9634b8b into main Mar 10, 2026
9 checks passed
@henderkes henderkes deleted the frankenphp-version branch March 10, 2026 04:11
crazywhalecc added a commit that referenced this pull request Mar 10, 2026
@dunglas dunglas mentioned this pull request Mar 10, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mixed PR This PR contains multiple updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants