Skip to content

Commit 2ddd588

Browse files
authored
PHPC-2343: Require PHP 8.1 (#1631)
* Remove PHP 8.0 and 7.4 from CI matrix * Bump PHP requirement in config.m4 * Remove conditional dependencies in config.w32 * Bump minimum PHP version in package.xml * Remove conditional macro definitions * Remove conditional arginfo definitions * Directly implement Stringable interface * Remove conditional code * Remove skipped tests and obsolete SKIPIF statements in tests * Clarify removal requirement for return type checks * Remove obsolete serialisation macro * Remove unused macro for final classes * Make enum code unconditional
1 parent 43b1605 commit 2ddd588

File tree

198 files changed

+433
-3153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+433
-3153
lines changed

.evergreen/architecture.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ initialisation. If a build step fails, test tasks are skipped for that platform
1515

1616
Build tasks are generated automatically and included in the main config file. The `build-variants.yml` file contains
1717
the list of supported platforms that the extension is built for. `build-task-groups.yml` defines the task groups that
18-
contain the build tasks. Note there is a separate task that skips PHP 7.4 and 8.0, as these versions do not support
19-
OpenSSL 3 (currently used on RHEL 9+ and Ubuntu 22.04+).
18+
contain the build tasks.
2019

2120
## Build Step 2: Run Tests
2221

.evergreen/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,5 @@ include:
7474
- filename: .evergreen/config/generated/test/ocsp.yml
7575
- filename: .evergreen/config/generated/test/require-api-version.yml
7676
- filename: .evergreen/config/generated/test/skip-crypt-shared.yml
77-
- filename: .evergreen/config/generated/test-variant/modern-php-full.yml
78-
- filename: .evergreen/config/generated/test-variant/legacy-php-full.yml
77+
- filename: .evergreen/config/generated/test-variant/php-full.yml
7978
- filename: .evergreen/config/generated/test-variant/libmongoc.yml

.evergreen/config/build-task-groups.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,14 @@ task_groups:
1111
# Builds all versions of PHP
1212
- name: "build-all-php"
1313
# Keep this number in sync with the number of PHP versions to allow for parallel builds
14-
max_hosts: 4
14+
max_hosts: 3
1515
setup_task: *build_setup
1616
setup_task_can_fail_task: true
1717
setup_task_timeout_secs: 1800
1818
teardown_task: *build_teardown
1919
tasks:
2020
- ".build"
2121

22-
# Builds all versions of PHP that support OpenSSL 3 (PHP 8.1+)
23-
- name: "build-php-openssl3"
24-
# Keep this number in sync with the number of PHP versions to allow for parallel builds
25-
# Subtract 2 versions as PHP 7.4 and 8.0 are not built with OpenSSL 3
26-
max_hosts: 2
27-
setup_task: *build_setup
28-
setup_task_can_fail_task: true
29-
setup_task_timeout_secs: 1800
30-
teardown_task: *build_teardown
31-
tasks:
32-
- ".build !.php7.4 !.php8.0"
33-
3422
- name: "build-php-libmongoc"
3523
# Keep this in sync with the actual number of libmongoc builds (typically 3) defined in _template-build-libmongoc.yml
3624
max_hosts: 3

.evergreen/config/build-variants.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildvariants:
88
tags: ["build", "debian", "x64", "pr", "tag"]
99
run_on: debian12-small
1010
tasks:
11-
- name: "build-php-openssl3"
11+
- name: "build-all-php"
1212
- name: "build-php-libmongoc"
1313
- name: build-debian11
1414
display_name: "Build: Debian 11"
@@ -35,7 +35,7 @@ buildvariants:
3535
tags: ["build", "rhel", "x64", "pr", "tag"]
3636
run_on: rhel90-small
3737
tasks:
38-
- name: "build-php-openssl3"
38+
- name: "build-all-php"
3939
- name: build-rhel83-zseries
4040
display_name: "Build: RHEL 8.3 Zseries"
4141
tags: ["build", "rhel", "zseries", "tag"]
@@ -73,13 +73,13 @@ buildvariants:
7373
tags: ["build", "ubuntu", "x64", "pr", "tag"]
7474
run_on: ubuntu2204-small
7575
tasks:
76-
- name: "build-php-openssl3"
76+
- name: "build-all-php"
7777
- name: build-ubuntu2204-arm64
7878
display_name: "Build: Ubuntu 22.04 ARM64"
7979
tags: ["build", "ubuntu", "arm64", "tag"]
8080
run_on: ubuntu2204-arm64-small
8181
tasks:
82-
- name: "build-php-openssl3"
82+
- name: "build-all-php"
8383
- name: build-ubuntu2004
8484
display_name: "Build: Ubuntu 20.04 x64"
8585
tags: ["build", "ubuntu", "x64", "tag"]

.evergreen/config/generate-config.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
<?php
33

44
// Supported PHP versions. Add new versions to the beginning of the list
5-
$modernPhpVersions = [
5+
$phpVersions = [
66
'8.3',
77
'8.2',
88
'8.1',
99
];
10-
$legacyPhpVersions = [
11-
'8.0',
12-
'7.4',
13-
];
14-
$supportedPhpVersions = array_merge($modernPhpVersions, $legacyPhpVersions);
1510

1611
// Supported MongoDB versions. Add new versions after "rapid"
1712
$supportedMongoDBVersions = [
@@ -26,7 +21,7 @@
2621
'4.0',
2722
];
2823

29-
$latestPhpVersion = max($supportedPhpVersions);
24+
$latestPhpVersion = max($phpVersions);
3025

3126
// Only test the latest PHP version for libmongoc
3227
$libmongocBuildPhpVersions = [ $latestPhpVersion ];
@@ -57,7 +52,7 @@
5752
$allFiles = [];
5853

5954
// Build tasks
60-
$allFiles[] = generateConfigs('tasks', 'build', 'phpVersion', 'build-php.yml', $supportedPhpVersions);
55+
$allFiles[] = generateConfigs('tasks', 'build', 'phpVersion', 'build-php.yml', $phpVersions);
6156
$allFiles[] = generateConfigs('tasks', 'build', 'phpVersion', 'build-libmongoc.yml', $libmongocBuildPhpVersions);
6257

6358
// Test tasks
@@ -68,8 +63,7 @@
6863
$allFiles[] = generateConfigs('tasks', 'test', 'mongodbVersion', 'skip-crypt-shared.yml', $skipCryptSharedServerVersions);
6964

7065
// Test variants
71-
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'modern-php-full.yml', $modernPhpVersions);
72-
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'legacy-php-full.yml', $legacyPhpVersions);
66+
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'php-full.yml', $phpVersions);
7367
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'libmongoc.yml', [$latestPhpVersion]);
7468

7569
echo "Generated config. Use the following list to import files:\n";

.evergreen/config/generated/build/build-php.yml

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/test-variant/legacy-php-full.yml

Lines changed: 0 additions & 120 deletions
This file was deleted.

.evergreen/config/generated/test-variant/modern-php-full.yml renamed to .evergreen/config/generated/test-variant/php-full.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/templates/test-variant/legacy-php-full.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/actions/windows/prepare-build/action.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ outputs:
1717
runs:
1818
using: composite
1919
steps:
20-
# Reinstall VC15 (Visual Studio 2017) for PHP 7.4 using a derivation of the
21-
# script suggested in https://github.com/actions/runner-images/issues/9701
22-
- name: Install VC15 component for PHP 7.4
23-
if: ${{ inputs.version == '7.4' }}
24-
shell: pwsh
25-
run: |
26-
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
27-
$installPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
28-
$component = "Microsoft.VisualStudio.Component.VC.v141.x86.x64"
29-
$args = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$installPath`"", '--add', $component, '--quiet', '--norestart', '--nocache')
30-
$process = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru -WindowStyle Hidden
31-
3220
- name: Setup PHP SDK
3321
id: setup-php
3422
uses: php/setup-php-sdk@v0.9

.github/workflows/clang-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- "feature/*"
1414

1515
env:
16-
PHP_VERSION: "7.4"
16+
PHP_VERSION: "8.1"
1717

1818
jobs:
1919
coding-standards:

.github/workflows/package-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ jobs:
9898
fail-fast: false
9999
matrix:
100100
# Note: keep this in sync with the Windows matrix in tests.yml
101-
php: [ "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ]
101+
php: [ "8.1", "8.2", "8.3", "8.4" ]
102102
arch: [ x64, x86 ]
103103
ts: [ ts, nts ]

0 commit comments

Comments
 (0)