Page MenuHomeFreeBSD

PHP 7.4
ClosedPublic

Authored by tz on Aug 20 2019, 11:06 PM.

Details

Summary

This is WIP of introducing PHP 7.4

There are many greater changes:

  • Remove of interbase module
  • Remove of recode module
  • Remove of wddx module
  • Many modules changes the build switches
  • Many modules changes the config format, so patches needed to be recreated
  • SSL / OpenSSL seems to work differently now

Still broken modules: imap, gd, pdo_dblib
Need some rethinking: openssl -> switched from base to ports; this works but does not make me happy

I'm currently hitting a wall so i'm happy about every help i can get.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Before you asked: yes, all is a repo-copy. I used --show-copy-as-ads in order to let you use the review for your own build-tests.

As you said, this is useful for testing, but a standard diff might be useful, too, to see what actually changed from php 7.2

In D21349#464775, @ale wrote:

As you said, this is useful for testing, but a standard diff might be useful, too, to see what actually changed from php 7.2

You can find a standard diff of the current WIP here:
http://www.meisterderspiele.de/freebsd/php-7.4.diff

tobik requested changes to this revision.Aug 30 2019, 7:11 AM
In D21349#465436, @tz wrote:
In D21349#464775, @ale wrote:

As you said, this is useful for testing, but a standard diff might be useful, too, to see what actually changed from php 7.2

You can find a standard diff of the current WIP here:
http://www.meisterderspiele.de/freebsd/php-7.4.diff

It would be more useful to have that diff here on Phabricator for review purposes. It's very hard to review this here otherwise.

lang/php74/Makefile.ext
198

Having a manual dependency on security/openssl instead of going with USES=ssl (i.e., using the SSL implementation users have selected) is a huge red flag. It is obviously not right and will break any system where packages are not built with DEFAULT_VERSIONS+=ssl=openssl. It seems like a regression to what is in lang/php73/Makefile.ext now.

Why is it needed?

This revision now requires changes to proceed.Aug 30 2019, 7:11 AM

I updated the review to contain the diff only, like requested. Hopefully you can work with this better now.

I reverted the BUILD_DEPENDS to security/openssl.

I introduced it, because it solved the following error:

checking for RAND_egd... yes
checking for openssl >= 1.0.1... no
configure: error: Package requirements (openssl >= 1.0.1) were not met:

Package 'openssl', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
===>  Script "configure" failed unexpectedly.
Please report the problem to tz@FreeBSD.org [maintainer] and attach the
"/wrkdirs/usr/ports/security/php74-openssl/work/php-7.4.0beta4/ext/openssl/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make: stopped in /usr/ports/security/php74-openssl

I have no idea left, how to solve this.

lang/php74/Makefile.ext
197–204

It builds for me if I replace the entire block with

.if ${PHP_MODNAME} == "openssl"
USES+=			ssl
CONFIGURE_ARGS+=	--with-openssl
CONFIGURE_ENV+=		OPENSSL_CFLAGS="-I${OPENSSLINC}" \
			OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
.endif
security/php74-openssl/Makefile
11

This needs to go too.

tz marked 2 inline comments as done.Sep 1 2019, 9:58 PM
tz added inline comments.
lang/php74/Makefile.ext
197–204

This works fine :)

But using this for php74-imap does not work. :/

Also: i tried this way by using the porters handbook. But it wasn't a big help, since i'm not very familiar with the whole build process. Do you have a resource for me to become better at this?

Thanks!

This comment was removed by joneum.

@ale Can you please review the changes of php.mk?
I would like to commit the RC1 without the broken modules imap and gd. I do not want to wait until the end and miss the interval to have runtime testing with an RC.

lang/php74/Makefile.ext
150

php74-imap builds if we also set PHP_OPENSSL=yes (only tested with beta4):

.if ${PHP_MODNAME} == "imap"
PHP_MOD_PRIO=	30
OPTIONS_DEFINE=	PANDA
PANDA_DESC=	Uses the forked panda-cclient instead of the original cclient

CONFIGURE_ARGS+=--with-imap=${LOCALBASE} \
		--with-pcre-dir=${LOCALBASE} \
		--with-imap-ssl
CONFIGURE_ENV+=		OPENSSL_CFLAGS="-I${OPENSSLINC}" \
			OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" \
			PHP_OPENSSL=yes
USES+=  ssl
.endif

@tobik Thank you, this works with RC 1 too! :)

So now only graphics/php74-gd is left and broken. The error is:

/bin/sh /wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/libtool --mode=compile cc -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/libgd -I. -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd -DPHP_ATOM_INC -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/include -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/main -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/freetype2  -DHAVE_CONFIG_H  -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -c /wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c -o gd.lo
mkdir .libs
 cc -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/libgd -I. -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd -DPHP_ATOM_INC -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/include -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/main -I/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/freetype2 -DHAVE_CONFIG_H -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -c /wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c  -fPIC -DPIC -o .libs/gd.o
/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c:1097:2: warning: implicit declaration of function 'gdFontCacheMutexSetup' is invalid in C99 [-Wimplicit-function-declaration]
        gdFontCacheMutexSetup();
        ^
/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c:1236:2: warning: implicit declaration of function 'gdFontCacheMutexShutdown' is invalid in C99 [-Wimplicit-function-declaration]
        gdFontCacheMutexShutdown();
        ^
/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c:1303:50: warning: implicit declaration of function 'gdJpegGetVersionString' is invalid in C99 [-Wimplicit-function-declaration]
                php_info_print_table_row(2, "libJPEG Version", gdJpegGetVersionString());
                                                               ^
/wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/gd.c:1311:48: warning: implicit declaration of function 'gdPngGetVersionString' is invalid in C99 [-Wimplicit-function-declaration]
        php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString());
                                                      ^
4 warnings generated.
make: don't know how to make /wrkdirs/usr/ports/graphics/php74-gd/work/php-7.4.0RC1/ext/gd/libgd/gd.c. Stop
lang/php74/Makefile.ext
105

graphics/php74-gd (beta4 again) builds fine if I add --with-external-gd here.

--with-freetype and --with-jpeg can be dropped since they only make sense if using the bundled libgd which we do not do.

Thank you @tobik , this works! And it was the last piece. So everything is compiling and running now! :)

I will do some additional runtime tests, but up until now it looks fine. So i'm waiting for @ale to approve the needed changes of bsd.mk.

Thank you all!

Found and fix plist-issue for FPM

Fix another plist issue with the php-fpm config

Add new module devel/php74-ffi and fix net-mgmt Makefile.

I now have done all build tests on 11.2, 11.3 and 12.

I have also done runtime tests with various modules and i already have RC 1 running one of my projects.

Everything looks fine to me. So when @ale will approve the changes of php.mk, i'm going to commit it. :)

Thank you all for your help!

I'm sorry to bother you @ale , but without your approval i am not allowed to commit the needed change to php.mk. Can you please have a look at it?

In D21349#473537, @tz wrote:

I'm sorry to bother you @ale , but without your approval i am not allowed to commit the needed change to php.mk. Can you please have a look at it?

USES are not exempt from maintainer timeouts. FWIW the changes to php.mk look ok to me.

Sorry for the delay, I've added my comments. For the rest you can go ahead.

Mk/Uses/php.mk
178

If the hash extension is installed by default (I haven't checked, but it looks like so), then this should be PHP_EXT_INC=hash pcre spl.
Same change in the php74 Makefile, and the hash extension should be readded to _USE_PHP_ALL

lang/php74-extensions/pkg-descr
1

This should say PHP 7.4.

4

Here we should remove hash and add opcache.

tz marked 3 inline comments as done.Sep 19 2019, 6:30 PM

Changed like requested by ale :)

tz marked 3 inline comments as done.Sep 19 2019, 9:41 PM

There a wrong MAINTAINER lines, for example www/mod_php74:

MAINTAINER= ports@FreeBSD.org

I think, this Lines are needless?

There a wrong MAINTAINER lines, for example www/mod_php74:

MAINTAINER= ports@FreeBSD.org

I think, this Lines are needless?

There are only 3 maintainer lines in:

  • lang/php74
  • lang/php74-extensions
  • www/mod_php74

The last one has another maintainer because i really have no idea about how to maintain it. When it breaks, it always has something to do with changes in apache. And i lost contact to apache years ago ;)

lang/php74/Makefile
168

'hash' has to be added here, too.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 20 2019, 12:21 PM
This revision was automatically updated to reflect the committed changes.

My previous comment is still valid, I see that the hash extension has not been added to lang/php74/Makefile into PHP_EXT_INC