Repository navigation
fix(config.m4): support out-of-tree builds by resolving injected extension sources via absolute paths - #6294
Merged
matyhtf merged 1 commit intoOct 10, 2026
Conversation
…nsion sources via absolute paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observed failure
Building a TypePHP application that calls
swoole_version()fails while TypePHP is building its private PHP runtime: the CLI SAPI link dies with undefined Swoole symbols. The app build never started.TypePHP automatically downloads PHP 8.4.26 and PECL Swoole 6.2.3, injects Swoole at
ext/swoolein the php-src tree, and configures from a separate build directory. Configure logs two directory errors and continues; the generated Makefile contains only Swoole thirdparty objects.Reproduction
project.yml:main():Run
php vendor/bin/tpc.php project.yml --php-builderin a Linux environment with PHP build dependencies. The private runtime build fails at the CLI link with the symbols above. The same failure reproduces without TypePHP by injecting PECL swoole 6.2.3 into a php-src tree atext/swooleand running an out-of-treeconfigure --enable-swoole.Root cause
swoole_source_dirfalls through to the relative fallbackext/swoole, which is resolved against the build directory wherecd ext/swoolefails silently. The twofindcalls forext-src/*.ccandsrc/*.cctherefore return empty lists, configure continues, and only the hardcoded thirdparty file list enters the build. In-tree builds (pecl install) never hit this because the working directory already is the source tree.Fix
config.m4(this diff): resolve the injected tree via an absolute path, verify the extension entry source exists, check the exit status of everycd/find, and fail configure when either source list is empty.Verification
With this diff, the same out-of-tree build compiles all 130 extension/core objects, links the CLI SAPI, and the installed runtime loads swoole (
swoole_version() = 6.3.0RC1). In-tree (pecl install) and standalone builds are unaffected. Control extensions with explicit config.m4 source lists (redis,mongodb) build and run unchanged.