You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a build failure when trying to install PHP extensions (intl) on Alpine 3.22. The issue is caused by the toU16StringView function being used in ICU headers but missing from the current ICU version shipped with Alpine 3.22 (ICU 76+).
📄 Error Log
/usr/include/unicode/unistr.h: In function 'icu_76::UnicodeString icu_76::operator+(const UnicodeString&, const S&)':
/usr/include/unicode/unistr.h:4118:46: error: 'toU16StringView' is not a member of 'icu_76::internal'
4118 | return unistr_internalConcat(s1, internal::toU16StringView(s2));
| ^~~~~~~~~~~~~~~
/usr/include/unicode/unistr.h:4118:10: error: there are no arguments to 'unistr_internalConcat' that depend on a template parameter, so a declaration of 'unistr_internalConcat' must be available [-fpermissive]
You can also reproduce this with a minimal Dockerfile using php:8.4-alpine3.22:
🐳 Docker Reproduction
FROM php:8.4-alpine3.22
RUN apk add --no-cache icu-dev g++ && docker-php-ext-install intl
Would you happen to have any recommendations or insights on how this could be best addressed? 🙏
If this is something already being tracked elsewhere, I’d be happy to follow the right thread.
The docker snippet you posted does not reproduce an issue. In fact, PHP 8.4 should not be affected by this issue.
The reason the build fails is because ICU versions higher than 74.0 must be compiled using the C++17 standard instead of C++11. They bumped their requirements.
This was fixed in PHP a while ago, but it looks like this was done at a time when PHP 8.1 was already out of bugfix support. So that would explain why the CI run that you linked fails on PHP 8.1. It should not fail on newer versions of PHP.
The fix was actually backported to PHP 8.1 about 2 months ago: 3fdd3ed. However, this hasn't made it into distros yet because PHP 8.1 only receives security updates. That means that the ICU compile fix will only land together for PHP 8.1 with the next PHP 8.1 security release.
As a solution until that time comes, you can apply that commit manually in your build I suppose.
Let me know if this worked for you.
In general, it happens from time to time that libraries make breaking changes after a PHP version has gone out of support. Sometimes after it even went out of security support (Looking at you libxml...). In those cases it's often better to stick with older versions of that library if possible because the reality is that those newer library versions were likely never battle tested against the older PHP versions. In this particular case, I think it should be fine.
Uh oh!
There was an error while loading. Please reload this page.
Description
I'm encountering a build failure when trying to install PHP extensions (
intl
) on Alpine 3.22. The issue is caused by thetoU16StringView
function being used in ICU headers but missing from the current ICU version shipped with Alpine 3.22 (ICU 76+).📄 Error Log
You can also reproduce this with a minimal Dockerfile using
php:8.4-alpine3.22
:🐳 Docker Reproduction
✅ Works on:
❌ Fails on:
Thanks!
PHP Version
Operating System
Alpine 3.22
The text was updated successfully, but these errors were encountered: