Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to version 2 fails due to duplicate replaced polyfill package #839

Closed
burned42 opened this issue Nov 29, 2021 · 3 comments
Closed

Comments

@burned42
Copy link

The PR for version 2 added some polyfill packages to the replace section of the composer.json: https://github.com/symfony/flex/pull/833/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R29

As per this recommendation in the polyfill repo, I have added some of those packages to the replace section of the composer.json of my project already which now results in the following error when I try to update to symfony/flex version 2:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - my/project is present at version dev-master and cannot be modified by Composer
    - symfony/flex[v2.0.0] cannot be installed as that would require removing my/project[dev-master]. They both replace symfony/polyfill-php80 and thus cannot coexist.
    - Root composer.json requires symfony/flex ^2.0 -> satisfiable by symfony/flex[v2.0.0].

One obvious solution would be to remove the duplicate replacement from my project. But if symfony/flex would remove that package from its replace section in future, then I'd still want to keep this package marked as replaced, so I'd have to add it to my project again (and therefore would have to check the replacement section of this package regularly to notice that change).

Overall I'm not 100% sure what the intended/recommended way would be to solve this issue and I'd guess others will face the same problem, so I thought I'd just ask :)

Maybe it wasn't even intentional to add that replace section? The recommendation linked above says that "projects" should add the polyfills to their replace section and I'd consider this more of a library/package instead of a project, but that may just be my interpretation and not the intention of the recommendation.

@stof
Copy link
Member

stof commented Nov 29, 2021

This recommendation is for Flex-based projects, not for packages installed as dependency.

@nicolas-grekas those should not be added in symfony/flex either.

@nicolas-grekas
Copy link
Member

Oops, I didn't know about this behavior.
Reverted in cc9241d
I'm going to tag a release later today.

@burned42
Copy link
Author

awesome, thanks for the quick response @stof @nicolas-grekas 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants