Repository navigation
Remove embedded extension config, make --extensions-dir required (Phase 5) - #127
Merged
Merged
Conversation
tnikolova82
dismissed
ivanovac’s stale review
October 28, 2026 12:12
The merge-base changed after approval.
…se 5)
Remove the go:embed-based extension loading from binary-builder. Extension
YAML files now live exclusively in the php-buildpack repo (config/extensions/)
and must be passed via --extensions-dir during PHP builds.
Changes:
1. Move internal/php/assets/ to internal/php/testdata/. The YAML files
are now test fixtures only, not compiled into the binary.
2. Remove go:embed infrastructure from extensions.go: the embedded FS,
init() function, regex matchers, and embeddedBases/embeddedPatches
maps are all removed. LoadFromDir is the sole production API.
3. Load() now delegates to LoadFromDir("testdata", ...) and is
documented as a test-only convenience function.
4. PHPRecipe.ExtensionsDir is now required. Build() returns a clear
error when it is empty: "--extensions-dir is required for PHP builds".
5. All php_test.go tests updated to pass ExtensionsDir. New test
TestPHPRecipeBuildRequiresExtensionsDir verifies the error path.
6. AGENTS.md updated to reflect the new structure.
DO NOT MERGE until Phase 3 (buildpacks-ci pipeline passing --extensions-dir)
has been running successfully in production for at least one full PHP release
cycle.
Prerequisites:
- binary-builder PR #126 (Phase 1) — merged
- php-buildpack PR #1332 (Phase 2) — merged
- buildpacks-ci Phase 3 PR — merged and validated
tnikolova82
force-pushed
the
remove-embedded-extensions
branch
from
October 28, 2026 13:45
8a23f3c to
31902ec
Compare
Contributor
Author
Phase 3 Validation Complete — Ready for ReviewAll prerequisites are now met. Phase 3 has been validated with successful builds across all PHP version lines and both stacks:
All prerequisite PRs merged:
The only remaining post-merge task is verifying the GitHub Actions Updated the PR description with checked boxes and removed "DO NOT MERGE" from the title. Requesting fresh review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the
go:embed-based extension loading from binary-builder. Extension YAML files now live exclusively in the php-buildpack repo and must be passed via--extensions-dirduring PHP builds.Context
This is Phase 5 (final phase) of the PHP extension config migration plan.
Prerequisites (must ALL be merged and validated first)
--extensions-dirflagconfig/extensions/directory (merged Oct 29)EXTENSIONS_DIRsupport toupdate.rband fixesupdate-hashes.rb(merged Oct 29). Critical: must merge before this PR. Without PR #696, the weekly GitHub Actions workflow (check-php-extensions.yml) will silently fail to find extension YAML files after this PR renamesinternal/php/assets/tointernal/php/testdata/. The oldupdate.rbon buildpacks-ci master hardcodes the pathinternal/php/assetsvia itsBINARY_BUILDER_DIRfallback — that directory no longer exists after this PR. PR #696 addsEXTENSIONS_DIRsupport, and the workflow already setsEXTENSIONS_DIRwith a fallback chain that handles the rename.--extensions-dir(merged Oct 29)oci8andpdo_ociextensions #13 — succeeded (cflinuxfs4 + cflinuxfs5)[task] Using extension config from php-buildpack/config/extensionsinternal/php/assets/becomesinternal/php/testdata/. The weeklycheck-php-extensions.ymlworkflow uses anEXTENSIONS_DIRfallback chain (php-buildpack/config/extensions>internal/php/assets>internal/php/testdata) that handles this automatically. Verify the workflow still runs successfully by triggering a manual run after merge.Merge order (critical)
Changes
internal/php/assets/→internal/php/testdata/internal/php/extensions.gogo:embed,init(),embeddedBases/embeddedPatchesmaps.LoadFromDiris the sole production API.Load()is now a test-only wrapper.internal/recipe/php.goExtensionsDiris now required.Build()returns clear error when empty.internal/recipe/php_test.goExtensionsDir. NewTestPHPRecipeBuildRequiresExtensionsDirtest.AGENTS.mdBreaking Change
After this PR merges, running
binary-builder buildfor PHP without--extensions-dirwill fail with:This is intentional — the CI pipeline (Phase 3) always passes
--extensions-dir, so production builds are unaffected. Local development builds need to pass the flag explicitly.Rollback
If issues arise, revert this commit to restore the embedded extension config. The
--extensions-dirflag will continue to work (it takes precedence over embedded defaults in the Phase 1 code).