In 2022, nixpkgs changed the default PHP build from ZTS (Zend Thread Safety) to NTS (non-thread-safe) as discussed in NixOS/nixpkgs#154774. Since then, nixpkgs has provided only the NTS build; there is currently no separate PHP ZTS package or variant.
A couple of things has changed since then. First, PHP upstream is planning to deprecate NTS builds and make ZTS the default starting from PHP 8.6, according to the PHP internals discussion. Second, the performance overhead of ZTS has been greatly eliminated, so there’re less reasons to use NTS build now. In addition, an increasing number of PHP libraries and extensions require or benefit from ZTS builds. Not having a ZTS variant in nixpkgs can make it inconvenient for developers who need to work with them.
Given these situation, what would be the preferred way to adapt nixpkgs? I see three possible approaches:
-
Switch the default PHP build back to ZTS.
-
Switch the default PHP build back to ZTS, and provide separate NTS packages, such as
php-nts,php83-nts, etc. -
Keep NTS as the default, but provide separate ZTS builds, such as
php-zts,php83-zts, etc.
I’m interested in the nixpkgs maintainers’ perspective on this topic.