mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Merge branch 'main' into sapi/cgi
# Conflicts: # composer.lock
This commit is contained in:
commit
fe945ab3ea
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ packlib_files.txt
|
|||||||
/bin/*
|
/bin/*
|
||||||
!/bin/spc*
|
!/bin/spc*
|
||||||
!/bin/setup-runtime*
|
!/bin/setup-runtime*
|
||||||
|
!/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# exclude windows build tools
|
# exclude windows build tools
|
||||||
/php-sdk-binary-tools/
|
/php-sdk-binary-tools/
|
||||||
|
|||||||
11
bin/docker-entrypoint.sh
Normal file
11
bin/docker-entrypoint.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
|
||||||
|
BACKUP_DIR="/app/pkgroot-private"
|
||||||
|
# copy private pkgroot to pkgroot if pkgroot is empty
|
||||||
|
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
|
||||||
|
echo "* Copying private pkgroot to pkgroot ..."
|
||||||
|
rm -rf "$TARGET_DIR"
|
||||||
|
cp -r "$BACKUP_DIR" "$TARGET_DIR"
|
||||||
|
fi
|
||||||
|
exec "$@"
|
||||||
@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
|
|||||||
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
||||||
|
|
||||||
# set download dir
|
# set download dir
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
||||||
|
|
||||||
# use china mirror
|
# use china mirror
|
||||||
@ -45,7 +45,7 @@ done
|
|||||||
|
|
||||||
case "$mirror" in
|
case "$mirror" in
|
||||||
china)
|
china)
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@ -123,8 +123,13 @@ COPY ./composer.* /app/
|
|||||||
ADD ./bin /app/bin
|
ADD ./bin /app/bin
|
||||||
RUN composer install --no-dev
|
RUN composer install --no-dev
|
||||||
ADD ./config /app/config
|
ADD ./config /app/config
|
||||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix
|
RUN bin/spc doctor --auto-fix
|
||||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
|
RUN bin/spc install-pkg upx
|
||||||
|
|
||||||
|
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
|
||||||
|
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||||
|
RUN chmod +x /bin/docker-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -112,8 +112,8 @@ ENV SPC_LIBC=glibc
|
|||||||
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
|
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
|
||||||
|
|
||||||
ADD ./config /app/config
|
ADD ./config /app/config
|
||||||
RUN CC=gcc PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix --debug
|
RUN CC=gcc bin/spc doctor --auto-fix --debug
|
||||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
|
RUN bin/spc install-pkg upx
|
||||||
RUN if [ -f /app/buildroot/bin/re2c ]; then \
|
RUN if [ -f /app/buildroot/bin/re2c ]; then \
|
||||||
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
|
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
|
||||||
fi
|
fi
|
||||||
@ -133,6 +133,11 @@ RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.ta
|
|||||||
make && \
|
make && \
|
||||||
make install && \
|
make install && \
|
||||||
ln -sf /usr/local/bin/automake /usr/bin/automake
|
ln -sf /usr/local/bin/automake /usr/bin/automake
|
||||||
|
|
||||||
|
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
|
||||||
|
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||||
|
RUN chmod +x /bin/docker-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
14
composer.lock
generated
14
composer.lock
generated
@ -2861,16 +2861,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "friendsofphp/php-cs-fixer",
|
"name": "friendsofphp/php-cs-fixer",
|
||||||
"version": "v3.87.0",
|
"version": "v3.87.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||||
"reference": "50a13c4c5f25d2c6894e30e92c051474cf0e115a"
|
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/50a13c4c5f25d2c6894e30e92c051474cf0e115a",
|
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||||
"reference": "50a13c4c5f25d2c6894e30e92c051474cf0e115a",
|
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2903,7 +2903,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||||
"infection/infection": "^0.29.14",
|
"infection/infection": "^0.29.14",
|
||||||
"justinrainbow/json-schema": "^6.4",
|
"justinrainbow/json-schema": "^6.5",
|
||||||
"keradus/cli-executor": "^2.2",
|
"keradus/cli-executor": "^2.2",
|
||||||
"mikey179/vfsstream": "^1.6.12",
|
"mikey179/vfsstream": "^1.6.12",
|
||||||
"php-coveralls/php-coveralls": "^2.8",
|
"php-coveralls/php-coveralls": "^2.8",
|
||||||
@ -2953,7 +2953,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v97773{PHP_CS_FIXER_VERSION}"
|
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.87.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2961,7 +2961,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-09-02T10:58:35+00:00"
|
"time": "2025-09-02T15:27:36+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "humbug/box",
|
"name": "humbug/box",
|
||||||
|
|||||||
@ -10,8 +10,6 @@ use SPC\exception\SPCInternalException;
|
|||||||
use SPC\exception\ValidationException;
|
use SPC\exception\ValidationException;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\Config;
|
use SPC\store\Config;
|
||||||
use SPC\store\CurlHook;
|
|
||||||
use SPC\store\Downloader;
|
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\store\pkg\GoXcaddy;
|
use SPC\store\pkg\GoXcaddy;
|
||||||
use SPC\toolchain\GccNativeToolchain;
|
use SPC\toolchain\GccNativeToolchain;
|
||||||
|
|||||||
@ -40,10 +40,6 @@ class GlobalEnvManager
|
|||||||
if (is_unix()) {
|
if (is_unix()) {
|
||||||
self::addPathIfNotExists(BUILD_BIN_PATH);
|
self::addPathIfNotExists(BUILD_BIN_PATH);
|
||||||
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
|
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
|
||||||
// internally use `WORKING_DIR/pkgroot-private` to avoid volume mount issues in Docker
|
|
||||||
if (is_dir(WORKING_DIR . '/pkgroot-private/bin')) {
|
|
||||||
self::addPathIfNotExists(WORKING_DIR . '/pkgroot-private/bin');
|
|
||||||
}
|
|
||||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ class PkgConfigUtil
|
|||||||
{
|
{
|
||||||
// Find pkg-config executable
|
// Find pkg-config executable
|
||||||
$find_list = [
|
$find_list = [
|
||||||
WORKING_DIR . '/pkgroot-private/bin/pkg-config', // used in Docker build, which is installed inside the container to avoid volume mounting issues
|
|
||||||
PKG_ROOT_PATH . '/bin/pkg-config',
|
PKG_ROOT_PATH . '/bin/pkg-config',
|
||||||
BUILD_BIN_PATH . '/pkg-config',
|
BUILD_BIN_PATH . '/pkg-config',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -22,7 +22,10 @@ define('BUILD_BIN_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_BI
|
|||||||
// output path for shared extensions
|
// output path for shared extensions
|
||||||
define('BUILD_MODULES_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_MODULES_PATH')) ? $a : (BUILD_ROOT_PATH . '/modules')));
|
define('BUILD_MODULES_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_MODULES_PATH')) ? $a : (BUILD_ROOT_PATH . '/modules')));
|
||||||
|
|
||||||
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . '/pkgroot')));
|
// pkg arch name
|
||||||
|
$_pkg_arch_name = arch2gnu(php_uname('m')) . '-' . strtolower(PHP_OS_FAMILY);
|
||||||
|
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . "/pkgroot/{$_pkg_arch_name}")));
|
||||||
|
|
||||||
define('SOURCE_PATH', FileSystem::convertPath(is_string($a = getenv('SOURCE_PATH')) ? $a : (WORKING_DIR . '/source')));
|
define('SOURCE_PATH', FileSystem::convertPath(is_string($a = getenv('SOURCE_PATH')) ? $a : (WORKING_DIR . '/source')));
|
||||||
define('DOWNLOAD_PATH', FileSystem::convertPath(is_string($a = getenv('DOWNLOAD_PATH')) ? $a : (WORKING_DIR . '/downloads')));
|
define('DOWNLOAD_PATH', FileSystem::convertPath(is_string($a = getenv('DOWNLOAD_PATH')) ? $a : (WORKING_DIR . '/downloads')));
|
||||||
define('CPU_COUNT', match (PHP_OS_FAMILY) {
|
define('CPU_COUNT', match (PHP_OS_FAMILY) {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $no_strip = false;
|
|||||||
$upx = false;
|
$upx = false;
|
||||||
|
|
||||||
// whether to test frankenphp build, only available for macos and linux
|
// whether to test frankenphp build, only available for macos and linux
|
||||||
$frankenphp = true;
|
$frankenphp = false;
|
||||||
|
|
||||||
// prefer downloading pre-built packages to speed up the build process
|
// prefer downloading pre-built packages to speed up the build process
|
||||||
$prefer_pre_built = false;
|
$prefer_pre_built = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user