Skip to content

Filesystem hard-depends on ext-mbstring polyfill that may not be required #60444

Closed as not planned
@dktapps

Description

@dktapps

Symfony version(s) affected

6.4.13

Description

"symfony/polyfill-mbstring": "~1.8"

This dependency pulls in symfony/polyfill-mbstring even when ext-mbstring is already present.

Until recently, this was fine (the polyfill was just dead weight), but polyfill-mbstring recently added a hard dependency to ext-iconv which is not typically present in my application's environment. However, ext-mbstring is available. So my CI suddenly started having issues with ext-iconv being required by a polyfill which my environment doesn't actually call for anyway.

How to reproduce

  • Have a PHP binary which has ext-mbstring but not ext-iconv
  • Install symfony/filesystem using Composer
  • Composer now bails out saying this:
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - symfony/polyfill-mbstring is locked to version v1.32.0 and an update of this package was not requested.
    - symfony/polyfill-mbstring v1.32.0 requires ext-iconv * -> it is missing from your system. Install or enable PHP's iconv extension.
  Problem 2
    - symfony/filesystem is locked to version v6.4.13 and an update of this package was not requested.
    - symfony/filesystem v6.4.13 requires symfony/polyfill-mbstring ~1.8 -> satisfiable by symfony/polyfill-mbstring[v1.32.0].
    - symfony/polyfill-mbstring v1.32.0 requires ext-iconv * -> it is missing from your system. Install or enable PHP's iconv extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /home/runner/work/PocketMine-MP/PocketMine-MP/bin/bin/php7/bin/php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-iconv` to temporarily ignore these required extensions.

Possible Solution

Depend on ext-mbstring in symfony/filesystem instead of symfony/polyfill-mbstring.
symfony/polyfill-mbstring already provides ext-mbstring anyway so this should be fine.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions