Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 63 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ on:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
push:
branches:
- master
- main
paths-ignore:
- "**.md"
schedule:
- cron: 0 0 * * 5

env:
# Common dependencies for all builds
UBUNTU_DEPS: "autoconf bison build-essential curl gettext git python3 libgd-dev libbz2-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libgmp-dev libreadline-dev libsodium-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev libtidy-dev openssl pkg-config re2c zlib1g-dev ca-certificates wget libtool automake gcc-9 g++-9 libxslt1.1 libxslt1-dev autotools-dev m4 libtool-bin"
MACOS_DEPS: "autoconf automake bison freetype gd gettext icu4c krb5 gmp libedit libiconv libjpeg libpng libsodium libxml2 libzip openssl@3 pkg-config re2c zlib bzip2 python3"
# Build dependencies from the README. Optional GMP and sodium are not tested here.
UBUNTU_DEPS: "autoconf bison build-essential curl git python3 pkg-config re2c ca-certificates libbz2-dev libcurl4-openssl-dev libicu-dev libjpeg-dev libpng-dev libonig-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev zlib1g-dev libxslt1-dev libtidy-dev"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Removing gcc-9 g++-9 from UBUNTU_DEPS silently switches the legacy Ubuntu PHP builds from gcc-9 to the default gcc. The matrix comment still says gcc-9 is used for legacy builds. Restore gcc-9 g++-9 if those builds should keep using it; otherwise update that comment and call out the change.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/workflow.yml, line 18:

<comment>Removing `gcc-9 g++-9` from `UBUNTU_DEPS` silently switches the legacy Ubuntu PHP builds from gcc-9 to the default gcc. The matrix comment still says gcc-9 is used for legacy builds. Restore `gcc-9 g++-9` if those builds should keep using it; otherwise update that comment and call out the change.</comment>

<file context>
@@ -6,21 +6,17 @@ on:
-  UBUNTU_DEPS: "autoconf bison build-essential curl gettext git python3 libgd-dev libbz2-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libgmp-dev libreadline-dev libsodium-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev libtidy-dev openssl pkg-config re2c zlib1g-dev ca-certificates wget libtool automake gcc-9 g++-9 libxslt1.1 libxslt1-dev autotools-dev m4 libtool-bin"
-  MACOS_DEPS: "autoconf automake bison freetype gd gettext icu4c krb5 gmp libedit libiconv libjpeg libpng libsodium libxml2 libzip openssl@3 pkg-config re2c zlib bzip2 python3"
+  # Build dependencies from the README. Optional GMP and sodium are not tested here.
+  UBUNTU_DEPS: "autoconf bison build-essential curl git python3 pkg-config re2c ca-certificates libbz2-dev libcurl4-openssl-dev libicu-dev libjpeg-dev libpng-dev libonig-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev zlib1g-dev libxslt1-dev libtidy-dev"
+  MACOS_DEPS: "autoconf bison bzip2 icu4c libedit libiconv libjpeg libpng libxml2 libxslt libzip openssl@3 pkg-config re2c zlib python3"
 
</file context>

MACOS_DEPS: "autoconf bison bzip2 icu4c libedit libiconv libjpeg libpng libxml2 libxslt libzip openssl@3 pkg-config re2c zlib python3"

jobs:
plugin_test:
Expand Down Expand Up @@ -77,6 +73,8 @@ jobs:
sudo apt-get install -y ${{ env.UBUNTU_DEPS }}
elif [ "${{ runner.os }}" = "macOS" ]; then
brew install ${{ env.MACOS_DEPS }}
# Exercise the documented optional tidy extension in CI.
brew install tidy-html5
# Set up macOS-specific environment for PHP build
echo "CXXFLAGS=-std=c++17 -stdlib=libc++" >> $GITHUB_ENV
# Set up library paths for configure to find dependencies
Expand Down Expand Up @@ -186,7 +184,7 @@ jobs:
echo "Installation path: $(asdf where php)"

# php --ri exits non-zero when an extension is not loaded
for ext in openssl curl sodium gmp; do
for ext in openssl curl intl mbstring zip gd xsl bz2 pdo_sqlite tidy; do
php --ri "$ext" >/dev/null || { echo "✗ $ext extension missing"; exit 1; }
echo "✓ $ext"
done
Expand Down Expand Up @@ -240,3 +238,60 @@ jobs:
sudo apt-get install -y bats
- name: Run tests and installer line-count gate
run: make test linecount-check

arch:
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
runs-on: ubuntu-latest
timeout-minutes: 45
container:
image: archlinux:base@sha256:b1c2fe6e717bfd5673af8fc217e1e1c3ce0dcbb1d53c3414c8425e7ce79fc6d9
steps:
- name: Install system packages
run: pacman -Syu --noconfirm --needed bash curl git nodejs autoconf bison gcc make re2c pkgconf python ca-certificates libxml2 sqlite oniguruma libzip libjpeg-turbo libpng icu openssl readline zlib bzip2 libxslt tidy
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup asdf
uses: asdf-vm/actions/setup@v4
- name: Build and check PHP latest
shell: bash
run: |
set -euo pipefail
asdf plugin add php "$GITHUB_WORKSPACE"
if ! asdf install php latest; then
find "${TMPDIR:-/tmp}" /tmp -name 'php-build.*.log' -type f -print -exec tail -150 {} \; 2>/dev/null || true
exit 1
fi
asdf set php latest
php --version
for ext in openssl curl intl mbstring zip gd xsl bz2 pdo_sqlite tidy; do
php --ri "$ext" >/dev/null
printf '✓ %s\n' "$ext"
done

fedora:
runs-on: ubuntu-latest
container:
image: fedora:44
steps:
- name: Install system packages
run: dnf install -y bash curl git nodejs autoconf bison gcc gcc-c++ make re2c pkgconf-pkg-config python3 ca-certificates libxml2-devel sqlite-devel oniguruma-devel libcurl-devel libzip-devel libjpeg-turbo-devel libpng-devel libicu-devel openssl-devel readline-devel zlib-devel bzip2-devel libxslt-devel libtidy-devel
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup asdf
uses: asdf-vm/actions/setup@v4
- name: Build and check PHP latest
shell: bash
run: |
set -euo pipefail
asdf plugin add php "$GITHUB_WORKSPACE"
if ! asdf install php latest; then
find "${TMPDIR:-/tmp}" /tmp -name 'php-build.*.log' -type f -print -exec tail -150 {} \; 2>/dev/null || true
exit 1
fi
asdf set php latest
php --version
for ext in openssl curl intl mbstring zip gd xsl bz2 pdo_sqlite tidy; do
php --ri "$ext" >/dev/null
printf '✓ %s\n' "$ext"
done
49 changes: 39 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,48 @@ for your system:
### Ubuntu and Debian

```bash
sudo apt-get install -y autoconf bison build-essential curl gettext git python3 \
libgd-dev libbz2-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev \
libmysqlclient-dev libonig-dev libpng-dev libpq-dev libgmp-dev libreadline-dev \
libsodium-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev libtidy-dev \
openssl pkg-config re2c zlib1g-dev ca-certificates wget libtool automake \
gcc-9 g++-9 libxslt1.1 libxslt1-dev autotools-dev m4 libtool-bin
sudo apt-get install -y autoconf bison build-essential curl git python3 \
pkg-config re2c ca-certificates libbz2-dev libcurl4-openssl-dev libicu-dev \
libjpeg-dev libpng-dev libonig-dev libreadline-dev libsqlite3-dev libssl-dev \
libxml2-dev libzip-dev zlib1g-dev libxslt1-dev libtidy-dev
```

### Arch Linux

```bash
sudo pacman -Syu --needed autoconf bison gcc make re2c pkgconf curl git python \
ca-certificates libxml2 sqlite oniguruma libzip libjpeg-turbo libpng icu \
openssl readline zlib bzip2 libxslt tidy
```

### Fedora 44

```bash
sudo dnf install autoconf bison gcc gcc-c++ make re2c curl git python3 \
pkgconf-pkg-config ca-certificates libxml2-devel sqlite-devel oniguruma-devel \
libcurl-devel libzip-devel libjpeg-turbo-devel libpng-devel \
libicu-devel openssl-devel readline-devel zlib-devel bzip2-devel libxslt-devel \
libtidy-devel
```

`GMP` and `sodium` support is enabled when their development libraries are present.
These extensions are optional. On Ubuntu or Debian install `libgmp-dev` and
`libsodium-dev`; on Arch install `gmp` and `libsodium`; on Fedora install `gmp-devel`
and `libsodium-devel`; on macOS install `gmp` and `libsodium` with Homebrew.
PostgreSQL support is optional too. Install `libpq-dev` on Ubuntu or Debian,
`postgresql-libs` on Arch, `libpq-devel` on Fedora, or `libpq` with Homebrew, then
pass `--with-pgsql` through `PHP_CONFIGURE_OPTIONS`. `GD` uses PHP's bundled library,
so an OS `gd` development package is unnecessary. For `FreeType` font support in `GD`,
install `libfreetype6-dev` on Ubuntu or Debian, `freetype2` on Arch, `freetype-devel`
on Fedora, or `freetype` with Homebrew. `php-build` enables tidy by default on Linux,
except for PHP 7.4 and PHP 8.0 releases before 8.0.20. These package lists include
the tidy dependency.

### macOS

```bash
brew install autoconf automake bison freetype gd gettext icu4c krb5 gmp \
libedit libiconv libjpeg libpng libsodium libxml2 libzip openssl@3 \
pkg-config re2c zlib bzip2 python3
brew install autoconf bison bzip2 icu4c libedit libiconv libjpeg libpng \
libxml2 libxslt libzip openssl@3 pkg-config re2c zlib python3
```

For the optional tidy extension, run `brew install tidy-html5`.
Expand Down Expand Up @@ -83,7 +111,8 @@ before installing it. Set `ASDF_PHP_OPENSSL_AUTO=yes` for unattended builds.
- If php-build is missing from a source checkout, run
`git submodule update --init --recursive vendor/php-build` there.
- php-build writes logs under `${TMPDIR:-/tmp}`. After a build starts, watch them
with `tail -f "${TMPDIR:-/tmp}"/php-build.*.log`.
with `tail -f "${TMPDIR:-/tmp}"/php-build.*.log`. Configure errors name the
missing library or header.

See [local testing](docs/local-testing-manually.md) for a disposable install
recipe.
Expand Down
Loading