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

[WIP] PHP: Make the default package more sane [v2] #83514

Closed
wants to merge 15 commits into from

Conversation

etu
Copy link
Contributor

@etu etu commented Mar 27, 2020

Motivation for this change

Our old PHP derivation was crazy big with a crazy amount of enabled extensions that also had a crazy amount of defaults that we pulled in, yet excluded some extensions that would have been nice to have by default.

This is a follow up on: #82348 to utilize #79377 more. And also a follow-up on all of the work done by me and @talyz in #82794.

The current PHP

The current closure size is:

/nix/store/4ga497cqvz04vcyw9lf7s74ymrc6r28g-php-7.4.3      245697960

And this contains things (among others) like:

/nix/store/2zsgfrkp0hn878rnrp0azpmy76ljm2b0-linux-pam-1.3.1       56161288
/nix/store/y5166rf2lkxkf3991qm390vn92czgfgh-openldap-2.4.49       56167840
The new smaller PHP

Here we have a smaller closure size:

/nix/store/94ny228zal94jm1q7ffryi5d1w18mbbr-php-with-extensions-7.4.3	 189682368

But we can also get a smaller base package

/nix/store/v5v6wn207ibpp6n90z05f11k7svq94wd-php-7.4.3	  89608568
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

talyz and others added 15 commits March 28, 2020 12:57
The tests for many of the extensions run just fine, for some a small
portion fail. This runs the tests by default and disables the tests
extensions with any failing tests.
Older versions of PHP have a bug where header files are included in
the wrong order. This is only an issue when compiling the opcache
extension as a separate module, like we do.
A slight rewrite of buildEnv which:

1. Makes buildEnv recursively add itself to its output, so that it can
   be accessed from any php derivation.

2. Orders the extension text strings according to their internalDeps
   attribute - dependencies have to be put before dependants in the
   php.ini or they will fail to load due to missing symbols.
@etu
Copy link
Contributor Author

etu commented Mar 30, 2020

No need to review this, we have more things coming that will overwrite this branch. :)

@etu etu closed this Mar 31, 2020
@etu etu deleted the slim-down-default-php-v2 branch April 5, 2020 18:02
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

2 participants