Skip to content
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

php: update build config and php package #62783

Merged
merged 5 commits into from Jun 12, 2019
Merged

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 6, 2019

Motivation for this change

With enable apxs2Support php automatic buildinfg with --enable-maintainer-zts
Enable build phpPackages with re2c.

checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

Remove options valgrindPcreSupport. This options not used with external PCRE

configure: WARNING: PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect

Update buyild config. Packages autoconf, bison, flex, libtool, pkgconfig, re2c need only build php - https://www.php.net/manual/en/install.unix.php

When building directly from Git sources or after custom modifications you might also need:

autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0), 2.64+ (for PHP >= 7.2.0)
automake: 1.4+
libtool: 1.4.x+ (except 1.4.2)
re2c: Version 0.13.4 or newer
flex: Version 2.5.4 (for PHP <= 5.2)
bison:
PHP 5.4: 1.28, 1.35, 1.75, 1.875, 2.0, 2.1, 2.2, 2.3, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.5, 2.5.1, 2.6, 2.6.1, 2.6.2, 2.6.4
PHP 5.5: 2.4, 2.4.1, 2.4.2, 2.4.3, 2.5, 2.5.1, 2.6, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7
PHP 5.6: >= 2.4, < 3.0
PHP 7.0 - 7.3: 2.4 or later (including Bison 3.x)
PHP 7.4: > 3.0

Update phpPackage event to 2.5.2

cc @etu

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@aanderse
Copy link
Member

aanderse commented Jun 7, 2019

@Izorkin Please add details for Determined the impact on package closure size (by running nix path-info -S before and after). What does adding re2c specifically do?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 7, 2019

@aanderse PHP generates its lexer using re2c from the zend_language_scanner.l definition file - https://phpinternals.net/categories/lexer
running nix path-info -S error:

error: Please be informed that this pseudo-package is not the only part of
Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
without some special measures to handle failing packages, like those taken
by Hydra.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

du -h --max=0 -c $(nix-store -qR /run/current-system) | sort -h | tail

31M     /nix/store/8nrqdc8p3pigwkzski77h8xdbpn4nxip-icu4c-59.1
34M     /nix/store/2dfjlvp38xzkyylwpavnh61azi0d168b-binutils-2.31.1
49M     /nix/store/dq7zwi5phgbdlr19l2iy3bbffhvgnilj-python-2.7.16
57M     /nix/store/fqbrwq2gvv97lb0albmfb2x212azzp46-python3-3.7.3
58M     /nix/store/vzwvfyslchj8j3xk9b1dqs8mrr1hfzd5-perl-5.28.2
78M     /nix/store/gs2w3h2bh8ijf64w76i28fdm1b9hll41-linux-4.19.48
89M     /nix/store/b4bq1q3gq4dgyhdccbfmvm6a9jzk0rzg-php-7.2.19
123M    /nix/store/wzrv1xk177p4zazzv26288c936375c23-glibc-locales-2.27
131M    /nix/store/apcaggi0q3vrb4ha1b07cjxiim2li5ly-gcc-7.4.0
1,3G    итого

after update

31M     /nix/store/8nrqdc8p3pigwkzski77h8xdbpn4nxip-icu4c-59.1
34M     /nix/store/2dfjlvp38xzkyylwpavnh61azi0d168b-binutils-2.31.1
49M     /nix/store/dq7zwi5phgbdlr19l2iy3bbffhvgnilj-python-2.7.16
57M     /nix/store/fqbrwq2gvv97lb0albmfb2x212azzp46-python3-3.7.3
58M     /nix/store/vzwvfyslchj8j3xk9b1dqs8mrr1hfzd5-perl-5.28.2
78M     /nix/store/gs2w3h2bh8ijf64w76i28fdm1b9hll41-linux-4.19.48
89M     /nix/store/i5my5kp5mvq31qa1gf4c9j9ji7c068wf-php-7.2.19
123M    /nix/store/wzrv1xk177p4zazzv26288c936375c23-glibc-locales-2.27
131M    /nix/store/apcaggi0q3vrb4ha1b07cjxiim2li5ly-gcc-7.4.0
1,3G    итого

@aanderse
Copy link
Member

@Izorkin Why are you looking to generate the parsers with re2c? What functionality is missing that gets added? I've noticed several times when compiling libraries the warning that re2c is unavailable but I don't know what adding it does.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

@aanderse PHP generates its lexer using re2c from the zend_language_scanner.l definition file - https://phpinternals.net/categories/lexer

@aanderse
Copy link
Member

@Izorkin I understand what a lexer is. I'm familiar with re2c. It is a great piece of software.

I'm asking what features are missing from php without having re2c available?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

@aanderse i do not know. I just removed the message varning.

@aanderse
Copy link
Member

It would be nice to know what value having re2c available at build time provides before this gets merged in my opinion.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

Is there an option how to check?

@aanderse
Copy link
Member

Maybe the documentation explains.

I'll mention that I've seen this same warning not just in NixOS but Debian as well. Possibly RedHat, though I'm not certain on that.

@etu
Copy link
Contributor

etu commented Jun 11, 2019

If we don't see any benefit of including this, like feature, performance or security wise I don't see any point in including it.

And warnings during compilations of software is not uncommon, it happens on every distro everywhere because of different versions of libs, compilers, kernels, headers, etc. It happens everywhere. So just to silence warnings is not a good enough reasons to me.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

re2c is already in use when building
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/php/default.nix#L62
I removed the re2cSupport option and transferred re2c to nativeBuildInputs

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

Found information - https://grokbase.com/t/php/php-internals/0832kd02zs/rfc-replace-the-flex-based-scanner-with-an-re2c-1-based-lexer
Packages re2c replace flex lexer.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

@Izorkin Thanks for doing the research! The oci8 package compiles against both php72 and php73.

@etu
Copy link
Contributor

etu commented Jun 12, 2019

@GrahamcOfBorg build php71 php71Packages.composer php71Packages.event php72 php72Packages.composer php72Packages.event php73 php73Packages.composer php73Packages.event

@etu
Copy link
Contributor

etu commented Jun 12, 2019

Found information - https://grokbase.com/t/php/php-internals/0832kd02zs/rfc-replace-the-flex-based-scanner-with-an-re2c-1-based-lexer
Packages re2c replace flex lexer.

Now that's a good reason and good resource, thanks. I just want to see that it all builds on all platforms first :)

@etu etu merged commit 039983b into NixOS:master Jun 12, 2019
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 12, 2019

Thanks!

@Izorkin Izorkin deleted the php-packages branch June 12, 2019 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants