diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index f53dba0e1..34f7c3960 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -325,9 +325,9 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - file="${PROJECT_DIRECTORY}/.evergreen/install-composer.sh" - # Don't use ${file} syntax here because evergreen treats it as an empty expansion. - [ -f "$file" ] && DEPENDENCIES=${DEPENDENCIES} bash $file || echo "$file not available, skipping" + DEPENDENCIES=${DEPENDENCIES} \ + PHP_VERSION=${PHP_VERSION} \ + bash ${PROJECT_DIRECTORY}/.evergreen/install-composer.sh "start load balancer": - command: shell.exec diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index 3629bf13f..802a0af9f 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -3,12 +3,15 @@ // Supported PHP versions. Add new versions to the beginning of the list $supportedPhpVersions = [ + '8.4', '8.3', '8.2', '8.1', ]; -$latestPhpVersion = max($supportedPhpVersions); +// TODO: use max() once PHP 8.4 is stable +//$latestPhpVersion = max($supportedPhpVersions); +$latestPhpVersion = '8.3'; $lowestPhpVersion = min($supportedPhpVersions); // Supported MongoDB versions. Add new versions after "rapid" diff --git a/.evergreen/config/generated/build/build-extension.yml b/.evergreen/config/generated/build/build-extension.yml index 02033b002..b7359c1e8 100644 --- a/.evergreen/config/generated/build/build-extension.yml +++ b/.evergreen/config/generated/build/build-extension.yml @@ -1,5 +1,43 @@ # This file is generated automatically - please edit the "templates/build/build-extension.yml" template file instead. tasks: + - name: "build-php-8.4" + tags: ["build", "php8.4", "stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.4" + - func: "compile extension" + - func: "upload extension" + - name: "build-php-8.4-lowest" + tags: ["build", "php8.4", "lowest", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.4" + - func: "compile extension" + vars: + EXTENSION_VERSION: "1.20.0" + - func: "upload extension" + - name: "build-php-8.4-next-stable" + tags: ["build", "php8.4", "next-stable", "pr", "tag"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.4" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.20" + - func: "upload extension" + - name: "build-php-8.4-next-minor" + tags: ["build", "php8.4", "next-minor"] + commands: + - func: "locate PHP binaries" + vars: + PHP_VERSION: "8.4" + - func: "compile extension" + vars: + EXTENSION_BRANCH: "v1.x" + - func: "upload extension" - name: "build-php-8.3" tags: ["build", "php8.3", "stable", "pr", "tag"] commands: diff --git a/.evergreen/config/generated/test-variant/modern-php-full.yml b/.evergreen/config/generated/test-variant/modern-php-full.yml index 37845f33e..24c0a6f8d 100644 --- a/.evergreen/config/generated/test-variant/modern-php-full.yml +++ b/.evergreen/config/generated/test-variant/modern-php-full.yml @@ -1,6 +1,67 @@ # This file is generated automatically - please edit the "templates/test-variant/modern-php-full.yml" template file instead. buildvariants: # Test MongoDB >= 7.0 + - name: test-debian12-php-8.4-local + tags: ["test", "debian", "x64", "php8.4", "pr", "tag"] + display_name: "Test: Debian 12, PHP 8.4" + run_on: debian12-small + expansions: + FETCH_BUILD_VARIANT: "build-debian12" + FETCH_BUILD_TASK: "build-php-8.4" + PHP_VERSION: "8.4" + VARIANT: debian12 + depends_on: + - variant: "build-debian12" + name: "build-php-8.4" + tasks: + - ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0" + - "test_serverless_task_group" + - "test_serverless_proxy_task_group" + - "test-atlas-data-lake" + + # Test MongoDB 5.0 and 6.0 + - name: test-debian11-php-8.4-local + tags: ["test", "debian", "x64", "php8.4", "pr", "tag"] + display_name: "Test: Debian 11, PHP 8.4" + run_on: debian11-small + expansions: + FETCH_BUILD_VARIANT: "build-debian11" + FETCH_BUILD_TASK: "build-php-8.4" + PHP_VERSION: "8.4" + depends_on: + - variant: "build-debian11" + name: "build-php-8.4" + tasks: + # Remember to add new major versions here as they are released + - ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest" + - ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest" + - ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest" + - ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest" + + # Test versions < 5.0 + - name: test-rhel80-php-8.4 + tags: ["test", "debian", "x64", "php8.4", "pr", "tag"] + display_name: "Test: RHEL 8.0, PHP 8.4" + run_on: rhel80-small + expansions: + FETCH_BUILD_VARIANT: "build-rhel80" + FETCH_BUILD_TASK: "build-php-8.4" + PHP_VERSION: "8.4" + depends_on: + - variant: "build-rhel80" + name: "build-php-8.4" + tasks: + # Remember to add new major versions here as they are released + - ".standalone .local !.csfle !.6.0 !.7.0 !.8.0 !.rapid !.latest" + - ".replicaset .local !.csfle !.6.0 !.7.0 !.8.0 !.rapid !.latest" + - ".sharded .local !.csfle !.6.0 !.7.0 !.8.0 !.rapid !.latest" + - ".loadbalanced .local !.csfle !.6.0 !.7.0 !.8.0 !.rapid !.latest" + - "test_atlas_task_group" + - ".csfle" + # Test MongoDB >= 7.0 - name: test-debian12-php-8.3-local tags: ["test", "debian", "x64", "php8.3", "pr", "tag"] display_name: "Test: Debian 12, PHP 8.3" diff --git a/.evergreen/install-composer.sh b/.evergreen/install-composer.sh index 625d1be27..771644e56 100644 --- a/.evergreen/install-composer.sh +++ b/.evergreen/install-composer.sh @@ -38,4 +38,9 @@ php --ri mongodb install_composer +# Remove psalm as it's not compatible with PHP 8.4: https://github.com/vimeo/psalm/pull/10928 +if [ "$PHP_VERSION" == "8.4" ]; then + php composer.phar remove --no-update --dev vimeo/psalm +fi + php composer.phar update $COMPOSER_FLAGS diff --git a/tests/GridFS/BucketFunctionalTest.php b/tests/GridFS/BucketFunctionalTest.php index b9bcf0d78..5abc7187f 100644 --- a/tests/GridFS/BucketFunctionalTest.php +++ b/tests/GridFS/BucketFunctionalTest.php @@ -842,6 +842,9 @@ public function testDanglingOpenWritableStream(): void $code = <<<'PHP' require '%s'; + // Don't report deprecations - if the issue exists this code will + // result in a fatal error + error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); $client = MongoDB\Tests\FunctionalTestCase::createTestClient(); $database = $client->selectDatabase(getenv('MONGODB_DATABASE') ?: 'phplib_test'); $gridfs = $database->selectGridFSBucket(); @@ -882,6 +885,9 @@ public function testDanglingOpenWritableStreamWithGlobalStreamWrapperAlias(): vo $code = <<<'PHP' require '%s'; + // Don't report deprecations - if the issue exists this code will + // result in a fatal error + error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); $client = MongoDB\Tests\FunctionalTestCase::createTestClient(); $database = $client->selectDatabase(getenv('MONGODB_DATABASE') ?: 'phplib_test'); $database->selectGridFSBucket()->registerGlobalStreamWrapperAlias('alias');