Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-built lib feature, and more bugfix for 2.3 #502

Merged
merged 43 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fc05325
Add pre-built lib feature
crazywhalecc Jul 7, 2024
ff8863d
Code style fix and comment addition
crazywhalecc Jul 7, 2024
fc61713
Add pack-lib tests
crazywhalecc Jul 7, 2024
14ce15c
Add pack-lib tests
crazywhalecc Jul 7, 2024
91e089d
Remove windows with pkg-config
crazywhalecc Jul 7, 2024
cc7f9fb
Remove windows with pkg-config
crazywhalecc Jul 7, 2024
ac5f191
Fix CI
crazywhalecc Jul 7, 2024
768fd0d
Fix CI
crazywhalecc Jul 7, 2024
730d304
Use bash in windows
crazywhalecc Jul 7, 2024
9a954bd
Fix CI
crazywhalecc Jul 7, 2024
6cb2b3f
Fix CI
crazywhalecc Jul 7, 2024
9c8b525
Fix CI
crazywhalecc Jul 7, 2024
884d7bf
Add aarch64-linux to CI
crazywhalecc Jul 7, 2024
28b336c
Fix CI quote
crazywhalecc Jul 7, 2024
0c30fc2
Fix alpine-docker ssl bug
crazywhalecc Jul 7, 2024
467c7ae
Remove icu tools
crazywhalecc Jul 7, 2024
cedd584
Patch sqlite pkgconf file
crazywhalecc Jul 7, 2024
125d6ca
Add liblz4, sqlite for pre-built libs
crazywhalecc Jul 7, 2024
b8f63ec
Fix windows sqlite portable build
crazywhalecc Jul 7, 2024
5ec194e
Remove initSource for sorted libs in WindowsBuilder
crazywhalecc Jul 8, 2024
8ec50c8
Remove perl.exe check log in doctor
crazywhalecc Jul 8, 2024
8cec136
Add openssl to pre-built
crazywhalecc Jul 8, 2024
32a98bb
Add license installer for build mode
crazywhalecc Jul 8, 2024
ce15598
Remove suffix for LicenseDumper and LicenseDumperTest
crazywhalecc Jul 8, 2024
48294c9
Add brotli, libargon2, libavif, libiconv, libpng, libtiff pre-built libs
crazywhalecc Jul 8, 2024
a950498
Add timer for build libs
crazywhalecc Jul 8, 2024
4b44c3a
Adjust shell debug log
crazywhalecc Jul 8, 2024
8632a4e
Add onig as pre-built library
crazywhalecc Jul 8, 2024
491eb5c
Fix pkgconf patch with space between '=' bug
crazywhalecc Jul 9, 2024
1c79cc9
Provide icu pre-built binary
crazywhalecc Jul 9, 2024
80effd0
Provide libcares pre-built binary
crazywhalecc Jul 9, 2024
57dd174
Provide libevent, libiconv-win, libsodium, libwebp, libyaml, ncurses,…
crazywhalecc Jul 9, 2024
942786f
Add pkgroot for spc-alpine-docker
crazywhalecc Jul 9, 2024
65ace41
Add pkgroot for spc-alpine-docker
crazywhalecc Jul 9, 2024
1d7ded0
Fix pre-built openssl cannot find source in openssl ext patch
crazywhalecc Jul 9, 2024
54573df
Fix swoole with event extension <util.h> conflict bug
crazywhalecc Jul 9, 2024
01c78aa
Remove redundant license debug msg
crazywhalecc Jul 9, 2024
abdbaa1
Remove libiconv-win pre-built
crazywhalecc Jul 12, 2024
4e26dc8
Disable libyuv for libavif
crazywhalecc Jul 12, 2024
483ecd7
Fix opcache for windows not build bug
crazywhalecc Jul 12, 2024
d796d5a
Tests
crazywhalecc Jul 13, 2024
ddea35f
Tests pre-built feature
crazywhalecc Jul 13, 2024
01518b4
Update docs
crazywhalecc Jul 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build-linux-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ on:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean

env:
Expand Down Expand Up @@ -73,6 +78,8 @@ jobs:
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV

# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
Expand All @@ -84,7 +91,7 @@ jobs:

# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}

# Run build command
- run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ on:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean

env:
Expand Down Expand Up @@ -67,6 +72,8 @@ jobs:
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV

# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
Expand All @@ -78,7 +85,7 @@ jobs:

# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}

# Run build command
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ on:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean

env:
Expand Down Expand Up @@ -82,6 +87,8 @@ jobs:
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV

# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
Expand All @@ -93,7 +100,7 @@ jobs:

# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}

# Run build command
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ on:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean

env:
Expand Down Expand Up @@ -80,6 +85,8 @@ jobs:
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV

# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
Expand All @@ -91,7 +98,7 @@ jobs:

# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}

# Run build command
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-windows-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ on:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean

env:
Expand Down Expand Up @@ -65,6 +70,8 @@ jobs:
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $env:GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV

# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
Expand All @@ -76,7 +83,7 @@ jobs:

# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: ./bin/spc download --with-php="${{ inputs.version }}" --for-extensions="${{ inputs.extensions }}" ${{ env.SPC_BUILD_DEBUG }}
run: ./bin/spc download --with-php="${{ inputs.version }}" --for-extensions="${{ inputs.extensions }}" ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}

# Run build command
- run: ./bin/spc build "${{ inputs.extensions }}" ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,18 @@ jobs:

- name: "Run Build Tests (download)"
run: |
bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --for-libs="$(php src/globals/test-extensions.php libs)" --with-php=${{ matrix.php }} --ignore-cache-sources=php-src --debug --retry=5 --shallow-clone
bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --for-libs="$(php src/globals/test-extensions.php libs)" --with-php=${{ matrix.php }} --ignore-cache-sources=php-src --debug --retry=5 --shallow-clone --prefer-pre-built

- name: "Download pre-built libraries for pkg-config"
if: matrix.os != 'windows-latest'
run: |
bin/spc del-download pkg-config
bin/spc download pkg-config --prefer-pre-built --debug

- name: "Run Build Tests (build, *nix)"
if: matrix.os != 'windows-latest'
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --build-fpm --debug

- name: "Run Build Tests (build, windows)"
if: matrix.os == 'windows-latest'
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $env:UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --debug --enable-micro-win32
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $env:UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --debug
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ docker/source/
# default package root directory
/pkgroot/

# default pack:lib and release directory
/dist/
packlib_files.txt

# tools cache files
.php-cs-fixer.cache
.phpunit.result.cache
Expand Down
20 changes: 13 additions & 7 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ static-php-cli(简称 `spc`)有许多特性:

如果你不想自行编译 PHP,可以从本项目现有的示例 Action 下载 Artifact,也可以从自托管的服务器下载。

- [扩展组合 - common](https://dl.static-php.dev/static-php-cli/common/):common 组合包含了约 [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) 个常用扩展,体积为 7.5MB 左右。
- [扩展组合 - bulk](https://dl.static-php.dev/static-php-cli/bulk/):bulk 组合包含了 [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) 个扩展,体积为 25MB 左右。
- [扩展组合 - minimal](https://dl.static-php.dev/static-php-cli/minimal/):minimal 组合包含了 [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) 个扩展,体积为 3MB 左右。
| 组合名称 | 组合扩展数 | 系统 | 备注 |
|---------------------------------------------------------------------|----------------------------------------------------------------------------|-------------|--------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux/macOS | 体积为 7.5MB 左右 |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux/macOS | 体积为 25MB 左右 |
| [minimal](https://dl.static-php.dev/static-php-cli/minimal/) | [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) | Linux/macOS | 体积为 3MB 左右 |
| [spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min) | [5](https://dl.static-php.dev/static-php-cli/windows/spc-min/README.txt) | Windows | 体积为 3MB 左右 |
| [spc-max](https://dl.static-php.dev/static-php-cli/windows/spc-max) | [40+](https://dl.static-php.dev/static-php-cli/windows/spc-max/README.txt) | Windows | 体积为 8.5MB 左右 |

> Linux 和 Windows 默认启用了 UPX 压缩,可减小 30~50% 的 PHP 二进制体积。
> macOS 当前不支持 UPX,所以上述预编译的 macOS 版本体积可能较大。

对于 Windows 系统,目前支持的扩展较少,故仅提供 SPC 自身运行的最小扩展组合的 `cli` 和 `micro`:[扩展组合 - spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min/)。

## 使用 static-php-cli 构建 PHP

### 编译环境需求
Expand Down Expand Up @@ -110,7 +112,7 @@ static-php-cli(简称 `spc`)有许多特性:

如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

### 本地构建(使用 spc 二进制)
### 本地构建(使用 spc 二进制,推荐

该项目提供了 static-php-cli 的二进制文件:`spc`。
您可以使用 `spc` 二进制文件,无需安装任何运行时(用起来就像 golang 程序)。
Expand Down Expand Up @@ -144,6 +146,8 @@ chmod +x ./spc

### 本地构建(使用 git 源码)

如果你需要修改 static-php-cli 源码,或者使用 spc 二进制构建有问题,你可以使用 git 源码下载 static-php-cli。

```bash
# clone 仓库即可
git clone https://github.com/crazywhalecc/static-php-cli.git
Expand Down Expand Up @@ -177,14 +181,16 @@ bin/spc --version
./bin/spc download --all
# 只拉取编译指定扩展需要的所有依赖(推荐)
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
# 下载依赖时,优先下载有预编译的库(节省编译依赖的时间)
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
# 下载编译不同版本的 PHP (--with-php=x.y,推荐 7.3 ~ 8.3)
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1

# 构建包含 bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl 扩展的 php-cli 和 micro.sfx
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
# 编译线程安全版本 (--enable-zts)
./bin/spc build "curl,phar" --enable-zts --build-cli
# 编译后使用 UPX 减小可执行文件体积 (--with-upx-pack) (至少压缩至原来的 30~50%)
# 编译后使用 UPX 减小可执行文件体积 (仅 Linux、Windows 可用) (至少压缩至原来的 30~50%)
./bin/spc build "curl,phar" --enable-zts --build-cli --with-upx-pack
```

Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ If you don't want to build or want to test first, you can download example pre-c
Below are several precompiled static-php binaries with different extension combinations,
which can be downloaded directly according to your needs.

- [Extension-Combination - common](https://dl.static-php.dev/static-php-cli/common/): `common` contains about [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) commonly used extensions, and the size is about 7.5MB.
- [Extension-Combination - bulk](https://dl.static-php.dev/static-php-cli/bulk/): `bulk` contains [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) extensions and is about 25MB in size.
- [Extension-Combination - minimal](https://dl.static-php.dev/static-php-cli/minimal/): `minimal` contains [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) extensions and is about 3MB in size.
| Combination | Extension Count | OS | Comment |
|----------------------------------------------------------------------|---------------------------------------------------------------------------|--------------|--------------------------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux, macOS | The binary size is about 7.5MB |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | The binary size is about 25MB |
| [minimal](https://dl.static-php.dev/static-php-cli/minimal/) | [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) | Linux, macOS | The binary size is about 3MB |
| [spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min/) | [5](https://dl.static-php.dev/static-php-cli/windows/spc-min/README.txt) | Windows | The binary size is about 3MB |
| [spc-max](https://dl.static-php.dev/static-php-cli/windows/spc-max/) | [10](https://dl.static-php.dev/static-php-cli/windows/spc-max/README.txt) | Windows | The binary size is about 8.5MB |

> Linux and Windows supports UPX compression for binaries, which can reduce the size of the binary by 30% to 50%.
> macOS does not support UPX compression, so the size of the pre-built binaries for mac is larger.

For Windows systems, there are currently fewer extensions supported,
so only `cli` and `micro` that run the minimum extension combination of SPC itself are provided: [Extension-Combination - spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min/).

## Build

### Compilation Requirements
Expand Down Expand Up @@ -97,6 +98,7 @@ Currently supported PHP versions for compilation:
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :x: | WIP |

### Supported Extensions

Expand All @@ -121,7 +123,7 @@ and at the same time define the extensions to be compiled by yourself.

If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.

### Build Locally (using SPC binary)
### Build Locally (using SPC binary, recommended)

This project provides a binary file of static-php-cli: `spc`.
You can use `spc` binary instead of installing any runtime like golang app.
Expand Down Expand Up @@ -155,6 +157,9 @@ Self-hosted `spc` is built by GitHub Actions, you can also download from Actions

### Build Locally (using git source)

If you need to modify the static-php-cli source code, or have problems using the spc binary build,
you can download static-php-cli using the git source code.

```bash
# just clone me!
git clone https://github.com/crazywhalecc/static-php-cli.git
Expand Down Expand Up @@ -188,14 +193,16 @@ Basic usage for building php with some extensions:
./bin/spc download --all
# only fetch necessary sources by needed extensions (recommended)
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
# download pre-built libraries first (save time for compiling dependencies)
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
# download different PHP version (--with-php=x.y, recommend 7.3 ~ 8.3)
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1

# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
# build thread-safe (ZTS) version (--enable-zts)
./bin/spc build "curl,phar" --enable-zts --build-cli
# build, pack executable with UPX (--with-upx-pack) (reduce binary size for 30~50%)
# build, pack executable with UPX (linux and windows only) (reduce binary size for 30~50%)
./bin/spc build "curl,phar" --enable-zts --build-cli --with-upx-pack
```

Expand Down
16 changes: 15 additions & 1 deletion bin/spc-alpine-docker
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH; then
FROM $ALPINE_FROM
$SPC_USE_MIRROR
RUN apk update; \
apk upgrade -a; \
apk add --no-cache \
autoconf \
automake \
Expand Down Expand Up @@ -108,6 +109,19 @@ else
INTERACT=''
fi

# Mounting volumes
MOUNT_LIST=""
# shellcheck disable=SC2089
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/config:/app/config"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/src:/app/src"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/buildroot:/app/buildroot"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"

# Run docker
# shellcheck disable=SC2068
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" -v "$(pwd)"/config:/app/config -v "$(pwd)"/src:/app/src -v "$(pwd)"/buildroot:/app/buildroot -v "$(pwd)"/source:/app/source -v "$(pwd)"/downloads:/app/downloads cwcc-spc-$SPC_USE_ARCH bin/spc $@
# shellcheck disable=SC2086
# shellcheck disable=SC2090
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH bin/spc $@
2 changes: 1 addition & 1 deletion config/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
},
"opcache": {
"type": "builtin",
"arg-type": "custom"
"arg-type-unix": "custom"
},
"openssl": {
"notes": true,
Expand Down
Loading
Loading