Fix missing libhashkit.so in PHP tarball for cflinuxfs5#100
Open
Fix missing libhashkit.so in PHP tarball for cflinuxfs5#100
Conversation
On Ubuntu 24.04 (cflinuxfs5), libmemcached was split into two packages: libmemcached11 now dynamically links against libhashkit.so.2 (from the separate libhashkit2t64 package), whereas on Ubuntu 22.04 (cflinuxfs4) libhashkit was statically linked into libmemcached.so.11. setupTar() was already copying libmemcached.so* into the PHP tarball but omitted libhashkit.so*, causing memcached.so to fail to load at runtime on cflinuxfs5 with: PHP Startup: Unable to load dynamic library 'memcached.so' (libhashkit.so.2: cannot open shared object file: No such file or directory) Fix: copy libhashkit.so* alongside libmemcached.so* in setupTar(). libhashkit.so.2 is present on both stacks (Ubuntu 22.04 ships it as part of libhashkit-dev, pulled in transitively by libmemcached-dev), so the copy is safe and unconditional — no stack-specific branching needed.
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.
Problem
On Ubuntu 24.04 (cflinuxfs5), the
libmemcachedpackage was split:libmemcached.so.11now dynamically links againstlibhashkit.so.2(shipped as the separatelibhashkit2t64package). On Ubuntu 22.04 (cflinuxfs4)libhashkitwas statically linked intolibmemcached.so.11, so this dependency was invisible.setupTar()was already copyinglibmemcached.so*into the PHP tarball but omittedlibhashkit.so*, causingmemcached.soto fail at runtime on cflinuxfs5:This manifested as a Composer failure in the php-buildpack integration tests (cflinuxfs5 only):
Fix
Copy
libhashkit.so*alongsidelibmemcached.so*insetupTar()— a single unconditional line, no stack-specific branching needed.libhashkit.so.2is present on both stacks (libhashkit-devis pulled in transitively bylibmemcached-devon Ubuntu 22.04 as well), so the copy is safe for cflinuxfs4 builds too.Testing
go test ./internal/recipe/...passes