Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting APCu support #66

Open
ryandesign opened this issue Jan 31, 2024 · 1 comment
Open

Documenting APCu support #66

ryandesign opened this issue Jan 31, 2024 · 1 comment

Comments

@ryandesign
Copy link

Hi, I maintain the PHP ports in MacPorts and I just discovered that the zstd extension will check for the presence of the APCu extension at build time:

php-ext-zstd/config.m4

Lines 105 to 112 in 0bf5825

AC_MSG_CHECKING([for APCu includes])
if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then
apc_inc_path="$phpincludedir"
AC_MSG_RESULT([APCu in $apc_inc_path])
AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support])
else
AC_MSG_RESULT([not found])
fi

Now I have to decide how I should handle this in MacPorts and I didn't find any documentation about what the zstd extension does with APCu so I wanted to ask here if you could answer some questions or maybe document it.

What does the zstd extension do if it finds APCu at build time? How does it use it?

If the zstd extension finds APCu at build time, does it require it to be present at runtime? This would dictate whether I give the php-zstd port a dependency on the php-APCu port that is only needed at build time or also at runtime.

When the APCu code was first added to the zstd extension in 45c876a, the check for APCu in config.m4 was unconditional but all the uses of APCu-related code were guarded by PHP_MAJOR_VERSION >= 7. At that time the zstd extension still supported PHP 5. I believe the last version of the zstd extension that supported PHP 5 was 0.11.1 and the last version of APCu to do so was 4.0.11. If I have that version of APCu installed while building that version of the zstd extension with PHP 5, am I correct in assuming that it will find APCu at configure time but will do nothing with it at build time and that therefore no APCu dependency of any kind should be added for the PHP 5 case?

Thanks.

@remicollet
Copy link
Contributor

What does the zstd extension do if it finds APCu at build time? How does it use it?

zstd may be used as an APCu optional serializer (sic... not really a serializer)

At buildtime it will use the code from the header (inline function)
At runtime, it APCu is present, it will register the serializer

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

No branches or pull requests

2 participants