php / php-src

The PHP Interpreter
https://www.php.net
Other
38.21k stars 7.75k forks source link

GNU Readline should be replaced with libedit #15882

Open petk opened 2 months ago

petk commented 2 months ago

Description

The following when using Autotools build system:

./buildconf
./configure --with-readline
# or ./configure --with-readline --enable-phpdbg-readline
make

Results in successful build, but the linked library GNU Readline is licensed under the GNU GPL 3 license, which means that PHP then shouldn't be distributed to anyone. PHP provides linking with the libedit library (--with-libedit) as a replacement in this case. However, build system should not contain such issues. This is not that obvious for people just starting to build PHP and trying to provide it to other users.

There is https://github.com/php/php-src/pull/13184 where the GNU Readline is replaced with libedit only.

Should we target PHP 8.4?

PHP Version

any

Operating System

*nix

cmb69 commented 2 months ago

It seems to me the question is whether building is already a license violation, or whether only redistribution might be. If the former, we should indeed drop support for building against libreadline as soon as possible (still, a deprecation phase might be in order). If the latter, we should either have a proper deprecation phase (and remove support as of PHP 9.0.0), or we may consider to figure out a way to change the defaults (something like --with-readline builds against libedit, and have an option to still build against libreadline).

NattyNarwhal commented 1 month ago

I think removing support is too late for 8.4, but switching the default might be doable.

kadler commented 1 month ago

It seems to me the question is whether building is already a license violation, or whether only redistribution might be.

AFAIK (not a lawyer), but you're free to do anything you want with GPL code. The license terms only come in to effect when you distribute it. So building against readline would be fine, so long as it's for your own personal use and don't give it to anyone else (what constitutes "distribution" inside a company I'm not gonna even touch).