Skip to content

Resolve PHP version dynamically from lang-php#45

Merged
tillkruss merged 2 commits intomainfrom
fix/php-version-resolution
Mar 30, 2026
Merged

Resolve PHP version dynamically from lang-php#45
tillkruss merged 2 commits intomainfrom
fix/php-version-resolution

Conversation

@tillkruss
Copy link
Copy Markdown
Member

Problem

The lang-php S3 bucket (Heroku's upstream PHP package bucket) no longer allows anonymous ListObjects requests. All extension builds specify a php-8.X.* wildcard dep, which causes bob to call ListObjects to find the latest matching tarball — now blocked with AccessDenied. This broke every build across all PHP versions and stacks.

Anonymous HEAD requests to specific objects in lang-php still work fine.

Fix

Add a Resolve PHP version step before the extension builds that:

  1. Queries the php/php-src GitHub releases API (newest first) for the minor version being built
  2. For each release, does an anonymous HEAD request against lang-php to check if the tarball exists
  3. Sets the first match as PHP_VERSION in $GITHUB_ENV

All subsequent build steps use php-${{ env.PHP_VERSION }} (e.g. php-8.2.30) instead of php-${{ matrix.series.php }}.* (e.g. php-8.2.*). bob then fetches the specific object directly via HEAD/GET instead of ListObjects, bypassing the restriction entirely.

This also means builds automatically pick up new PHP patch releases as Heroku publishes them to lang-php, without any manual version bumping.

https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z

claude added 2 commits March 30, 2026 08:53
The lang-php S3 bucket no longer allows anonymous ListObjects, which
broke all extension builds that depend on a php-8.X.* wildcard dep.
Anonymous HEAD requests to specific objects still work, so we resolve
the latest available PHP patch version by walking php/php-src GitHub
releases newest-first and HEAD-checking each against lang-php until
one is found. The exact version is then used as the dep instead of
the wildcard, avoiding ListObjects entirely.

https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z
Replaces the inline Python script with a concise github-script step
using the built-in github, core, and fetch objects.

https://claude.ai/code/session_01AFwaaf18yMZsVygqC4aF1Z
@tillkruss tillkruss merged commit 9bcbf7f into main Mar 30, 2026
14 checks passed
@tillkruss tillkruss deleted the fix/php-version-resolution branch March 30, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants