-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Migrate resource returned by proc_open() to opaque object #12098
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
base: master
Are you sure you want to change the base?
Conversation
f0c3a92
to
2c368c4
Compare
2c368c4
to
3eb1029
Compare
3eb1029
to
04aed09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of questions and issue I can spot in the existing implementation.
Also for when, if ever, we do the stream resource to opaque object conversion is it noted that proc_open()
stores an array of streams?
Also seems there is some issue on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like, this is not a simple change that introduces compatibility breaks.
I think this should be better designed first. We also need to know all the introduced breaks.
Probably this needs an RFC.
As far as I can see the only BC break is using |
I was a bit confused by changes in PHPT tests. But now I see, that the usage of resource returned from I think reserving I still ask to minimize the patch. |
@dstogov @Girgias I appreciate your reviews, thank you! I'll get back to address your comments in the following days/week. Regarding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should get some discussion on internals - specifically the Process
class name... Please also reduce the diff - it makes review much harder.
Also Windows failure seems related. |
@kocsismate btw I didn't see your comment as it happened during my review :) |
46aa88b
to
4a77368
Compare
4a77368
to
6b78833
Compare
There is a related test failure.
|
I'm not sure exactly why, but now Windows tests stopped hanging. |
Can I have a review round again please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see problems.
I'm not complteley sure about name "Standard\Process" but anyway it's better than "Process".
As I said this should be discussed on internals on internals. Especailly the naming and introducing Standard namespace is definitely for dicsussion and maybe RFC if there is no agreement. I would personally prefer to delay it to 9.0 as that Btw. the fact that something has been done without discussion / RFC before is not a valid argument. As soon as there are objections, RFC or at least proper discussion is necessary whatever the previous changes are. |
And I know that repurposing |
I don't think repurposing |
I know that you can change it and compare it with I have seen lots of code using the |
@Girgias That check won't be enough if you accept resources in a public api in a lib @bukka What's wrong with userland solutions like mine? https://github.com/arokettu/is-resource |
PHP does not follow semver and has always made some BC breaks in minor versions. Moreover, the consensus around the release of PHP 8.0, was clearly to focus on converting E_WARNINGs to TypeErrors/ValueErrors as converting warnings in a minor release was not something that had ever been done; whereas converting resources to object had been done in minor versions (e.g. GMP in 5.6, HashContext in 7.2). Thus, we deprioritized converting resources to opaque objects in 8.0 as it was expected we could continue this work in minor releases (considering the quantity of resource there were to convert). Now deciding that those changes are not doable and that one should have committed time to it at an arbitrary point in the past, or at an arbitrary point in the future does not lead to a productive way for contributing to this project. This is not to say that changing Especially as the writing has been on the wall for resources, especially since 8.0.0, and it should be clear how to deal with those conversions nowadays.
But that's, IMHO, incorrect,
Public APIs can guard the call to |
I will also say, if we want PHP to follow semver, then all the extensions should be unbundled and moved to PECL, so they can evolve independently of the runtime. And people could decide to stick with previous versions of the extension rather than be forced to upgrade as it is currently the case. |
I have never said we do semver. It's just that we always tried to leave bigger BC breaks for major versions. I think converting object to resources is a bigger BC break and thus should be left for major version especially for more used resources like the ones in standard ext. In case of gmp it was ok because it was part of overloading RFC so it made in some way a sense and followed a proper process. The other changes in minor versions were more questionable (especially pgsql in 8.1). I don't think we will probably agree on this which is fine and that's why this should go through RFC where it can be decided. This is not really right place to discuss it anyway. In terms of this change it would be good to have RFC to also confirm if everyone is happy with introduction of Standard namespace which I think should be confirmed as well. |
The mentioned RFC has been proposed and it has been accepted that the process ressource should be converted for PHP 9.0, so I'm marking this PR with the respective milestone. |
As part of php/php-tasks#6