Skip to content

Commit

Permalink
fix(static): unbundle parallel extension
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jun 24, 2024
1 parent d6d1b27 commit b47f4d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
16 changes: 9 additions & 7 deletions build-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -o errexit
set -x

if ! type "git" > /dev/null; then
if ! type "git" > /dev/null 2>&1; then
echo "The \"git\" command must be installed."
exit 1
fi
Expand All @@ -16,7 +16,7 @@ if [ "${os}" = "darwin" ]; then
md5binary="md5 -q"
fi

if [ "${os}" = "linux" ] && ! type "cmake" > /dev/null; then
if [ "${os}" = "linux" ] && ! type "cmake" > /dev/null 2>&1; then
echo "The \"cmake\" command must be installed."
exit 1
fi
Expand All @@ -28,7 +28,7 @@ if [ -z "${PHP_EXTENSIONS}" ]; then
export PHP_EXTENSIONS
cd -
else
export PHP_EXTENSIONS="apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gmp,gettext,iconv,igbinary,imagick,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,parallel,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,ssh2,sysvmsg,sysvsem,sysvshm,tidy,tokenizer,xlswriter,xml,xmlreader,xmlwriter,zip,zlib,yaml,zstd"
export PHP_EXTENSIONS="apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gmp,gettext,iconv,igbinary,imagick,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,ssh2,sysvmsg,sysvsem,sysvshm,tidy,tokenizer,xlswriter,xml,xmlreader,xmlwriter,zip,zlib,yaml,zstd"
fi
fi

Expand Down Expand Up @@ -83,18 +83,20 @@ else
cd static-php-cli/
git pull
else
git clone --depth 1 https://github.com/crazywhalecc/static-php-cli
# TODO: switch back to upstream when https://github.com/crazywhalecc/static-php-cli/pull/481 will be merged
#git clone --depth 1 https://github.com/crazywhalecc/static-php-cli
git clone --depth 1 --branch fix/480 https://github.com/dunglas/static-php-cli
cd static-php-cli/
fi

if type "brew" > /dev/null; then
if type "brew" > /dev/null 2>&1; then
if ! type "composer" > /dev/null; then
packages="composer"
fi
if ! type "go" > /dev/null; then
packages="${packages} go"
fi
if [ -n "${RELEASE}" ] && ! type "gh" > /dev/null; then
if [ -n "${RELEASE}" ] && ! type "gh" > /dev/null 2>&1; then
packages="${packages} gh"
fi

Expand Down Expand Up @@ -242,7 +244,7 @@ if [ -d "${EMBED}" ]; then
truncate -s 0 app_checksum.txt
fi
if type "upx" > /dev/null && [ -z "${DEBUG_SYMBOLS}" ] && [ -z "${NO_COMPRESS}" ]; then
if type "upx" > /dev/null 2>&1 && [ -z "${DEBUG_SYMBOLS}" ] && [ -z "${NO_COMPRESS}" ]; then
upx --best "dist/${bin}"
fi
Expand Down
6 changes: 4 additions & 2 deletions docs/fr/known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ Les extensions suivantes sont connues pour ne pas être compatibles avec Franken

Les extensions suivantes ont des bugs connus ou des comportements inattendus lorsqu'elles sont utilisées avec FrankenPHP :

Nom | Problème
[ext-openssl](https://www.php.net/manual/fr/book.openssl.php) | Lors de l'utilisation d'une version statique de FrankenPHP (construite avec la libc musl), l'extension OpenSSL peut planter sous de fortes charges. Une solution consiste à utiliser une version liée dynamiquement (comme celle utilisée dans les images Docker). Ce bogue est [suivi par PHP](https://github.com/php/php-src/issues/13648).
| Nom | Problème |
|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ext-openssl](https://www.php.net/manual/fr/book.openssl.php) | Lors de l'utilisation d'une version statique de FrankenPHP (construite avec la libc musl), l'extension OpenSSL peut planter sous de fortes charges. Une solution consiste à utiliser une version liée dynamiquement (comme celle utilisée dans les images Docker). Ce bogue est [suivi par PHP](https://github.com/php/php-src/issues/13648). |
| [parallel](https://github.com/krakjoe/parallel) | `parallel` fait geler et planter FrankenPHP. [Rapport de bogue](https://github.com/krakjoe/parallel/issues/308) |

## get_browser

Expand Down
1 change: 1 addition & 0 deletions docs/known-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The following extensions have known bugs and unexpected behaviors when used with
| Name | Problem |
|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ext-openssl](https://www.php.net/manual/en/book.openssl.php) | When using a static build of FrankenPHP (built with the musl libc), the OpenSSL extension may crash under heavy loads. A workaround is to use a dynamically linked build (like the one used in Docker images). This bug is [being tracked by PHP](https://github.com/php/php-src/issues/13648). |
| [parallel](https://github.com/krakjoe/parallel) | `parallel` makes FrankenPHP freeze and crash. [Bug report](https://github.com/krakjoe/parallel/issues/308) |

## get_browser

Expand Down

0 comments on commit b47f4d3

Please sign in to comment.