From 1d256c8d6e9668e6a526b4c094f72a6ed113b1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=BD=E5=90=A7=EF=BC=8C=E4=BD=A0=E6=83=B3=E8=AF=B4?= =?UTF-8?q?=E5=95=A5?= Date: Mon, 23 Dec 2024 13:37:59 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20curl=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=20(#887)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../download-box/download-box-get-archive-from-server.sh | 2 +- sapi/scripts/download-php-src-archive.php | 2 +- sapi/scripts/generate-artifact-hash.sh | 6 +++--- sapi/src/Preprocessor.php | 4 ++-- setup-php-runtime.sh | 9 ++++----- setup-swoole-cli-runtime.sh | 8 ++++---- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sapi/download-box/download-box-get-archive-from-server.sh b/sapi/download-box/download-box-get-archive-from-server.sh index fadbd0a624..00a70b8a46 100644 --- a/sapi/download-box/download-box-get-archive-from-server.sh +++ b/sapi/download-box/download-box-get-archive-from-server.sh @@ -38,7 +38,7 @@ done URL="${DOMAIN}/all-deps.zip" -test -f all-deps.zip || curl -Lo all-deps.zip ${URL} +test -f all-deps.zip || curl -fSLo all-deps.zip ${URL} # hash 签名 HASH=$(sha256sum all-deps.zip | awk '{print $1}') diff --git a/sapi/scripts/download-php-src-archive.php b/sapi/scripts/download-php-src-archive.php index 0644a48a67..3c193dd247 100644 --- a/sapi/scripts/download-php-src-archive.php +++ b/sapi/scripts/download-php-src-archive.php @@ -7,7 +7,7 @@ $download_dir = dirname($php_archive_file); # 下载 PHP 源码 -$download_cmd = "curl -L https://github.com/php/php-src/archive/refs/tags/php-{$php_version_tag}.tar.gz -o {$php_archive_file}"; +$download_cmd = "curl -fSL https://github.com/php/php-src/archive/refs/tags/php-{$php_version_tag}.tar.gz -o {$php_archive_file}"; echo $download_cmd . PHP_EOL; if (!file_exists($php_archive_file)) { `test -d {$download_dir} || mkdir -p {$download_dir}`; diff --git a/sapi/scripts/generate-artifact-hash.sh b/sapi/scripts/generate-artifact-hash.sh index 4de2b17ac2..b1911e5484 100644 --- a/sapi/scripts/generate-artifact-hash.sh +++ b/sapi/scripts/generate-artifact-hash.sh @@ -99,7 +99,7 @@ UNIX_DOWNLOAD_SWOOLE_CLIE_RUNTIME() { APP_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz" APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" - test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar.xz || curl -fSLo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} } @@ -112,8 +112,8 @@ ARCH="x64" APP_DOWNLOAD_URL="https://github.com/swoole/swoole-cli/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}.zip" APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" -test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} -test -f all-deps.zip || curl -LSo all-deps.zip https://github.com/swoole/swoole-cli/releases/download/${VERSION}/all-deps.zip +test -f ${APP_RUNTIME}.zip || curl -fSLo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} +test -f all-deps.zip || curl -fSLo all-deps.zip https://github.com/swoole/swoole-cli/releases/download/${VERSION}/all-deps.zip ls -p | grep -v '/$' | xargs sha256sum diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 81502ba4ea..e6fb726a73 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -298,7 +298,7 @@ protected function downloadFile(string $url, string $file, ?object $project = nu if ($this->getInputOption('with-downloader') === 'wget') { $cmd = "wget {$url} -O {$file} -t {$retry_number} --wait={$wait_retry} -T {$connect_timeout} "; } else { - $cmd = "curl --connect-timeout {$connect_timeout} --retry {$retry_number} --retry-delay {$wait_retry} -Lo '{$file}' '{$url}' "; + $cmd = "curl --connect-timeout {$connect_timeout} --retry {$retry_number} --retry-delay {$wait_retry} -fSLo '{$file}' '{$url}' "; } echo $cmd; echo PHP_EOL; @@ -786,7 +786,7 @@ public function execute(): void } $this->generateFile(__DIR__ . '/template/make.php', $this->rootDir . '/make.sh'); - shell_exec('chmod a+x '.$this->rootDir . '/make.sh'); + shell_exec('chmod a+x ' . $this->rootDir . '/make.sh'); $this->mkdirIfNotExists($this->rootDir . '/bin'); $this->generateFile(__DIR__ . '/template/license.php', $this->rootDir . '/bin/LICENSE'); $this->generateFile(__DIR__ . '/template/credits.php', $this->rootDir . '/bin/credits.html'); diff --git a/setup-php-runtime.sh b/setup-php-runtime.sh index 05d4a882ee..38f8f1fa14 100644 --- a/setup-php-runtime.sh +++ b/setup-php-runtime.sh @@ -39,7 +39,7 @@ case $ARCH in 'x86_64') ARCH="x64" ;; -'aarch64' | 'arm64' ) +'aarch64' | 'arm64') ARCH="arm64" ;; *) @@ -99,10 +99,10 @@ china) esac -test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +test -f composer.phar || curl -fSLo composer.phar ${COMPOSER_DOWNLOAD_URL} chmod a+x composer.phar -test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} +test -f cacert.pem || curl -fSLo cacert.pem ${CACERT_DOWNLOAD_URL} APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" @@ -115,7 +115,7 @@ if [ $OS = 'windows' ]; then exit 0 } else - test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar.xz || curl -fSLo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz test -f swoole-cli && rm -f swoole-cli tar -xvf ${APP_RUNTIME}.tar @@ -166,4 +166,3 @@ test $OS="macos" && echo "sudo xattr -d com.apple.quarantine ${__PROJECT__}/bin/ echo " " export PATH="${__PROJECT__}/bin/runtime:$PATH" php -v - diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh index 6c06390472..d421602de8 100644 --- a/setup-swoole-cli-runtime.sh +++ b/setup-swoole-cli-runtime.sh @@ -125,24 +125,24 @@ china) esac -test -f composer.phar || curl -LSo composer.phar ${COMPOSER_DOWNLOAD_URL} +test -f composer.phar || curl -fSLo composer.phar ${COMPOSER_DOWNLOAD_URL} chmod a+x composer.phar -test -f cacert.pem || curl -LSo cacert.pem ${CACERT_DOWNLOAD_URL} +test -f cacert.pem || curl -fSLo cacert.pem ${CACERT_DOWNLOAD_URL} APP_RUNTIME="${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}" if [ $OS = 'windows' ]; then { APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" - test -f ${APP_RUNTIME}.zip || curl -LSo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.zip || curl -fSLo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} test -d ${APP_RUNTIME} && rm -rf ${APP_RUNTIME} unzip "${APP_RUNTIME}.zip" echo exit 0 } else - test -f ${APP_RUNTIME}.tar.xz || curl -LSo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} + test -f ${APP_RUNTIME}.tar.xz || curl -fSLo ${APP_RUNTIME}.tar.xz ${APP_DOWNLOAD_URL} test -f ${APP_RUNTIME}.tar || xz -d -k ${APP_RUNTIME}.tar.xz test -f swoole-cli && rm -f swoole-cli tar -xvf ${APP_RUNTIME}.tar From 59f778a4046af495fde29761ccca43e600f14803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=BD=E5=90=A7=EF=BC=8C=E4=BD=A0=E6=83=B3=E8=AF=B4?= =?UTF-8?q?=E5=95=A5?= Date: Mon, 23 Dec 2024 13:38:52 +0800 Subject: [PATCH 02/16] update download-box version (#888) --- sapi/download-box/download-box-get-archive-from-server.sh | 4 ++-- setup-swoole-cli-runtime.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sapi/download-box/download-box-get-archive-from-server.sh b/sapi/download-box/download-box-get-archive-from-server.sh index 00a70b8a46..723656c44a 100644 --- a/sapi/download-box/download-box-get-archive-from-server.sh +++ b/sapi/download-box/download-box-get-archive-from-server.sh @@ -18,9 +18,9 @@ test -d ${__PROJECT__}/var/download-box/ || mkdir -p ${__PROJECT__}/var/download cd ${__PROJECT__}/var/download-box/ -ALL_DEPS_HASH="bdd159b93fd8217e89d206aeb22bf7a8295553db0aff332f049b9025feb31766" +ALL_DEPS_HASH="a55699ecee994032f33266dfa37eabb49f1f6d6b6b65cdcf7b881cac09c63bea" -DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v5.1.5.1/' +DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v6.0.0.0/' while [ $# -gt 0 ]; do case "$1" in diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh index d421602de8..d4785cf1b6 100644 --- a/setup-swoole-cli-runtime.sh +++ b/setup-swoole-cli-runtime.sh @@ -48,9 +48,9 @@ case $ARCH in ;; esac -APP_VERSION='v5.1.5' +APP_VERSION='v6.0.0' APP_NAME='swoole-cli' -VERSION='v5.1.5.1' +VERSION='v6.0.0.0' MIRROR='' while [ $# -gt 0 ]; do From d2c7a3699a8ec29092991f211ace8ecae194a271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=BD=E5=90=A7=EF=BC=8C=E4=BD=A0=E6=83=B3=E8=AF=B4?= =?UTF-8?q?=E5=95=A5?= Date: Wed, 25 Dec 2024 11:14:00 +0800 Subject: [PATCH 03/16] update install cygwin build environment (#889) * update install cygwin build environment * update windows-cygwin.yml * add runner-images.md * runner-images.md --- .github/workflows/runner-images.md | 5 +++++ .github/workflows/windows-cygwin.yml | 14 ++++++++++++- docs/Cygwin.md | 4 ++-- sapi/quickstart/windows/download-cygwin.bat | 22 ++++++++++++++++++++- sapi/quickstart/windows/install-cygwin.bat | 15 +++++++++++++- 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/runner-images.md diff --git a/.github/workflows/runner-images.md b/.github/workflows/runner-images.md new file mode 100644 index 0000000000..cd909a2940 --- /dev/null +++ b/.github/workflows/runner-images.md @@ -0,0 +1,5 @@ +[runner-images](https://github.com/actions/runner-images/tree/main/images) + +[available-images](https://github.com/actions/runner-images?tab=readme-ov-file#available-images) + +[choosing-github-hosted-runners](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners) diff --git a/.github/workflows/windows-cygwin.yml b/.github/workflows/windows-cygwin.yml index da9acd0753..1dccb971bd 100644 --- a/.github/workflows/windows-cygwin.yml +++ b/.github/workflows/windows-cygwin.yml @@ -5,12 +5,22 @@ on: [ push, pull_request ] jobs: windows-cygwin: if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[windows-cygwin]')" - runs-on: windows-latest + runs-on: windows-2022 steps: + - name: Show Environment Info + shell: cmd + run: | + ver + wmic cpu get name, caption, maxclockspeed, status + systeminfo + systeminfo | findstr /B /C:"OS Name" /C:"OS Version" + systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version" + - name: Prepare git run: | git config --global core.autocrlf false git config --global core.eol lf + git config --global core.ignorecase false ipconfig - uses: actions/checkout@v4 @@ -36,6 +46,8 @@ jobs: - name: Install Cygwin uses: cygwin/cygwin-install-action@v2 + with: + site: https://mirrors.kernel.org/sourceware/cygwin/ # with: # platform: x64 # packages: make wget tar libtool re2c bison gcc-g++ autoconf automake openssl libpcre2-devel libssl-devel libcurl-devel libxml2-devel libxslt-devel libgmp-devel ImageMagick libpng-devel libjpeg-devel libfreetype-devel libwebp-devel libsqlite3-devel zlib-devel libbz2-devel liblz4-devel liblzma-devel libzip-devel libicu-devel libonig-devel libcares-devel libsodium-devel libyaml-devel libMagick-devel libzstd-devel libbrotli-devel libreadline-devel libintl-devel libpq-devel libssh2-devel libidn2-devel gettext-devel coreutils openssl-devel zip unzip diff --git a/docs/Cygwin.md b/docs/Cygwin.md index 2c53dd0e44..5c2b1cca9b 100755 --- a/docs/Cygwin.md +++ b/docs/Cygwin.md @@ -14,13 +14,13 @@ ## 安装cygwin 和 cygwin 依赖项 -> 打开 windows 控制台,并找到 setup-x86_64.exe 所在目录, 将 setup-x86_64.exe 复制到 `sapi\quickstart\windows\` 目录 > 执行如下命令 ```bash # 自动安装 cygwin 和 cygwin 依赖项 -sapi\quickstart\windows\install-cygwin.bat +.\sapi\quickstart\windows\download-cygwin.bat +.\sapi\quickstart\windows\install-cygwin.bat ``` diff --git a/sapi/quickstart/windows/download-cygwin.bat b/sapi/quickstart/windows/download-cygwin.bat index 25086a1f0b..684ef9f7af 100644 --- a/sapi/quickstart/windows/download-cygwin.bat +++ b/sapi/quickstart/windows/download-cygwin.bat @@ -1,3 +1,23 @@ @echo off :: cygwin site: https://cygwin.com/ -start https://cygwin.com/setup-x86_64.exe +:: start https://cygwin.com/setup-x86_64.exe + +setlocal + + +echo %~dp0 +cd /d %~dp0 +cd /d ..\..\..\ + +set "__PROJECT__=%cd%" +echo %cd% + +md %__PROJECT__%\var\windows-cygwin-build-deps\ + +cd /d %__PROJECT__%\var\windows-cygwin-build-deps\ + +curl.exe -fSLo setup-x86_64.exe https://cygwin.com/setup-x86_64.exe + +copy .\setup-x86_64.exe %__PROJECT__%\ + +endlocal diff --git a/sapi/quickstart/windows/install-cygwin.bat b/sapi/quickstart/windows/install-cygwin.bat index 66ca23fe2d..3473a4dc6a 100644 --- a/sapi/quickstart/windows/install-cygwin.bat +++ b/sapi/quickstart/windows/install-cygwin.bat @@ -1,5 +1,17 @@ @echo off -:: cygwin安装多个包,包之间,用逗号分隔 +:: cygwin site: https://cygwin.com/ +:: start https://cygwin.com/setup-x86_64.exe + +setlocal + + +echo %~dp0 +cd /d %~dp0 +cd /d ..\..\..\ + +set "__PROJECT__=%cd%" +echo %cd% +:: package separate with commas setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel @@ -9,3 +21,4 @@ setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirr setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages libzstd-devel +endlocal From 2e9d50055e3d334e9318df3d86076f1acb587a6d Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 12:21:25 +0800 Subject: [PATCH 04/16] merge main source code --- sapi/quickstart/windows/install-cygwin.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/sapi/quickstart/windows/install-cygwin.bat b/sapi/quickstart/windows/install-cygwin.bat index a96f387228..3473a4dc6a 100644 --- a/sapi/quickstart/windows/install-cygwin.bat +++ b/sapi/quickstart/windows/install-cygwin.bat @@ -11,10 +11,8 @@ cd /d ..\..\..\ set "__PROJECT__=%cd%" echo %cd% - :: package separate with commas - setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages zip unzip From 004babef15f097b14040381882c73f74252fb199 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 12:22:02 +0800 Subject: [PATCH 05/16] merge main source code --- .github/workflows/runner-images.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/runner-images.md b/.github/workflows/runner-images.md index bc6fa6ed4b..cd909a2940 100644 --- a/.github/workflows/runner-images.md +++ b/.github/workflows/runner-images.md @@ -3,4 +3,3 @@ [available-images](https://github.com/actions/runner-images?tab=readme-ov-file#available-images) [choosing-github-hosted-runners](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners) - From 5b260fa954ccf1eff13f218ab51b06dd19fcfebd Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 15:02:58 +0800 Subject: [PATCH 06/16] update generate-artifact-hash.sh --- sapi/scripts/generate-artifact-hash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/scripts/generate-artifact-hash.sh b/sapi/scripts/generate-artifact-hash.sh index b2826c56f3..94aff47b8b 100644 --- a/sapi/scripts/generate-artifact-hash.sh +++ b/sapi/scripts/generate-artifact-hash.sh @@ -142,7 +142,7 @@ WINDOWS_DOWNLOAD_SWOOLE_CLIE_RUNTIME() { APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" test -f ${APP_RUNTIME}.zip || curl -fSLo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} - test -f all-deps.zip || curl -fSLo all-deps.zip https://github.com/swoole/swoole-cli/releases/download/${VERSION}/all-deps.zip + test -f all-deps.zip || curl -fSLo all-deps.zip https://github.com/swoole/build-static-php/releases/download/${VERSION}/all-deps.zip } WINDOWS_DOWNLOAD() { From 66eb260bac7dd21bc89cb213d73c9c1324a2dd65 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 15:04:16 +0800 Subject: [PATCH 07/16] update artifact-hash.yml --- .github/workflows/artifact-hash.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact-hash.yml b/.github/workflows/artifact-hash.yml index 8dfd945591..fb9e4d13e4 100644 --- a/.github/workflows/artifact-hash.yml +++ b/.github/workflows/artifact-hash.yml @@ -6,7 +6,7 @@ on: version: required: true description: "发版 版本号 tag" - default: 'v1.6.0' + default: 'v1.7.1' type: string php-version: required: true From 348a9cf367d9d0694f21760d70571d8714560109 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 15:13:58 +0800 Subject: [PATCH 08/16] update generate-artifact-hash.sh --- sapi/scripts/generate-artifact-hash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/scripts/generate-artifact-hash.sh b/sapi/scripts/generate-artifact-hash.sh index 94aff47b8b..1116bb2f65 100644 --- a/sapi/scripts/generate-artifact-hash.sh +++ b/sapi/scripts/generate-artifact-hash.sh @@ -142,8 +142,6 @@ WINDOWS_DOWNLOAD_SWOOLE_CLIE_RUNTIME() { APP_RUNTIME="${APP_NAME}-${APP_VERSION}-cygwin-${ARCH}" test -f ${APP_RUNTIME}.zip || curl -fSLo ${APP_RUNTIME}.zip ${APP_DOWNLOAD_URL} - test -f all-deps.zip || curl -fSLo all-deps.zip https://github.com/swoole/build-static-php/releases/download/${VERSION}/all-deps.zip - } WINDOWS_DOWNLOAD() { WINDOWS_DOWNLOAD_SWOOLE_CLIE_RUNTIME "$1" @@ -167,6 +165,8 @@ DOWNLOAD() { } +test -f all-deps.zip || curl -fSLo all-deps.zip https://github.com/swoole/build-static-php/releases/download/${VERSION}/all-deps.zip + DOWNLOAD ls -p | grep -v '/$' | xargs sha256sum From 98c5e6dc7eaf9cc8e7cac98d8ecc9c8f90ee0d12 Mon Sep 17 00:00:00 2001 From: matyhtf Date: Wed, 25 Dec 2024 16:34:55 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E4=B8=BA=20make.sh=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20bash=20=E6=89=A7=E8=A1=8C=E5=BC=95?= =?UTF-8?q?=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/template/make.php | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index 329a7b7c5d..e704f9743b 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -1,3 +1,4 @@ +#!/bin/bash Date: Wed, 25 Dec 2024 16:45:30 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=92=8C=20php=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapi/src/Preprocessor.php | 30 +++++++++---------- ...aph.php => extension_dependency_graph.php} | 0 2 files changed, 15 insertions(+), 15 deletions(-) rename sapi/src/template/{extension_ependency_graph.php => extension_dependency_graph.php} (100%) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index e6fb726a73..5ac72618f8 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -89,7 +89,7 @@ class Preprocessor protected array $endCallbacks = []; protected array $extCallbacks = []; protected array $beforeConfigure = []; - protected string $configureVarables; + protected string $configureVariables; protected string $buildType = 'release'; protected bool $inVirtualMachine = false; @@ -237,12 +237,12 @@ public function setExtraCflags(string $flags) $this->extraCflags = $flags; } - public function setConfigureVarables(string $varables) + public function setConfigureVariables(string $variables): void { - $this->configureVarables = $varables; + $this->configureVariables = $variables; } - public function setExtraOptions(string $options) + public function setExtraOptions(string $options): void { $this->extraOptions = $options; } @@ -279,7 +279,7 @@ public function getBuildType(): string return $this->buildType; } - public function donotInstallLibrary() + public function doNotInstallLibrary(): void { $this->installLibrary = false; } @@ -634,7 +634,7 @@ protected function mkdirIfNotExists(string $dir, int $permissions = 0777, bool $ /** * Scan and load config files in directory */ - protected function scanConfigFiles(string $dir, array &$extAvailabled) + protected function scanConfigFiles(string $dir, array &$extAvailable): void { $files = scandir($dir); foreach ($files as $f) { @@ -643,14 +643,14 @@ protected function scanConfigFiles(string $dir, array &$extAvailabled) } $path = $dir . '/' . $f; if (is_dir($path)) { - $this->scanConfigFiles($path, $extAvailabled); + $this->scanConfigFiles($path, $extAvailable); } else { - $extAvailabled[basename($f, '.php')] = require $path; + $extAvailable[basename($f, '.php')] = require $path; } } } - public function loadDependentExtension($extension_name) + public function loadDependentExtension($extension_name): void { if (!isset($this->extensionMap[$extension_name])) { $file = realpath(__DIR__ . '/builder/extension/' . $extension_name . '.php'); @@ -720,8 +720,8 @@ public function execute(): void $this->mkdirIfNotExists($this->extensionDir, 0777, true); include __DIR__ . '/constants.php'; - $extAvailabled = []; - $this->scanConfigFiles(__DIR__ . '/builder/extension', $extAvailabled); + $extAvailable = []; + $this->scanConfigFiles(__DIR__ . '/builder/extension', $extAvailable); $confPath = $this->getInputOption('conf-path'); if ($confPath) { @@ -730,17 +730,17 @@ public function execute(): void if (!is_dir($dir)) { continue; } - $this->scanConfigFiles($dir, $extAvailabled); + $this->scanConfigFiles($dir, $extAvailable); } } $this->extEnabled = array_unique($this->extEnabled); foreach ($this->extEnabled as $ext) { - if (!isset($extAvailabled[$ext])) { + if (!isset($extAvailable[$ext])) { echo "unsupported extension[$ext]\n"; continue; } - ($extAvailabled[$ext])($this); + ($extAvailable[$ext])($this); if (isset($this->extCallbacks[$ext])) { ($this->extCallbacks[$ext])($this); } @@ -795,7 +795,7 @@ public function execute(): void if ($this->getInputOption('with-dependency-graph')) { $this->generateFile( - __DIR__ . '/template/extension_ependency_graph.php', + __DIR__ . '/template/extension_dependency_graph.php', $this->rootDir . '/bin/ext-dependency-graph.graphviz.dot' ); } diff --git a/sapi/src/template/extension_ependency_graph.php b/sapi/src/template/extension_dependency_graph.php similarity index 100% rename from sapi/src/template/extension_ependency_graph.php rename to sapi/src/template/extension_dependency_graph.php From b3410b05330bfba370f0e454076d43dc77b9c0e1 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 25 Dec 2024 17:05:54 +0800 Subject: [PATCH 11/16] =?UTF-8?q?quickstart=20linux=20=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=90=8D=E7=A7=B0=E4=B8=8E=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linux/run-alpine-container-full.sh | 19 +++++++++---------- sapi/quickstart/linux/run-alpine-container.sh | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sapi/quickstart/linux/run-alpine-container-full.sh b/sapi/quickstart/linux/run-alpine-container-full.sh index d9042de1f4..83039da380 100644 --- a/sapi/quickstart/linux/run-alpine-container-full.sh +++ b/sapi/quickstart/linux/run-alpine-container-full.sh @@ -13,6 +13,7 @@ cd ${__DIR__} { docker stop swoole-cli-alpine-dev + docker stop swoole-cli-builder sleep 5 } || { echo $? @@ -21,7 +22,7 @@ cd ${__DIR__} IMAGE=alpine:3.18 -:<<'EOF' +: <<'EOF' 启动此容器 已经内置了 php 、composer 、 编译好的依赖库 @@ -51,16 +52,16 @@ case $ARCH in 'x86_64') TAG=all-dependencies-alpine-3.18-php8-v1.0.0-x86_64-20240715T132512Z IMAGE=docker.io/jingjingxyk/build-swoole-cli:${TAG} - if [ "$MIRROR" = 'china' ] ; then + if [ "$MIRROR" = 'china' ]; then IMAGE=registry.cn-beijing.aliyuncs.com/jingjingxyk-public/app:${TAG} fi ;; 'aarch64') TAG=all-dependencies-alpine-3.18-php8-v1.0.0-aarch64-20240618T091126Z IMAGE=docker.io/jingjingxyk/build-swoole-cli:${TAG} - if [ "$MIRROR" = 'china' ] ; then - IMAGE=registry.cn-hangzhou.aliyuncs.com/jingjingxyk-public/app:${TAG} - fi + if [ "$MIRROR" = 'china' ]; then + IMAGE=registry.cn-hangzhou.aliyuncs.com/jingjingxyk-public/app:${TAG} + fi ;; *) echo "此 ${ARCH} 架构的容器 容器未配置" @@ -68,14 +69,12 @@ case $ARCH in ;; esac - cd ${__DIR__} -if [ $DEV_SHM -eq 1 ] ; then +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-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 + 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 else - docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null + docker run --rm --name swoole-cli-builder -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 4caaa6f7bf..be9ad82e56 100644 --- a/sapi/quickstart/linux/run-alpine-container.sh +++ b/sapi/quickstart/linux/run-alpine-container.sh @@ -13,6 +13,7 @@ cd ${__DIR__} { docker stop swoole-cli-alpine-dev + docker stop swoole-cli-builder sleep 5 } || { echo $? @@ -37,4 +38,4 @@ while [ $# -gt 0 ]; do done cd ${__DIR__} -docker run --rm --name swoole-cli-alpine-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null +docker run --rm --name swoole-cli-builder -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null From 6fdfe0e84a80529e838e6bbf809eead12fb5179f Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 26 Dec 2024 08:52:18 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E4=BC=98=E5=8C=96=20cygwin=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows-cygwin.yml | 13 +++++- docs/Cygwin.md | 38 +++++++++++++--- .../windows/{ => cygwin-build}/README.md | 8 ++-- .../{ => cygwin-build}/download-cygwin.bat | 2 +- .../windows/cygwin-build/install-cygwin.bat | 43 +++++++++++++++++++ sapi/quickstart/windows/install-cygwin.bat | 24 ----------- sapi/scripts/cygwin/cygwin-build.sh | 12 +++++- sapi/scripts/cygwin/install-cygwin.sh | 4 +- 8 files changed, 104 insertions(+), 40 deletions(-) rename sapi/quickstart/windows/{ => cygwin-build}/README.md (51%) rename sapi/quickstart/windows/{ => cygwin-build}/download-cygwin.bat (95%) create mode 100644 sapi/quickstart/windows/cygwin-build/install-cygwin.bat delete mode 100644 sapi/quickstart/windows/install-cygwin.bat diff --git a/.github/workflows/windows-cygwin.yml b/.github/workflows/windows-cygwin.yml index 1dccb971bd..8fbe287dd2 100644 --- a/.github/workflows/windows-cygwin.yml +++ b/.github/workflows/windows-cygwin.yml @@ -15,6 +15,7 @@ jobs: systeminfo systeminfo | findstr /B /C:"OS Name" /C:"OS Version" systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version" + set - name: Prepare git run: | @@ -52,7 +53,8 @@ jobs: # platform: x64 # packages: make wget tar libtool re2c bison gcc-g++ autoconf automake openssl libpcre2-devel libssl-devel libcurl-devel libxml2-devel libxslt-devel libgmp-devel ImageMagick libpng-devel libjpeg-devel libfreetype-devel libwebp-devel libsqlite3-devel zlib-devel libbz2-devel liblz4-devel liblzma-devel libzip-devel libicu-devel libonig-devel libcares-devel libsodium-devel libyaml-devel libMagick-devel libzstd-devel libbrotli-devel libreadline-devel libintl-devel libpq-devel libssh2-devel libidn2-devel gettext-devel coreutils openssl-devel zip unzip - - name: Install Cygwin Packages + - name: Install Cygwin Packages with bash + if: 0 shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0} run: | ls -lah /cygdrive/c/ @@ -62,11 +64,19 @@ jobs: bash ./sapi/scripts/cygwin/install-cygwin.sh + - name: Install Cygwin Packages + if: 1 + run: | + Copy-Item -Path "C:\setup.exe" -Destination "${{ github.workspace }}\setup-x86_64.exe" + cmd /c .\sapi\quickstart\windows\cygwin-build\install-cygwin.bat + - name: Install re2c + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0} run: | bash ./sapi/scripts/cygwin/install-re2c.sh - name: Configure + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0} run: | uname -a # git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli @@ -75,6 +85,7 @@ jobs: bash ./sapi/scripts/cygwin/cygwin-config.sh - name: Build + shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0} run: | bash ./sapi/scripts/cygwin/cygwin-build.sh diff --git a/docs/Cygwin.md b/docs/Cygwin.md index 5c2b1cca9b..2cd5b047b8 100755 --- a/docs/Cygwin.md +++ b/docs/Cygwin.md @@ -12,21 +12,43 @@ > 命令行同时安装多个包,包名之间使用逗号隔开 +## windows 环境下 配置 git 环境 + +1. 禁止Git在提交和检出时进行换行符的自动转换‌ +2. 使用`lf` 作为换行符 +3. 区分大小写 + +```shell + +# 下载git +curl.exe -fSLo Git-2.47.1-64-bit.exe https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe + +# 命令行静默安装 git +start /wait .\Git-2.47.1-64-bit.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEONEXIT=1 /DIR="C:\Program Files\Git" + + +git config --global core.autocrlf false +git config --global core.eol lf +git config --global core.ignorecase false + +``` + ## 安装cygwin 和 cygwin 依赖项 -> 执行如下命令 +> 打开windows CMD 终端,进入项目目录 ,执行如下命令 ```bash # 自动安装 cygwin 和 cygwin 依赖项 -.\sapi\quickstart\windows\download-cygwin.bat -.\sapi\quickstart\windows\install-cygwin.bat +.\sapi\quickstart\windows\cygwin-build\download-cygwin.bat +.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat + ``` 构建步骤 - 执行的命令 ==== -> 运行如下步骤,需要先 打开 cygwin64 Terminal +> 运行如下步骤,打开 cygwin64 Terminal, 并进入项目目录,执行如下命令 ```shell @@ -122,14 +144,16 @@ libzstd-devel ## 安装 cygwin 和 安装 cygwin 依赖项 具体执行的命令 -> `sapi\quickstart\windows\install-cygwin.bat` 脚本包含的内容 +> 多个包之间 使用逗号分隔 + +> 编辑修改次文件即可 `.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat` ```bash # 安装 cygwin -setup-x86_64.exe --site https://mirrors.ustc.edu.cn/cygwin/ +setup-x86_64.exe --site https://mirrors.ustc.edu.cn/cygwin/ # 安装 cygwin 依赖项 -setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages zip unzip icu libicu-devel diff --git a/sapi/quickstart/windows/README.md b/sapi/quickstart/windows/cygwin-build/README.md similarity index 51% rename from sapi/quickstart/windows/README.md rename to sapi/quickstart/windows/cygwin-build/README.md index f7df0e7867..23937d8589 100644 --- a/sapi/quickstart/windows/README.md +++ b/sapi/quickstart/windows/cygwin-build/README.md @@ -1,15 +1,15 @@ # windows 快速准备构建环境 -## [windows cygwin 环境 构建步骤](../../../docs/Cygwin.md) +## [windows cygwin 环境 构建步骤](../../../../docs/Cygwin.md) ## 双击如下两个脚本,自动下载cygwin 和 cygwin安装依赖库 ```shell # 自动下载 cygwin -sapi\quickstart\windows\download-cygwin.bat -# 自动安装 cygwin -sapi\quickstart\windows\install-cygwin.bat +sapi\quickstart\windows\cygwin-build\download-cygwin.bat +# 自动安装 依赖包 +sapi\quickstart\windows\cygwin-build\install-cygwin.bat ``` diff --git a/sapi/quickstart/windows/download-cygwin.bat b/sapi/quickstart/windows/cygwin-build/download-cygwin.bat similarity index 95% rename from sapi/quickstart/windows/download-cygwin.bat rename to sapi/quickstart/windows/cygwin-build/download-cygwin.bat index 684ef9f7af..1b5e928bf8 100644 --- a/sapi/quickstart/windows/download-cygwin.bat +++ b/sapi/quickstart/windows/cygwin-build/download-cygwin.bat @@ -7,7 +7,7 @@ setlocal echo %~dp0 cd /d %~dp0 -cd /d ..\..\..\ +cd /d ..\..\..\..\ set "__PROJECT__=%cd%" echo %cd% diff --git a/sapi/quickstart/windows/cygwin-build/install-cygwin.bat b/sapi/quickstart/windows/cygwin-build/install-cygwin.bat new file mode 100644 index 0000000000..77a9548927 --- /dev/null +++ b/sapi/quickstart/windows/cygwin-build/install-cygwin.bat @@ -0,0 +1,43 @@ +@echo off +:: cygwin site: https://cygwin.com/ +:: start https://cygwin.com/setup-x86_64.exe + +setlocal enableextensions enabledelayedexpansion + + +echo %~dp0 +cd /d %~dp0 +cd /d ..\..\..\..\ + +set "__PROJECT__=%cd%" +echo %cd% +:: package separate with commas + +set SITE="https://mirrors.kernel.org/sourceware/cygwin/" + +:getopt +if /i "%1" equ "--mirror" ( + if /i "%2" equ "china" ( + set SITE="https://mirrors.ustc.edu.cn/cygwin/" + ) +) +shift + +if not (%1)==() goto getopt + +if "%GITHUB_ACTIONS%"=="" ( + setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site %SITE% +) + + +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils + +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages zip unzip + +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages libpq5 libpq-devel + +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages libzstd-devel + + + +endlocal diff --git a/sapi/quickstart/windows/install-cygwin.bat b/sapi/quickstart/windows/install-cygwin.bat deleted file mode 100644 index 3473a4dc6a..0000000000 --- a/sapi/quickstart/windows/install-cygwin.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off -:: cygwin site: https://cygwin.com/ -:: start https://cygwin.com/setup-x86_64.exe - -setlocal - - -echo %~dp0 -cd /d %~dp0 -cd /d ..\..\..\ - -set "__PROJECT__=%cd%" -echo %cd% -:: package separate with commas - -setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel - -setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages zip unzip - -setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages libpq5 libpq-devel - -setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages libzstd-devel - -endlocal diff --git a/sapi/scripts/cygwin/cygwin-build.sh b/sapi/scripts/cygwin/cygwin-build.sh index 36386243da..1676a3aaa9 100755 --- a/sapi/scripts/cygwin/cygwin-build.sh +++ b/sapi/scripts/cygwin/cygwin-build.sh @@ -13,5 +13,15 @@ cd ${__PROJECT__} mkdir -p bin/.libs # export LDFLAGS="-all-static" -make -j $(nproc) +LOGICAL_PROCESSORS=$(nproc) + +set +u +if [ -n "${GITHUB_ACTION}" ]; then + if test $LOGICAL_PROCESSORS -gt 2; then + LOGICAL_PROCESSORS=$((LOGICAL_PROCESSORS - 1)) + fi +fi +set -u + +make -j $LOGICAL_PROCESSORS ./bin/swoole-cli -v diff --git a/sapi/scripts/cygwin/install-cygwin.sh b/sapi/scripts/cygwin/install-cygwin.sh index 79d61128a9..6971f19e5a 100644 --- a/sapi/scripts/cygwin/install-cygwin.sh +++ b/sapi/scripts/cygwin/install-cygwin.sh @@ -42,10 +42,10 @@ while [ $# -gt 0 ]; do shift $(($# > 0 ? 1 : 0)) done -# setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site http://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel,zip,unzip +# setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site http://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,zip,unzip #setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site http://mirrors.ustc.edu.cn/cygwin/ --packages -setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site $SITE --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel,zip,unzip +setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site $SITE --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,zip,unzip setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site $SITE --packages zip unzip icu libicu-devel setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site $SITE --packages libpq5 libpq-devel setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site $SITE --packages libzstd-devel From be21a4a426d6bd873dc40f454aaf4aab328bd729 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 26 Dec 2024 08:53:38 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E4=BC=98=E5=8C=96=20cygwin=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Cygwin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Cygwin.md b/docs/Cygwin.md index 2cd5b047b8..5fd4679cab 100755 --- a/docs/Cygwin.md +++ b/docs/Cygwin.md @@ -146,7 +146,7 @@ libzstd-devel > 多个包之间 使用逗号分隔 -> 编辑修改次文件即可 `.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat` +> 编辑修改此文件即可 `.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat` ```bash # 安装 cygwin From 6053f465a4cd04dcd986b9d43c6b9fa23b7fb0d8 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 26 Dec 2024 09:29:47 +0800 Subject: [PATCH 14/16] update make.php --- sapi/src/template/make-export-variables.php | 1 + sapi/src/template/make.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sapi/src/template/make-export-variables.php b/sapi/src/template/make-export-variables.php index ce07be8e86..cebdf29ee5 100644 --- a/sapi/src/template/make-export-variables.php +++ b/sapi/src/template/make-export-variables.php @@ -1,3 +1,4 @@ +#!/usr/bin/env bash buildType, ['dev', 'debug'])) : ?> set -x diff --git a/sapi/src/template/make.php b/sapi/src/template/make.php index ea6c60361c..0614192ffa 100755 --- a/sapi/src/template/make.php +++ b/sapi/src/template/make.php @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash Date: Thu, 26 Dec 2024 10:06:52 +0800 Subject: [PATCH 15/16] update --- sapi/quickstart/build-native-php-example.sh | 23 +++++-------------- .../windows}/install-msys2.sh | 0 2 files changed, 6 insertions(+), 17 deletions(-) rename sapi/{scripts/cygwin => quickstart/windows}/install-msys2.sh (100%) diff --git a/sapi/quickstart/build-native-php-example.sh b/sapi/quickstart/build-native-php-example.sh index a1cad4aa9a..63454ab2f1 100644 --- a/sapi/quickstart/build-native-php-example.sh +++ b/sapi/quickstart/build-native-php-example.sh @@ -1,18 +1,16 @@ #!/bin/env bash set -uex - OS=$(uname -s) ARCH=$(uname -m) - export CC=clang export CXX=clang++ export LD=ld.lld -if [ "$OS" = 'Linux' ] ;then +if [ "$OS" = 'Linux' ]; then -: <<'EOF' + : <<'EOF' # setup container environment docker run --rm -ti --init -v .:/work -w /work debian:11 @@ -24,15 +22,12 @@ EOF fi +if [ "$OS" = 'Darwin' ]; then -if [ "$OS" = 'Darwin' ] ;then - -export PATH=/usr/local/opt/bison/bin/:/usr/local/opt/llvm/bin/:$PATH + export PATH=/usr/local/opt/bison/bin/:/usr/local/opt/llvm/bin/:$PATH fi - - mkdir -p /tmp/t cd /tmp/t @@ -53,10 +48,6 @@ tar --strip-components=1 -C mongodb -xf mongodb-${MONGODB_VERSION}.tgz test -d php-src/ext/mongodb && rm -rf php-src/ext/mongodb mv mongodb php-src/ext/ - - - - cd php-src ./buildconf --force @@ -83,13 +74,11 @@ cd php-src make -j $(nproc) - -if [ "$OS" = 'Linux' ] ;then +if [ "$OS" = 'Linux' ]; then file sapi/cli/php readelf -h sapi/cli/php else - otool -L sapi/cli/php + otool -L sapi/cli/php fi - diff --git a/sapi/scripts/cygwin/install-msys2.sh b/sapi/quickstart/windows/install-msys2.sh similarity index 100% rename from sapi/scripts/cygwin/install-msys2.sh rename to sapi/quickstart/windows/install-msys2.sh From d760c882d7a037336f2e084fc6a0db52429f2a19 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 26 Dec 2024 10:34:37 +0800 Subject: [PATCH 16/16] update artifact hash script --- sapi/scripts/generate-artifact-hash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/scripts/generate-artifact-hash.sh b/sapi/scripts/generate-artifact-hash.sh index 1116bb2f65..9df5c8766b 100644 --- a/sapi/scripts/generate-artifact-hash.sh +++ b/sapi/scripts/generate-artifact-hash.sh @@ -36,9 +36,9 @@ case $OS in ;; esac -APP_VERSION='v8.3.13' +APP_VERSION='v8.3.15' APP_NAME='php-cli' -VERSION='v1.6.0' +VERSION='v1.7.1' while [ $# -gt 0 ]; do case "$1" in