Description
Plugin::getExtensionBinaryName() (src/Composer/Plugin.php:282-290) is the last platform-naming logic outside PlatformDetector: FFI library names were moved there in #48 (PlatformDetector::getBinaryName()), but extension names still live in the plugin, and the naming match is then hand-mirrored in tests/Composer/PluginTest.php (extensionBinaryName(), deliberately — see #185 work) and in release-build.yml (e.g. php-ext-linux-...-php${{ matrix.php-version }}.so).
Three sources of truth for one format → drift risk (the exact bug class #48 fixed for FFI names). A rename in one place silently produces binaries the plugin will not find (mitigated today only by the fail-loud tests added in #185).
Where
src/Composer/Plugin.php:282-290 (getExtensionBinaryName())
tests/Composer/PluginTest.php (extensionBinaryName() mirror)
.github/workflows/release-build.yml (same naming)
Suggested fix
- Move extension naming to
PlatformDetector::getExtensionBinaryName($os, $variant, $arch, $phpVersion) alongside getBinaryName(); tests then call the public API and the mirror disappears.
- Consider deriving the release workflow's artifact names from the same documented format (single source of truth).
Found during the #185 cycle (PR #192); untracked in open/closed issues.
Description
Plugin::getExtensionBinaryName()(src/Composer/Plugin.php:282-290) is the last platform-naming logic outsidePlatformDetector: FFI library names were moved there in #48 (PlatformDetector::getBinaryName()), but extension names still live in the plugin, and the namingmatchis then hand-mirrored intests/Composer/PluginTest.php(extensionBinaryName(), deliberately — see #185 work) and inrelease-build.yml(e.g.php-ext-linux-...-php${{ matrix.php-version }}.so).Three sources of truth for one format → drift risk (the exact bug class #48 fixed for FFI names). A rename in one place silently produces binaries the plugin will not find (mitigated today only by the fail-loud tests added in #185).
Where
src/Composer/Plugin.php:282-290(getExtensionBinaryName())tests/Composer/PluginTest.php(extensionBinaryName()mirror).github/workflows/release-build.yml(same naming)Suggested fix
PlatformDetector::getExtensionBinaryName($os, $variant, $arch, $phpVersion)alongsidegetBinaryName(); tests then call the public API and the mirror disappears.Found during the #185 cycle (PR #192); untracked in open/closed issues.