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: build from github source #89329

Draft
wants to merge 9 commits into
base: master
from
Draft

php: build from github source #89329

wants to merge 9 commits into from

Conversation

@Izorkin
Copy link
Contributor

Izorkin commented Jun 1, 2020

Motivation for this change

Build php packages from github sources.
The source files on php.net are created using these scripts:
https://github.com/php/php-src/blob/php-7.4.6/scripts/dev/makedist
https://github.com/php/php-src/blob/php-7.4.6/scripts/dev/genfiles
https://github.com/php/php-src/blob/php-7.4.6/buildconf

@NixOS/php

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.
@Ma27
Copy link
Member

Ma27 commented Jun 2, 2020

Can you explain to me why this is an improvement over the current package?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 2, 2020

Releases (both stable and unstable) are published to github before php.net. With this change, we can test unstable releases sooner. Also we can test 8.0-dev version with this change.

@Izorkin Izorkin force-pushed the Izorkin:php-github branch from 9a99154 to 29364e0 Jun 2, 2020
@Ma27
Copy link
Member

Ma27 commented Jun 2, 2020

I'm fine with testing unstable packages sooner, but please be cautious about tags being published on github.com: I still remember when PHP 7.0.0 was released (on Dec 03 2015), people wrongly assumed that it was out on Dec 01 2015 since this was the date where the tag was published.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 2, 2020

@NixOS/php who can check correct working of this patch:

diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 548aaec89cb..1c0fed6b3be 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -197,12 +197,7 @@ let

           postPatch = ''
             # Don't record the configure flags since this causes unnecessary runtime dependencies
-            for i in main/build-defs.h.in scripts/php-config.in; do
-              substituteInPlace $i \
-                --replace '@CONFIGURE_COMMAND@' '(omitted)' \
-                --replace '@CONFIGURE_OPTIONS@' "" \
-                --replace '@PHP_LDFLAGS@' ""
-            done
+            substituteInPlace main/build-defs.h.in --replace '@CONFIGURE_COMMAND@' '(omitted)'
           '' + lib.optionalString (lib.versionOlder version "7.4") ''
             # https://bugs.php.net/bug.php?id=79159
             substituteInPlace ./acinclude.m4 --replace "AC_PROG_YACC" "AC_CHECK_PROG(YACC, bison, bison)"
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index fd372c1e030..b08bd5ba8e6 100644

No build errors.
This code is added in this commit - 64b3974#diff-e3f1a5e8a80452693ffb5de49ae02c5bR251-R258

@jtojnar
Copy link
Contributor

jtojnar commented Jun 2, 2020

@Izorkin Actual origin seems to be 94dfd4b, you just linked a refactoring commit.

The file still seems to be there, so it is probably needed.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 3, 2020

@jtojnar these changes were done quite a long time ago. Probably something was changed in build process since that time.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@etu
Copy link
Contributor

etu commented Jun 3, 2020

be cautious about tags being published on github.com

I totally agree with this. PHP does the official releases with changelogs on their website. Those tarballs are the ones that they say that people should use.

So I'm skeptical to the entire effort due to this.

@Izorkin Izorkin force-pushed the Izorkin:php-github branch from 72fe1d2 to 679a01a Jun 3, 2020
@Izorkin Izorkin force-pushed the Izorkin:php-github branch from 679a01a to 984ec73 Jun 4, 2020
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 4, 2020

@GrahamcOfBorg build php73.unwrapped

@Izorkin Izorkin force-pushed the Izorkin:php-github branch from 984ec73 to dab7cb9 Jun 4, 2020
@Izorkin Izorkin force-pushed the Izorkin:php-github branch from dab7cb9 to 825c3ac Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.