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
81 changes: 81 additions & 0 deletions .github/actions/configure-gentoo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: ./configure
inputs:
configurationParameters:
default: ''
required: false
skipSlow:
default: false
required: false
runs:
using: composite
steps:
- shell: bash
run: |
set -x
./buildconf --force
./configure \
--enable-option-checking=fatal \
--prefix=/usr \
--with-libdir=lib64 \
--enable-phpdbg \
--enable-fpm \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
--enable-intl \
--without-pear \
--enable-gd \
--with-jpeg \
--with-webp \
--with-freetype \
--with-xpm \
--enable-exif \
--with-zip \
--with-zlib \
--enable-soap \
--enable-xmlreader \
--with-xsl \
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--enable-pcntl \
--with-readline \
--enable-mbstring \
--with-iconv \
--with-curl \
--with-gettext \
--enable-sockets \
--with-bz2 \
--with-openssl \
--with-gmp \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
--enable-sysvmsg \
--with-ffi \
--enable-zend-test \
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
--with-password-argon2 \
--with-mhash \
--with-sodium \
--enable-dba \
--with-cdb \
--enable-flatfile \
--enable-inifile \
--with-tcadb \
--with-lmdb \
--with-qdbm \
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
--enable-werror \
${{ inputs.configurationParameters }} || cat config.log
34 changes: 34 additions & 0 deletions .github/actions/test-gentoo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test
inputs:
runTestsParameters:
default: ''
required: false
runs:
using: composite
steps:
- shell: bash
run: |
set -x
# XXX: Set up other database tests?
# XXX: These tests are not running containerized
export MYSQL_TEST_USER=ci
export MYSQL_TEST_PASSWD=ci
if [[ -z "$PDO_MYSQL_TEST_DSN" ]]; then
export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
fi
export PDO_MYSQL_TEST_USER=ci
export PDO_MYSQL_TEST_PASS=ci
export PGSQL_TEST_CONNSTR="host=localhost dbname=test port=5432 user=ci password=ci"
if [[ -z "$PDO_PGSQL_TEST_DSN" ]]; then
export PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=ci password=ci"
fi
# Slow tests criteron is doubled because this runner isn't as fast as others
export SKIP_IO_CAPTURE_TESTS=1
export STACK_LIMIT_DEFAULTS_CHECK=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-j$(nproc) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--show-diff \
--show-slow 2000 \
--set-timeout 120
46 changes: 46 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
run_alpine:
required: true
type: boolean
run_linux_ppc64:
required: true
type: boolean
run_macos_arm64:
required: true
type: boolean
Expand All @@ -35,6 +38,49 @@ on:
permissions:
contents: read
jobs:
LINUX_PPC64:
if: inputs.run_linux_ppc64
name: LINUX_PPC64_ASAN_UBSAN_DEBUG_ZTS
# This runs on a self-hosted runner; see https://wiki.php.net/systems/ci
runs-on: [self-hosted, gentoo, ppc64]
steps:
- name: git checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: System info
run: |
echo "::group::Show host CPU info"
lscpu
echo "::endgroup::"
echo "::group::Show installed packages"
cat /var/lib/portage/world
echo "::endgroup::"
- name: ./configure
uses: ./.github/actions/configure-gentoo
with:
configurationParameters: >-
CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC"
LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function"
CC=clang-17
CXX=clang++-17
--enable-debug
--enable-zts
skipSlow: false # FIXME: This should likely include slow extensions
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
# Skip an install action for now
- name: Tests
uses: ./.github/actions/test-gentoo
# There is no PPC JIT, so rip this out
with:
runTestsParameters: >-
--asan -x
- name: Notify Slack
if: failure()
uses: ./.github/actions/notify-slack
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
ALPINE:
if: inputs.run_alpine
name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
libmysqlclient_with_mysqli: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1) }}
run_alpine: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
run_linux_ppc64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
ubuntu_version: ${{
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PHP NEWS
. Extended --ini to print INI settings changed from the builtin default.
(timwolla)
. Drop support for -z CLI/CGI flag. (nielsdos)
. Fixed GH-17956 - development server 404 page does not adapt to mobiles.
(pascalchevrel)

- COM:
. Fixed property access of PHP objects wrapped in variant. (cmb)
Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/php_cli_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ static zend_result php_cli_server_send_error_page(php_cli_server *server, php_cl
escaped_request_uri = php_escape_html_entities_ex((const unsigned char *) ZSTR_VAL(client->request.request_uri), ZSTR_LEN(client->request.request_uri), 0, ENT_QUOTES, NULL, /* double_encode */ 0, /* quiet */ 0);

{
static const char prologue_template[] = "<!doctype html><html><head><title>%d %s</title>";
static const char prologue_template[] = "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>%d %s</title>";
php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(strlen(prologue_template) + 3 + strlen(status_string) + 1);
if (!chunk) {
goto fail;
Expand Down
10 changes: 5 additions & 5 deletions sapi/cli/tests/php_cli_server_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ X-Powered-By: PHP/%s
Content-Type: text/html; charset=UTF-8
Content-Length: %d

<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
Expand All @@ -141,7 +141,7 @@ X-Powered-By: PHP/%s
Content-Type: text/html; charset=UTF-8
Content-Length: %d

<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>404 Not Found</title><style>AAA</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/style.css</code> was not found on this server.</p></body></html>
HTTP/1.1 404 Not Found
Host: %s
Expand All @@ -161,7 +161,7 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><title>405 Method Not Allowed</title><style>AAA</style>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
HTTP/1.1 405 Method Not Allowed
Host: %s
Expand All @@ -172,7 +172,7 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><title>405 Method Not Allowed</title><style>AAA</style>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
HTTP/1.1 405 Method Not Allowed
Host: %s
Expand All @@ -183,5 +183,5 @@ Content-Type: text/html; charset=UTF-8
Content-Length: %d
Allow: GET, HEAD, POST

<!doctype html><html><head><title>405 Method Not Allowed</title><style>AAA</style>
<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>405 Method Not Allowed</title><style>AAA</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not allowed.</p></body></html>
Loading