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

[ci] fix symfony serializer deps in ci #1063

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented Feb 7, 2022

When running serializer tests in Symfony <= 5.3, composer attempts to use symfony/serializer-pack@1.1 (The latest version at the time of this PR) which conflicts with symfony/property-info <5.4. This in turn causes our tests to fail due to an uninstallable set of packages.

As a work around, until something better comes along, adding symfony/serializer-pack:* as an extra test dependency allows lesser version of serializer-pack to be used in the test without conflict with its underlying packages.

@jrushlow
Copy link
Collaborator Author

jrushlow commented Feb 7, 2022

1) Symfony\Bundle\MakerBundle\Tests\Maker\MakeSerializerEncoderTest::testExecute with data set "it_makes_serializer_encoder" (Symfony\Bundle\MakerBundle\Test\MakerTestDetails Object (...))
Exception: Error running command: "composer require serializer". Output: "". Error: "Using version ^1.1 for symfony/serializer-pack
composer.json has been updated
Running composer update symfony/serializer-pack
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.3.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/serializer-pack v1.1.0 requires symfony/property-info * -> satisfiable by symfony/property-info[v5.3.0, ..., v5.3.14].
    - symfony/serializer-pack v1.1.0 conflicts with symfony/property-info v5.3.14.
    - symfony/serializer-pack v1.1.0 conflicts with symfony/property-info v5.3.8.
    - symfony/serializer-pack v1.1.0 conflicts with symfony/property-info v5.3.1.
    - Root composer.json requires symfony/serializer-pack ^1.1 -> satisfiable by symfony/serializer-pack[v1.1.0].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require symfony/serializer-pack:*" to figure out if any version is installable, or "composer require symfony/serializer-pack:^2.1" if you know which you need.

Installation failed, reverting composer.json and composer.lock to their original content.
"

/var/htdocs/src/Test/MakerTestProcess.php:51
/var/htdocs/src/Test/MakerTestEnvironment.php:155
/var/htdocs/src/Test/MakerTestCase.php:58
/var/htdocs/src/Test/MakerTestCase.php:33

@jrushlow
Copy link
Collaborator Author

jrushlow commented Feb 7, 2022

ci failures are related make:entity & registration form.. the latter is getting a fix over in #1062

@weaverryan
Copy link
Member

The underlying problem is that 1.1 of the serializer-pack requires 5.4 or greater of symfony/property-info, so it has problems installing: https://github.com/symfony/serializer-pack/blob/main/composer.json#L15

I'm not sure of the best fix. If the user has Symfony 5.3, it's true that running the composer require line - that the command would tell you to run - will fail (just as it does in the CI). However, I don't think we should try to "figure out" in MakerBundle what version of the serializer-pack would be compatible so we can tweak our composer require line accordingly. That just seems nuts. So, this is probably the best solution, though it's not ideal. We should at least add a comment above the new lines in the test to explain what's going on.

@jrushlow jrushlow changed the title WIP - fix symfony serializer deps in ci fix symfony serializer deps in ci Feb 8, 2022
@jrushlow jrushlow marked this pull request as ready for review February 8, 2022 14:42
@jrushlow jrushlow changed the title fix symfony serializer deps in ci [ci] fix symfony serializer deps in ci Feb 8, 2022
@weaverryan
Copy link
Member

Thanks Jesse!

@weaverryan weaverryan merged commit f003e99 into symfony:main Feb 8, 2022
@jrushlow jrushlow deleted the fix/make-serializer-tests branch February 15, 2022 16:43
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

Successfully merging this pull request may close these issues.

2 participants