You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ Enhancement⚙️ Configuration changes🕐 Less than 5 minutes
AI Description
• Adds --with-sodium to PHP configure options so ext-sodium is compiled in.
• Installs libsodium-dev in the builder setup so the sodium extension can build.
• Relies on sodium being in PHP core since 7.2; older PHP versions are not guarded.
Merge Risk 🟢 Low
Blast radius 🟢 Low💥 1 capability
1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
The changed package installation and configure option jointly control one end-to-end outcome: the PHP binaries produced and packaged by this repository.
The propagation path terminates at that release capability; distro and architecture jobs are deployment variants of the same bounded integration, not independent functional scopes.
Before, the builder installed general PHP build dependencies and configured a static PHP build without an explicit sodium option.
After, it adds libsodium-dev and libsodium23 and passes one additional configure flag.
The added correctness condition is that both package names and the configure option remain compatible with each supported PHP version and build image; no new state machine, concurrency protocol, transformation algorithm, or coordinated invariant is introduced.
If the package or configure behavior regresses, the PHP release may fail to build or may lack sodium support.
PHP itself and unrelated extensions remain available, so the affected capability is limited to sodium-enabled release production.
Reverting prevents future affected builds, but an already published artifact would need to be rebuilt and republished; the source does not establish automatic repair for consumers already adopting it.
A failed build can be rerun after reverting.
A successfully published artifact without the intended sodium capability requires a replacement build and release; downstream consumers would need to adopt that replacement.
graph TD
A["install-builder.sh"] --> B["libsodium-dev package"] --> C["builder.sh"]
C --> D["PHP_BUILD_CONFIGURE_OPTS"] --> E["php-build"] --> F["PHP binary with ext-sodium"]
Loading
High-Level Assessment
The PR uses the standard approach: enable the bundled PHP extension with --with-sodium and install the system libsodium headers. Alternatives such as a PECL install or a separate extension build are unnecessary since PHP 7.2+ bundles sodium in core. One gap remains: builds for PHP versions below 7.2 would fail or lack sodium, and the PR does not guard against them. If older versions are still built, add a version check around the flag.
Files changed (2) +2 / -1
Enhancement (2) +2 / -1
builder.shAdd --with-sodium to PHP configure options+1/-1
Add --with-sodium to PHP configure options
• Appends --with-sodium to PHP_BUILD_CONFIGURE_OPTS so php-build compiles the sodium extension into PHP.
--with-sodium links PHP to system libsodium, but builder.sh archives only the PHP installation
directory, leaving the builder-installed library out of the release. When containerbase/base
installs the artifact without a matching libsodium runtime library, PHP can fail before any command
runs—including commands that do not use sodium—affecting its own tests, composer-prebuild, and
renovatebot/base-image.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Enabling sodium adds a runtime dependency on libsodium that is present in the builder image but absent from the release archive and containerbase/base's PHP runtime preparation. An extracted PHP release may therefore fail to start where the matching library is unavailable.
## Fix Focus Areas
- bin/builder.sh[64-78]
- bin/install-builder.sh[35-39]
- /cross_repos/base/src/cli/tools/php/index.ts[18-44]
## Recommended Fix
Install the matching libsodium runtime package through containerbase/base's PHP preparation for each supported distro before consumers adopt the artifacts. Alternatively, link libsodium statically or otherwise package PHP so the release does not depend on an unprovided system library. Check the extracted release's shared-library dependencies and verify that PHP starts in a clean consumer runtime image.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
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
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.
Changes
Bundles
ext-sodiumby compiling with--with-sodium, since PHP has it in core since 7.2Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: