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

Please allow PHP 8.2 in composer.json #556

Closed
lolli42 opened this issue Jul 26, 2022 · 16 comments
Closed

Please allow PHP 8.2 in composer.json #556

lolli42 opened this issue Jul 26, 2022 · 16 comments
Labels

Comments

@lolli42
Copy link

lolli42 commented Jul 26, 2022

PHP 8.2 is beta now. It would be great if prophecy could unblock it in composer.json.

@alecpl
Copy link

alecpl commented Aug 1, 2022

Yes, please. I had to set composer platform.php to 8.1 to be able to install phpunit v9 (which depends on prophecy).

@ciaranmcnulty
Copy link
Member

We can't really allow it until the new features are all supported or at least error with sensible messages; this will require someone to go through the various new features and make a list

You can use --ignore-platform-req=PHP with composer to try things out for now

@sbuerk
Copy link

sbuerk commented Aug 1, 2022

Maybe the "<8.2" can be removed - so at least executing with PHP8.2 is possible. We are testing codebase with different php versions. Using --ignore-platform-req=PHP is a ugly workaround.

Can be said, that new PHP8.2 language features are not supported yet.

@lolli42
Copy link
Author

lolli42 commented Aug 1, 2022

Agreed.

Since prophecy is a direct dependency in phpunit 9, blocking PHP 8.2 here forces quite a few repositories to go with --ignore-platform-req=PHP+ in their CI when they want to add PHP 8.2 based runs now. Even if their tests don't use prophecy at all.

It would be great if composer.json could allow PHP 8.2 already, even if prophecy did not implement all features or fixes just yet.

What do you think?

@ciaranmcnulty
Copy link
Member

We can't do that, there's a high probability that 8.3 will break prophecy (there hasn't really been a PHP minor that didn't break something)

I think teams testing with pre-release versions of PHP should be ok with adding an extra composer flag to their edge builds

@sbuerk
Copy link

sbuerk commented Aug 1, 2022

Than change to <8.3 in the constraint.

Not agreeing on that. We start to test early to get things done and look how dependencies are doing, helping or reporting it if there are problems (if reasonable doable).

So, can we hope on a change with PHP8.2.0 release than at least "please" ?

@ciaranmcnulty
Copy link
Member

There are zero service guarantees about when prophecy is going to support new PHP versions; it depends on the community and maintainers doing the work

The things that need to happen would be:

  1. Open issues for all the PHP 8.2 changes that could impact prophecy
  2. Fix them with test coverage
  3. Do a release when all the issues are closed

All but 3 can be done without maintainer permissions

lolli42 added a commit to lolli42/html-sanitizer that referenced this issue Aug 1, 2022
This needs the quirk --ignore-platform-req=php+ in
tests.yml since prophecy as a direct phpunit
dependency does not allow PHP 8.2 yet, even though
html-sanitizer does not use prophecy.

See phpspec/prophecy#556
@lolli42
Copy link
Author

lolli42 commented Aug 1, 2022

Alright. Thanks for feedback!

ohader pushed a commit to TYPO3/html-sanitizer that referenced this issue Aug 2, 2022
This needs the quirk --ignore-platform-req=php+ in
tests.yml since prophecy as a direct phpunit
dependency does not allow PHP 8.2 yet, even though
html-sanitizer does not use prophecy.

See phpspec/prophecy#556
@danon
Copy link

danon commented Aug 9, 2022

We can't really allow it until the new features are all supported or at least error with sensible messages; this will require someone to go through the various new features and make a list

You can use --ignore-platform-req=PHP with composer to try things out for now

So that means PhpUnit (which uses phpspec/prophecy) doesn't work on PHP 8.2?

PS: --ignore-platform-req=PHP doesn't work for PhpUnit because it will try to install older PhpUnit and fail in runtime.

What works as a workaround is adding this to composer.json.

"replace": { "phpspec/prophecy": "*" },

@sbuerk
Copy link

sbuerk commented Aug 9, 2022

@danon that would not work if you "need/want" prophecy but also PHP8.2.

@danon
Copy link

danon commented Aug 9, 2022

@sbuerk I need PhpUnit on PHP 8.2, and it also uses phpspec/prophecy

reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this issue Aug 12, 2022
This patch shifts some functional test executions in
CI workflows to PHP8.2. Thus enabling test coverage
for new PHP8.2 version in a early stage.

For nightly we only can active it for `locked` runs,
as prophecy/prophecy is not allowed to be installed
with PHP8.2 currently.
See: phpspec/prophecy#556

Backport to 11.5 is skipped for now due some issues
in "doctrine/dbal 2.x" with PHP8.2.

Resolves: #98109
Releases: main
Change-Id: I02c4dc4bd3cdd589330b038463ed58a384e3d70d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75404
Tested-by: core-ci <typo3@b13.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
@sebastianbergmann
Copy link
Contributor

So that means PhpUnit (which uses phpspec/prophecy) doesn't work on PHP 8.2?

PHPUnit 8.5 and PHPUnit 9.5 work "just fine" on PHP 8.2. Until this issue is resolved, though, you need to work around it when installing PHPUnit using Composer. If you use PHPUnit from a PHP Archive (PHAR), which you should: it's the recommended best practice, then you are not affected by this issue.

More details can be found here: sebastianbergmann/phpunit#5033 (comment)

@danon
Copy link

danon commented Aug 22, 2022

@sebastianbergmann When do you think PhpUnit will be installable through composer on php 8.2 without any workarounds?

@sebastianbergmann
Copy link
Contributor

sebastianbergmann commented Aug 22, 2022

@sebastianbergmann When so you think php unit will be instalalble Through composer on php 8.2 without any work around?

When there is a Prophecy release that supports PHP 8.2.

When PHPUnit 8.5.29 and PHPUnit 9.5.23 have been released.

@stof stof added the PHP8.2 label Sep 29, 2022
@stof stof closed this as completed Nov 29, 2022
@danon
Copy link

danon commented Nov 29, 2022

@sebastianbergmann Cool, thank you very much.

@stof
Copy link
Member

stof commented Nov 30, 2022

The Prophecy 1.16 version has support for PHP 8.2

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

Successfully merging a pull request may close this issue.

7 participants