Skip to content

add ./install_dependencies.sh script, update build commands#1603

Closed
henderkes wants to merge 14 commits intophp:mainfrom
static-php:install_dependencies.sh
Closed

add ./install_dependencies.sh script, update build commands#1603
henderkes wants to merge 14 commits intophp:mainfrom
static-php:install_dependencies.sh

Conversation

@henderkes
Copy link
Contributor

maybe instead of #1565?

@henderkes
Copy link
Contributor Author

I would also like to add information that the recommended way to build FrankenPHP is with xcaddy, given that users will expect mercure, vulcain and brotli to work.

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's a good idea to include this script. End users should use the packages provided by their distributions for these dependencies, when available.

@@ -0,0 +1,78 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be install-depdendencies.sh for consistency with other scripts.

Also, is bash really necessary? Alpine doesn't have Bash by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, bash is necessary for the way the script is written. I could rework it to work with posix shell, if you want, but I chose bash because build-static and build-packages also use bin/bash.

@henderkes
Copy link
Contributor Author

henderkes commented Jun 2, 2025

I'm not sure that's a good idea to include this script. End users should use the packages provided by their distributions for these dependencies, when available.

I'm not sure if that's a good idea. Wtr-watcher doesn't exist as a package as far as I know and while brotli does exist, the brotli-devel static library is built without -fPIC, meaning it fails static linking and falls back to shared linking against libbrolienc, libbrotlidec and libbrolicommon.so. Users will end up with a frankenphp that links against shared libraries that they most likely won't have installed on their production system.

The worst part is that gcc falls back to linking against the shared libraries silently. A user will never know why it depends on libbrotli's shared libraries unless they use ldd and know about gcc's linking intricacies.

@henderkes
Copy link
Contributor Author

This will no longer be needed with static-php-cli being able to compile with a shared linked libphp.so.

@henderkes henderkes closed this Jul 16, 2025
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.

3 participants