Skip to content

Switch to Ubuntu 22.04 for GitHub actions jobs #10814

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions .github/actions/setup-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ runs:
set -x

sudo service mysql start
sudo service postgresql start
sudo service slapd start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
sudo -u postgres psql -c "CREATE DATABASE test;"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
sudo locale-gen de_DE

./.github/scripts/setup-slapd.sh &>/dev/null
./.github/scripts/setup-slapd.sh

sudo cp ext/snmp/tests/snmpd.conf /etc/snmp
sudo cp ext/snmp/tests/bigtest /etc/snmp
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/test-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ runs:
export PDO_OCI_TEST_USER="system"
export PDO_OCI_TEST_PASS="pass"
export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
export PGSQL_TEST_CONNSTR="host=postgres dbname=test port=5432 user=postgres password=postgres"
export PDO_PGSQL_TEST_DSN="host=postgres dbname=test port=5432 user=postgres password=postgres"
export SKIP_IO_CAPTURE_TESTS=1
export TEST_PHP_JUNIT=junit.out.xml
export STACK_LIMIT_DEFAULTS_CHECK=1
Expand Down
4 changes: 1 addition & 3 deletions .github/scripts/setup-slapd.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
set -ex
set -e

# Create TLS certificate
sudo mkdir -p /etc/ldap/ssl
Expand Down Expand Up @@ -42,8 +42,6 @@ sudo sed -e 's|^\s*SLAPD_SERVICES\s*=.*$|SLAPD_SERVICES="ldap:/// ldaps:/// ldap
# Configure LDAP database.
DBDN=`sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(&(olcRootDN=*)(olcSuffix=*))' dn | grep -i '^dn:' | sed -e 's/^dn:\s*//'`;

sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif

sudo service slapd restart

sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF
Expand Down
35 changes: 28 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ jobs:
LINUX_X64:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
strategy:
fail-fast: false
matrix:
Expand All @@ -47,7 +54,7 @@ jobs:
zts: [true, false]
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -122,7 +129,7 @@ jobs:
name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
image: ubuntu:22.04
env:
MYSQL_TEST_HOST: mysql
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
Expand Down Expand Up @@ -246,7 +253,14 @@ jobs:
uses: ./.github/actions/verify-generated-files
COVERAGE_DEBUG_NTS:
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -286,7 +300,7 @@ jobs:
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_COMMUNITY"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
UBSAN_OPTIONS: print_stacktrace=1
USE_ZEND_ALLOC: 0
Expand Down Expand Up @@ -396,12 +410,19 @@ jobs:
OPCACHE_VARIATION:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_OPCACHE_VARIATION"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -567,7 +588,7 @@ jobs:
exclude:
- branch: { name: 'PHP-80', ref: 'PHP-8.0' }
name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -614,7 +635,7 @@ jobs:
uses: ./.github/actions/verify-generated-files
PECL:
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
CC: ccache gcc
CXX: ccache g++
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ env:
CXX: ccache g++
jobs:
LINUX_X64:
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
strategy:
fail-fast: false
matrix:
Expand All @@ -37,7 +44,7 @@ jobs:
- debug: false
zts: true
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -85,7 +92,7 @@ jobs:
name: LINUX_X32_DEBUG_ZTS
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
image: ubuntu:22.04
env:
MYSQL_TEST_HOST: mysql
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
Expand Down
13 changes: 13 additions & 0 deletions Zend/zend_portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,4 +737,17 @@ extern "C++" {
# define ZEND_INDIRECT_RETURN
#endif

#if __GNUC__ && !defined(__clang__)
# define __DO_PRAGMA(x) _Pragma(#x)
# define _DO_PRAGMA(x) __DO_PRAGMA(x)
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning) \
_Pragma("GCC diagnostic push") \
_DO_PRAGMA(GCC diagnostic ignored warning)
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END \
_Pragma("GCC diagnostic pop")
#else
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning)
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END
#endif

#endif /* ZEND_PORTABILITY_H */
16 changes: 13 additions & 3 deletions ext/imap/php_imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,9 @@ PHP_RINIT_FUNCTION(imap)
}
/* }}} */

/* {{{ PHP_RSHUTDOWN_FUNCTION */
PHP_RSHUTDOWN_FUNCTION(imap)
static void free_errorlist(void)
{
ERRORLIST *ecur = NIL;
STRINGLIST *acur = NIL;

if (IMAPG(imap_errorstack) != NIL) {
/* output any remaining errors at their original error level */
Expand All @@ -545,6 +543,11 @@ PHP_RSHUTDOWN_FUNCTION(imap)
mail_free_errorlist(&IMAPG(imap_errorstack));
IMAPG(imap_errorstack) = NIL;
}
}

static void free_stringlist(void)
{
STRINGLIST *acur = NIL;

if (IMAPG(imap_alertstack) != NIL) {
/* output any remaining alerts at E_NOTICE level */
Expand All @@ -560,6 +563,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
mail_free_stringlist(&IMAPG(imap_alertstack));
IMAPG(imap_alertstack) = NIL;
}
}

/* {{{ PHP_RSHUTDOWN_FUNCTION */
PHP_RSHUTDOWN_FUNCTION(imap)
{
free_errorlist();
free_stringlist();
return SUCCESS;
}
/* }}} */
Expand Down
2 changes: 2 additions & 0 deletions ext/imap/php_imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
# endif

/* these are used for quota support */
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
# include "c-client.h" /* includes mail.h and rfc822.h */
ZEND_CGG_DIAGNOSTIC_IGNORED_END
# include "imap4r1.h" /* location of c-client quota functions */
#else
# include "mail.h"
Expand Down
2 changes: 2 additions & 0 deletions ext/oci8/php_oci8_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
/* }}} */

#include "ext/standard/php_string.h"
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
#include <oci.h>
ZEND_CGG_DIAGNOSTIC_IGNORED_END

#if !defined(OCI_MAJOR_VERSION) || OCI_MAJOR_VERSION < 11 || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION < 2))
#error This version of PHP OCI8 requires Oracle Client libraries from 11.2 or later.
Expand Down
9 changes: 9 additions & 0 deletions ext/pdo_oci/php_pdo_oci_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
+----------------------------------------------------------------------+
*/

#ifndef PHP_PDO_OCI_INT_H
#define PHP_PDO_OCI_INT_H

#include "zend_portability.h"

ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
#include <oci.h>
ZEND_CGG_DIAGNOSTIC_IGNORED_END

typedef struct {
const char *file;
Expand Down Expand Up @@ -105,3 +112,5 @@ enum {
PDO_OCI_ATTR_MODULE,
PDO_OCI_ATTR_CALL_TIMEOUT
};

#endif /* PHP_PDO_OCI_INT_H */
2 changes: 2 additions & 0 deletions ext/soap/php_encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,9 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
if (style == SOAP_ENCODED) {
if (soap_version == SOAP_1_1) {
smart_str_0(&array_type);
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
if (strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0) {
ZEND_CGG_DIAGNOSTIC_IGNORED_END
smart_str_free(&array_type);
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
}
Expand Down