Skip to content

Commit

Permalink
Merge pull request #673 from heroku/php83
Browse files Browse the repository at this point in the history
PHP 8.3
  • Loading branch information
dzuelke authored Dec 7, 2023
2 parents d9e3462 + b36aa4e commit 1d568bb
Show file tree
Hide file tree
Showing 34 changed files with 184 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install PHP and Composer
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
php-version: "8.2"
tools: "composer:2.6"
- name: Hatchet setup
run: bundle exec hatchet ci:setup
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# heroku-buildpack-php CHANGELOG

## v242 (2023-12-07)

### ADD

- PHP/8.3.0 [David Zuelke]

## v241 (2023-11-29)

- PHP/8.1.26 [David Zuelke]
Expand Down
4 changes: 2 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ composer validate --no-plugins --no-check-publish --no-check-all --quiet "$COMPO
status "Preparing platform package installation..."

if [[ $STACK == "heroku-20" ]]; then
HEROKU_PHP_DEFAULT_RUNTIME_VERSION="^7.3.0 | ^8.0.0 <8.3"
HEROKU_PHP_DEFAULT_RUNTIME_VERSION="^7.3.0 | ^8.0.0 <8.4"
else
HEROKU_PHP_DEFAULT_RUNTIME_VERSION="^8.0.0 <8.3"
HEROKU_PHP_DEFAULT_RUNTIME_VERSION="^8.0.0 <8.4"
fi
export HEROKU_PHP_DEFAULT_RUNTIME_VERSION
# extract requirements from composer.lock
Expand Down
1 change: 1 addition & 0 deletions bin/util/eol.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"8.0" => array("2022-11-26", "2023-11-26"),
"8.1" => array("2023-11-25", "2024-11-25"),
"8.2" => array("2024-12-08", "2025-12-08"),
"8.3" => array("2025-11-23", "2026-11-23"),
);

if(basename(__FILE__) != basename($_SERVER["PHP_SELF"])) return $eol; // we're being included, just return the data
Expand Down
3 changes: 3 additions & 0 deletions support/build/extensions/no-debug-non-zts-20180731/blackfire
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ case ${ZEND_MODULE_API_VERSION} in
20220829)
series=8.2
;;
20230831)
series=8.3
;;
*)
echo "Unsupported PHP/Zend Module API version: ${ZEND_MODULE_API_VERSION}"
exit 1
Expand Down
3 changes: 3 additions & 0 deletions support/build/extensions/no-debug-non-zts-20180731/newrelic
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ case ${ZEND_MODULE_API_VERSION} in
20220829)
series=8.2
;;
20230831)
series=8.3
;;
*)
echo "Unsupported PHP/Zend Module API version: ${ZEND_MODULE_API_VERSION}"
exit 1
Expand Down
5 changes: 5 additions & 0 deletions support/build/extensions/no-debug-non-zts-20230831/amqp-2.1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/amqp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/apcu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php

source $(dirname $0)/../no-debug-non-zts-20180731/blackfire
5 changes: 5 additions & 0 deletions support/build/extensions/no-debug-non-zts-20230831/ev-1.1.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/ev
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/event
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/imagick
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/memcached
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/mongodb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/oauth
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/pcov
5 changes: 5 additions & 0 deletions support/build/extensions/no-debug-non-zts-20230831/pq-2.2.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*, extensions/no-debug-non-zts-20230831/raphf-2.*

source $(dirname $0)/../no-debug-non-zts-20180731/pq
5 changes: 5 additions & 0 deletions support/build/extensions/no-debug-non-zts-20230831/psr-1.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/psr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/raphf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*, libraries/librdkafka-1.*

source $(dirname $0)/../no-debug-non-zts-20180731/rdkafka
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/redis
5 changes: 5 additions & 0 deletions support/build/extensions/no-debug-non-zts-20230831/uuid-1.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php
# Build Deps: php-8.3.*

