Skip to content

Conversation

krakjoe
Copy link
Member

@krakjoe krakjoe commented Mar 23, 2019

This contains cleanup for TSRM in PHP 8, removing old defines, API's and integrations that are not used (or don't work):

  • ZTS requires pthreads or w32 threads: GNUPTH, SGI ST, and BETHREADS are not supported by the current requirements of ZTS, and do not and or cannot work, and so support has been removed.
  • TSRM_* decl and call #defines haven't been used since PHP5 and so have been removed
  • tsrm_set_interpreter_context and related API functions cannot work with TSRM since PHP5 and so have been removed.

What we are left with is the bare minimum, working ZTS and TSRM layer, with simple requirements and a clean API.

Note that this could target 7.4, however, I feel more comfortable targeting PHP 8 in light of the fact that this removes TSRMLS_D, _DC, _C, and _CC which we even had in php-src, and have been widespread for most of the last ~19 years. In addition, I'm not able to determine the reason for support GNUPTH and other related obscure libraries: I know that ZTS expects pthreads, our use of native TLS is predicated upon POSIX.1c or w32 threads, nevertheless I'd like to give anyone who thinks these obscure integrations are necessary ample time to come forward and work on those integrations - at least GNUPTH is able to operate in a POSIX.1c compliant way, and so it may in theory be possible to integrate with it, although by default and in testing it does not work.

Note also, the windows build is broken by interbase, which is using TSRM api's incorrectly and unsafely, I think interbase is targeted for removal in PHP8, and I don't see a safe way to change it to build, I leave these changes to (a non-existent) maintainer of the extension.

EDIT: I disabled interbase on av, so that we can see the rest of the build run ...

@krakjoe krakjoe requested a review from weltling March 23, 2019 07:21
Copy link
Contributor

@weltling weltling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok for 8.0, as for me. Pthreads is now very wide and it utilizes platform specific features as well, where applicable.

Regarding GNUPTH - the use case could be currently CLI only, but there are no extensions making it possible. Furthermore, there are no SAPI requiring it in first place. Non preemptive threads could be an interesting topic in any regard, just that we have no practical case for that right now or in the near future.

I'd be great if @dstogov could verify as well.

Thanks.

@KalleZ
Copy link
Member

KalleZ commented Mar 24, 2019

BETHREADS should be safe to remove as I removed support for BEOS a while back, I doubt Haiku uses this API (but we do not fully support Haiku anyway)

@dstogov
Copy link
Member

dstogov commented Mar 25, 2019

I don't see any problems.

@krakjoe
Copy link
Member Author

krakjoe commented Mar 25, 2019

Merged as bd73607

Thanks.

@krakjoe krakjoe closed this Mar 25, 2019
cmb69 added a commit to cmb69/web-rmtools that referenced this pull request Mar 25, 2019
Commit bd73607 of php-src[1] broke the ext/ibase build; following Joe's
reasoning[2] we disable the ext/interbase builds (at least for now).

[1] <http://git.php.net/?p=php-src.git;a=commit;h=bd73607b9e4811e7caa9d2ff4d227626ffd35dab>
[2] <php/php-src#3976 (comment)>
php-pulls pushed a commit to php/web-rmtools that referenced this pull request Mar 26, 2019
Commit bd73607 of php-src[1] broke the ext/ibase build; following Joe's
reasoning[2] we disable the ext/interbase builds (at least for now).

[1] <http://git.php.net/?p=php-src.git;a=commit;h=bd73607b9e4811e7caa9d2ff4d227626ffd35dab>
[2] <php/php-src#3976 (comment)>
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 this pull request may close these issues.

4 participants