Skip to content

Commit fe945ab

Browse files
committed
Merge branch 'main' into sapi/cgi
# Conflicts: # composer.lock
2 parents e2b6f4c + d82c86c commit fe945ab

File tree

11 files changed

+40
-22
lines changed

11 files changed

+40
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ packlib_files.txt
3434
/bin/*
3535
!/bin/spc*
3636
!/bin/setup-runtime*
37+
!/bin/docker-entrypoint.sh
3738

3839
# exclude windows build tools
3940
/php-sdk-binary-tools/

bin/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
4+
BACKUP_DIR="/app/pkgroot-private"
5+
# copy private pkgroot to pkgroot if pkgroot is empty
6+
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
7+
echo "* Copying private pkgroot to pkgroot ..."
8+
rm -rf "$TARGET_DIR"
9+
cp -r "$BACKUP_DIR" "$TARGET_DIR"
10+
fi
11+
exec "$@"

bin/setup-runtime

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
2525
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
2626

2727
# set download dir
28-
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
28+
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
2929
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
3030

3131
# use china mirror
@@ -45,7 +45,7 @@ done
4545

4646
case "$mirror" in
4747
china)
48-
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
48+
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
4949
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
5050
;;
5151

bin/spc-alpine-docker

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ COPY ./composer.* /app/
123123
ADD ./bin /app/bin
124124
RUN composer install --no-dev
125125
ADD ./config /app/config
126-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix
127-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
126+
RUN bin/spc doctor --auto-fix
127+
RUN bin/spc install-pkg upx
128+
129+
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
130+
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
131+
RUN chmod +x /bin/docker-entrypoint.sh
132+
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
128133
EOF
129134
fi
130135

bin/spc-gnu-docker

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ ENV SPC_LIBC=glibc
112112
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
113113
114114
ADD ./config /app/config
115-
RUN CC=gcc PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix --debug
116-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
115+
RUN CC=gcc bin/spc doctor --auto-fix --debug
116+
RUN bin/spc install-pkg upx
117117
RUN if [ -f /app/buildroot/bin/re2c ]; then \
118118
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
119119
fi
@@ -133,6 +133,11 @@ RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.ta
133133
make && \
134134
make install && \
135135
ln -sf /usr/local/bin/automake /usr/bin/automake
136+
137+
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
138+
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
139+
RUN chmod +x /bin/docker-entrypoint.sh
140+
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
136141
EOF
137142
fi
138143

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use SPC\exception\ValidationException;
1111
use SPC\exception\WrongUsageException;
1212
use SPC\store\Config;
13-
use SPC\store\CurlHook;
14-
use SPC\store\Downloader;
1513
use SPC\store\FileSystem;
1614
use SPC\store\pkg\GoXcaddy;
1715
use SPC\toolchain\GccNativeToolchain;

src/SPC/util/GlobalEnvManager.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ public static function init(): void
4040
if (is_unix()) {
4141
self::addPathIfNotExists(BUILD_BIN_PATH);
4242
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
43-
// internally use `WORKING_DIR/pkgroot-private` to avoid volume mount issues in Docker
44-
if (is_dir(WORKING_DIR . '/pkgroot-private/bin')) {
45-
self::addPathIfNotExists(WORKING_DIR . '/pkgroot-private/bin');
46-
}
4743
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
4844
}
4945

src/SPC/util/PkgConfigUtil.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static function findPkgConfig(): ?string
2323
{
2424
// Find pkg-config executable
2525
$find_list = [
26-
WORKING_DIR . '/pkgroot-private/bin/pkg-config', // used in Docker build, which is installed inside the container to avoid volume mounting issues
2726
PKG_ROOT_PATH . '/bin/pkg-config',
2827
BUILD_BIN_PATH . '/pkg-config',
2928
];

src/globals/internal-env.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
// output path for shared extensions
2323
define('BUILD_MODULES_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_MODULES_PATH')) ? $a : (BUILD_ROOT_PATH . '/modules')));
2424

25-
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . '/pkgroot')));
25+
// pkg arch name
26+
$_pkg_arch_name = arch2gnu(php_uname('m')) . '-' . strtolower(PHP_OS_FAMILY);
27+
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . "/pkgroot/{$_pkg_arch_name}")));
28+
2629
define('SOURCE_PATH', FileSystem::convertPath(is_string($a = getenv('SOURCE_PATH')) ? $a : (WORKING_DIR . '/source')));
2730
define('DOWNLOAD_PATH', FileSystem::convertPath(is_string($a = getenv('DOWNLOAD_PATH')) ? $a : (WORKING_DIR . '/downloads')));
2831
define('CPU_COUNT', match (PHP_OS_FAMILY) {

0 commit comments

Comments
 (0)