diff --git a/.github/workflows/windows-cygwin.yml b/.github/workflows/windows-cygwin.yml index 4d42ae7579..8596c55a57 100644 --- a/.github/workflows/windows-cygwin.yml +++ b/.github/workflows/windows-cygwin.yml @@ -38,6 +38,8 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf git config --global core.ignorecase false + git config --global --add safe.directory ${{ github.workspace }} + ipconfig - uses: actions/checkout@v4 - name: set php version @@ -95,7 +97,7 @@ jobs: run: | bash ./sapi/scripts/cygwin/install-re2c.sh - - name: Configure + - name: Prepare shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0} run: | # git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli diff --git a/sapi/quickstart/linux/connection-swoole-cli-alpine.sh b/sapi/quickstart/linux/connection-swoole-cli-alpine.sh index a90c7ed051..e8720ba5bc 100644 --- a/sapi/quickstart/linux/connection-swoole-cli-alpine.sh +++ b/sapi/quickstart/linux/connection-swoole-cli-alpine.sh @@ -8,4 +8,4 @@ __DIR__=$( cd ${__DIR__} -docker exec -it woole-cli-builder sh +docker exec -it swoole-cli-alpine-dev sh diff --git a/sapi/quickstart/linux/extra/README.md b/sapi/quickstart/linux/extra/README.md index 834af2ec84..6d91c5a293 100644 --- a/sapi/quickstart/linux/extra/README.md +++ b/sapi/quickstart/linux/extra/README.md @@ -17,6 +17,7 @@ bash sapi/quickstart/linux/extra/debian-php-init.sh ## 安装 `Composer` ```bash + curl -Lo /usr/local/bin/composer.phar https://getcomposer.org/download/latest-stable/composer.phar ln -sf /usr/local/bin/composer.phar /usr/local/bin/composer diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index 4de8062389..7a2ca6750c 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -12,7 +12,7 @@ __PROJECT__=$( cd ${__DIR__} { - docker stop swoole-cli-builder + docker stop swoole-cli-alpine-dev sleep 5 } || { echo $? @@ -74,7 +74,7 @@ cd ${__DIR__} if [ $DEV_SHM -eq 1 ]; then mkdir -p /dev/shm/swoole-cli/thirdparty/ mkdir -p /dev/shm/swoole-cli/ext/ - docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ -v /dev/shm/swoole-cli/ext/:/work/ext/ -w /work --init $IMAGE tail -f /dev/null + docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ -v /dev/shm/swoole-cli/ext/:/work/ext/ -w /work --init $IMAGE tail -f /dev/null else - docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null + docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null fi diff --git a/sapi/quickstart/linux/run-alpine-container.sh b/sapi/quickstart/linux/run-alpine-container.sh index c402ac11f2..b2c8f09b27 100644 --- a/sapi/quickstart/linux/run-alpine-container.sh +++ b/sapi/quickstart/linux/run-alpine-container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( @@ -12,7 +12,7 @@ __PROJECT__=$( cd ${__DIR__} { - docker stop swoole-cli-builder + docker stop swoole-cli-alpine-dev sleep 5 } || { echo $? @@ -37,4 +37,4 @@ while [ $# -gt 0 ]; do done cd ${__DIR__} -docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null +docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null diff --git a/sapi/quickstart/linux/run-debian-container.sh b/sapi/quickstart/linux/run-debian-container.sh index b58527b544..c2fe991bcb 100644 --- a/sapi/quickstart/linux/run-debian-container.sh +++ b/sapi/quickstart/linux/run-debian-container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exu __DIR__=$( diff --git a/sapi/quickstart/linux/run-swoole-cli-builder-container.sh b/sapi/quickstart/linux/run-swoole-cli-builder-container.sh new file mode 100644 index 0000000000..0086bd38e3 --- /dev/null +++ b/sapi/quickstart/linux/run-swoole-cli-builder-container.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -exu +__DIR__=$( + cd "$(dirname "$0")" + pwd +) +__PROJECT__=$( + cd ${__DIR__}/../../../ + pwd +) +cd ${__PROJECT__} + +MIRROR='' +OPTIONS='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + case "$MIRROR" in + china) + MIRROR="$2" + OPTIONS=" --mirror china " + ;; + esac + + ;; + esac + shift $(($# > 0 ? 1 : 0)) +done + +bash setup-php-runtime.sh ${OPTIONS} +export PATH=${__PROJECT__}/bin/runtime:$PATH +alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem " + +if [ "$MIRROR" = 'china' ]; then + composer config -g repos.packagist composer https://mirrors.tencent.com/composer/ +fi + +composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev +composer dump-autoload --optimize --profile + +if [ "$MIRROR" = 'china' ]; then + composer config -g --unset repos.packagist +fi + +php ./prepare.php --skip-download=yes --without-docker=yes + +bash make.sh docker-build ${MIRROR} +bash make.sh docker-bash diff --git a/sapi/quickstart/windows/cygwin-build/README.md b/sapi/quickstart/windows/cygwin-build/README.md index 7008106bc5..e999b615e9 100644 --- a/sapi/quickstart/windows/cygwin-build/README.md +++ b/sapi/quickstart/windows/cygwin-build/README.md @@ -14,5 +14,3 @@ sapi\quickstart\windows\cygwin-build\install-cygwin.bat ``` - - diff --git a/sapi/quickstart/windows/msys2-build/install-msys2.md b/sapi/quickstart/windows/msys2-build/install-msys2.md index 1780674931..9c58998b40 100644 --- a/sapi/quickstart/windows/msys2-build/install-msys2.md +++ b/sapi/quickstart/windows/msys2-build/install-msys2.md @@ -36,6 +36,5 @@ pacman -Syy --noconfirm openssl-devel libreadline # msys2 环境下 拉取 swoole-cli 源码 git clone --recursive https://github.com:swoole/swoole-cli.git - ``` diff --git a/sapi/scripts/cygwin/cygwin-build.sh b/sapi/scripts/cygwin/cygwin-build.sh index 00f0d1e8f3..5b296d8b23 100755 --- a/sapi/scripts/cygwin/cygwin-build.sh +++ b/sapi/scripts/cygwin/cygwin-build.sh @@ -13,6 +13,7 @@ cd ${__PROJECT__} cd ${__PROJECT__}/php-src mkdir -p bin/.libs +# export LDFLAGS="-all-static" LOGICAL_PROCESSORS=$(nproc)