source $(dirname $0)/../no-debug-non-zts-20180731/uuid
2 changes: 2 additions & 0 deletions support/build/php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ if [[ $dep_version == *alpha* ]] || [[ $dep_version == *beta* ]] || [[ $dep_vers
dep_url=https://downloads.php.net/~ramsey/${dep_archive_name}
elif [[ $dep_version == 8.2.* ]]; then
dep_url=https://downloads.php.net/~pierrick/${dep_archive_name}
elif [[ $dep_version == 8.3.* ]]; then
dep_url=https://downloads.php.net/~eric/${dep_archive_name}
fi
else
dep_url=https://www.php.net/distributions/${dep_archive_name}
Expand Down
4 changes: 4 additions & 0 deletions support/build/php-8.3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php

source $(dirname $0)/php
1 change: 1 addition & 0 deletions support/devcenter/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'8.0',
'8.1',
'8.2',
'8.3',
];

$findstacks = function(array $package) use($stacks) {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/newrelic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# a NEW_RELIC_LICENSE_KEY triggers the automatic installation of ext-newrelic at the end of the build
@app = new_app_with_stack_and_platrepo('test/fixtures/bootopts',
config: { "NEW_RELIC_LOG_LEVEL" => "info", "NEW_RELIC_LICENSE_KEY" => "thiswilltriggernewrelic" },
before_deploy: -> { system("composer require --quiet --ignore-platform-reqs 'php:8.1.*'") or raise "Failed to require PHP version" },
before_deploy: -> { system("composer require --quiet --ignore-platform-reqs 'php:8.2.*'") or raise "Failed to require PHP version" },
run_multi: true
)
end
Expand Down
5 changes: 5 additions & 0 deletions test/spec/php_8.3-apache2_boot_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require_relative "php_shared_boot"

describe "A PHP 8.3/Apache application for testing boot options", :requires_php_on_stack => "8.3" do
include_examples "A PHP application for testing boot options", "8.3", "apache2"
end
5 changes: 5 additions & 0 deletions test/spec/php_8.3-apache2_concurrency_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require_relative "php_shared_concurrency"

describe "A PHP 8.3/Apache application for testing WEB_CONCURRENCY behavior", :requires_php_on_stack => "8.3" do
include_examples "A PHP application for testing WEB_CONCURRENCY behavior", "8.3", "apache2"
end
5 changes: 5 additions & 0 deletions test/spec/php_8.3-nginx_boot_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require_relative "php_shared_boot"

describe "A PHP 8.3/Nginx application for testing boot options", :requires_php_on_stack => "8.3" do
include_examples "A PHP application for testing boot options", "8.3", "nginx"
end
5 changes: 5 additions & 0 deletions test/spec/php_8.3-nginx_concurrency_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require_relative "php_shared_concurrency"

describe "A PHP 8.3/Nginx application for testing WEB_CONCURRENCY behavior", :requires_php_on_stack => "8.3" do
include_examples "A PHP application for testing WEB_CONCURRENCY behavior", "8.3", "nginx"
end
48 changes: 48 additions & 0 deletions test/spec/php_8.3_base_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require_relative "php_shared_base"

describe "A basic PHP 8.3 application", :requires_php_on_stack => "8.3" do
include_examples "A basic PHP application", "8.3"

context "with an index.php that allows for different execution times" do
['apache2', 'nginx'].each do |server|
context "running the #{server} web server" do
let(:app) {
new_app_with_stack_and_platrepo('test/fixtures/sigterm',
before_deploy: -> { system("composer require --quiet --ignore-platform-reqs php '8.3.*'") or raise "Failed to require PHP version" }
)
}

# FIXME: move to php_shared.rb once all PHPs are rebuilt with that tracing capability
it "logs slowness after configured time and sees a trace" do
app.deploy do |app|
# launch web server wrapped in a 20 second timeout
# once web server is ready, `read` unblocks and we curl the sleep() script which will take a few seconds to run
# after `curl` completes, `wait-for.it.sh` will shut down
# ensure slowlog info and trace is there
cmd = "./waitforit.sh 20 'ready for connections' heroku-php-#{server} --verbose -F fpm.request_slowlog_timeout.conf | { read && curl \"localhost:$PORT/index.php?wait=5\"; }"
retry_until retry: 3, sleep: 5 do
output = app.run(cmd)
expect(output).to include("executing too slow")
expect(output).to include("sleep() /app/index.php:5")
end
end
end

it "logs slowness after about 3 seconds and terminates the process after about 30 seconds" do
app.deploy do |app|
# launch web server wrapped in a 50 second timeout
# once web server is ready, `read` unblocks and we curl the sleep() script with a very long timeout
# after `curl` completes, `wait-for.it.sh` will shut down
# ensure slowlog and terminate output is there
cmd = "./waitforit.sh 50 'ready for connections' heroku-php-#{server} --verbose | { read && curl \"localhost:$PORT/index.php?wait=35\"; }"
retry_until retry: 3, sleep: 5 do
output = app.run(cmd)
expect(output).to match(/executing too slow/)
expect(output).to match(/execution timed out/)
end
end
end
end
end
end
end
6 changes: 3 additions & 3 deletions test/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def expect_exit(expect: :to, operator: :eq, code: 0)
end

def expected_default_php(stack)
"8.2"
"8.3"
end

def php_on_stack?(series)
case ENV["STACK"]
when "heroku-20"
available = ["7.3", "7.4", "8.0", "8.1", "8.2"]
available = ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
else
available = ["8.1", "8.2"]
available = ["8.1", "8.2", "8.3"]
end
available.include?(series)
end
Expand Down
5 changes: 5 additions & 0 deletions test/var/log/parallel_runtime_rspec.heroku-20.log
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ test/spec/php_8.2-apache2_concurrency_spec.rb:100
test/spec/php_8.2_base_spec.rb:210
test/spec/php_8.2-nginx_boot_spec.rb:100
test/spec/php_8.2-nginx_concurrency_spec.rb:90
test/spec/php_8.3-apache2_boot_spec.rb:110
test/spec/php_8.3-apache2_concurrency_spec.rb:100
test/spec/php_8.3_base_spec.rb:210
test/spec/php_8.3-nginx_boot_spec.rb:100
test/spec/php_8.3-nginx_concurrency_spec.rb:90
test/spec/php_default_spec.rb:65
test/spec/platform_spec.rb:50
test/spec/sigterm_spec.rb:56
Expand Down
5 changes: 5 additions & 0 deletions test/var/log/parallel_runtime_rspec.heroku-22.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ test/spec/php_8.2-apache2_concurrency_spec.rb:100
test/spec/php_8.2_base_spec.rb:210
test/spec/php_8.2-nginx_boot_spec.rb:100
test/spec/php_8.2-nginx_concurrency_spec.rb:90
test/spec/php_8.3-apache2_boot_spec.rb:110
test/spec/php_8.3-apache2_concurrency_spec.rb:100
test/spec/php_8.3_base_spec.rb:210
test/spec/php_8.3-nginx_boot_spec.rb:100
test/spec/php_8.3-nginx_concurrency_spec.rb:90
test/spec/php_default_spec.rb:65
test/spec/platform_spec.rb:50
test/spec/sigterm_spec.rb:56
Expand Down

0 comments on commit 1d568bb

Please sign in to comment.