Skip to content

code-quality: extension binary naming lives outside PlatformDetector and is hand-mirrored in PluginTest and release-build.yml #194

Description

@s2x

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityJakość kodu, analiza statyczna, refaktoryseverity:lowDrobny problem, higiena kodu

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions