Skip to content

Fix missing libhashkit.so in PHP tarball for cflinuxfs5#100

Open
ramonskie wants to merge 1 commit intomainfrom
fix-libhashkit-missing-cflinuxfs5
Open

Fix missing libhashkit.so in PHP tarball for cflinuxfs5#100
ramonskie wants to merge 1 commit intomainfrom
fix-libhashkit-missing-cflinuxfs5

Conversation

@ramonskie
Copy link
Copy Markdown
Contributor

Problem

On Ubuntu 24.04 (cflinuxfs5), the libmemcached package was split: libmemcached.so.11 now dynamically links against libhashkit.so.2 (shipped as the separate libhashkit2t64 package). On Ubuntu 22.04 (cflinuxfs4) libhashkit was statically linked into libmemcached.so.11, so this dependency was invisible.

setupTar() was already copying libmemcached.so* into the PHP tarball but omitted libhashkit.so*, causing memcached.so to fail at runtime on cflinuxfs5:

PHP Startup: Unable to load dynamic library 'memcached.so'
(libhashkit.so.2: cannot open shared object file: No such file or directory)

This manifested as a Composer failure in the php-buildpack integration tests (cflinuxfs5 only):

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires PHP extension ext-memcached * but it is missing from your system.

Fix

Copy libhashkit.so* alongside libmemcached.so* in setupTar() — a single unconditional line, no stack-specific branching needed.

libhashkit.so.2 is present on both stacks (libhashkit-dev is pulled in transitively by libmemcached-dev on Ubuntu 22.04 as well), so the copy is safe for cflinuxfs4 builds too.

Testing

  • go test ./internal/recipe/... passes
  • PHP tarballs for cflinuxfs5 need to be rebuilt after this lands for the fix to take effect in the buildpack CI

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

1 participant