patchelf and rename -release tagged extensions from php configure build#767
patchelf and rename -release tagged extensions from php configure build#767crazywhalecc merged 77 commits intomainfrom
Conversation
… patchelf their soname back and rename them
|
I got build error when building shared extension: |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issues caused by the release option affecting shared PHP extensions. It updates tool checklists, modifies shared extension build operations to rename and update soname via patchelf, and adjusts file modifications conditional on a release flag.
- Added patchelf to various Linux tool lists.
- Modified the build process for shared extensions in LinuxBuilder.
- Adjusted file replacements in LibraryBase and updated logging in Extension.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/SPC/doctor/item/LinuxToolCheckList.php | Added 'patchelf' to tool lists for various Linux distributions. |
| src/SPC/builder/linux/LinuxBuilder.php | Renames shared extension files and uses patchelf to update soname. |
| src/SPC/builder/LibraryBase.php | Conditionally replaces lines in a source file based on a release flag. |
| src/SPC/builder/Extension.php | Adds shared extension build checks and logs warnings for build issues. |
| src/SPC/builder/BuilderBase.php | Removes redundant shared extension checks. |
Comments suppressed due to low confidence (1)
src/SPC/builder/Extension.php:338
- [nitpick] Adjust the backtick formatting in the logged message so that the command is properly encapsulated (e.g. use a single pair:
spc build).
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
ld64 doesn't understand a lot of the linker flags that lld/gnu-ld support. MacOS shared extension support is very much barebones and we're expecting .so files (which curiously, also get generated on macos, when I expected .dylibs). I was able to build shared extensions on MacOS by toying with linker flags a bit, but I only have a shitty hacked together docker environment and hate the MacOS keyboard scheme, so it's not a priority for me. If you want to properly support shared extensions on mac, there's a lot of work to be done. Start group, end group for one is crucial, because by default, the linker doesn't go over previously visited archives again to find new unresolved symbols. We'd need to pass the libraries in perfect order, so that every library is only specified once, at the very last time that it needs to be referenced. |
|
closes #765 |
|
Removing |
|
You're welcome to remove it, it was mostly because it made testing easier in combination with --whole-archive, to force full resolution of symbols in those libraries. I think I edged it out with the new logic to find dependent libraries and the --start-group and --end-group- |
crazywhalecc
left a comment
There was a problem hiding this comment.
It's a bit of a beast though. Next time it would be better to separate the dependencies to another PR - this would help reviewing and automatically generating changelogs, if it’s not too related.
In addition, it may be convenient for us to add a simple commit message detect workflow to trigger a single test function.
|
there were a lot of issues introduced by the lock file changes, I think I'm getting behind them though |
|
found the segmentation fault bug in imagick, I think it forced symbols from libphp.a into imagick.so, which then conflicted when a program that already had the symbols from libphp.a tried to load the extension |
|
heh, we have a small problem with xcaddy - go install xcaddy links it against the systems libraries. when we install xcaddy on the host and then try to run bin/spc-alpine-docker, it fails with the misleading error that the xcaddy file doesn't exist |
Sounds like the pkgroot and buildroot reuse in different env error. I don't currently have any good way to get spc to recognize the correct pkgroot and buildroot, since we expect everyone to compile in only one environment at one time. |
|
yeah I think it's fair to ignore this for now. |
|
okay: mac failed 3x to rate limiting now. doesn't Downloader::curlExec automatically use the GITHUB_TOKEN? |
|
Sorry, but I prefer that whoever made the changes should fix them. 🫣 Just now my local has been replaced globally, and the your commit pushed is missing the part in the docs and UnixBuilderBase. |
|
Oh, sorry! On the bright side, frankenphp built with musl now links fully statically again, meaning it can also run on glibc. |
That's by design, though. We keep php/frankenphp where it's possible, it's only for the xcaddy command where it must be called dunglas/frankenphp. |
|
I'll let a few more static extension tests run before I merge this |
|
everything builds correctly except the opcache jit error. I thought php-src already fixed that O.o |
|
I don't think PHP will be fixed immediately in versions other than the main branch. Also, if necessary, I would use |
|
oh you're right, it was tagged, but for 8.4.9 php/php-src@7a0beb4 Feel free to merge this then. |
What does this PR do?
the release option also affects shared extensions, which is unwanted, patchelf their soname back and rename them
Closes #771