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

Closed
wants to merge 10 commits into from
Closed

php: build from github source #89329

wants to merge 10 commits into from

Conversation

Izorkin
Copy link
Contributor

@Izorkin 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.

@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 php-github branch 2 times, most recently from 679a01a to 984ec73 Compare June 4, 2020 07:23
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 4, 2020

@GrahamcOfBorg build php73.unwrapped

@jbboehr
Copy link
Contributor

jbboehr commented Dec 6, 2020

As a PHP extension developer that uses NixOS, testing against php master has been a pain. Although, personally, I think it would be ideal to fetch the official release tarballs instead of those from GitHub for the actual derivations, it would be very nice for an easy way to override the src with php master from GitHub. I suspect the other changes in the PR are required for that to work correctly?

@Izorkin
Copy link
Contributor Author

Izorkin commented Dec 6, 2020

@jbboehr build option required using tarballs and github sources? Have not tried this way.

@Izorkin
Copy link
Contributor Author

Izorkin commented Dec 15, 2020

cc @NixOS/php

@Izorkin Izorkin marked this pull request as ready for review December 15, 2020 09:46
@ajs124 ajs124 mentioned this pull request Apr 29, 2021
10 tasks
@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@Izorkin
Copy link
Contributor Author

Izorkin commented Dec 9, 2022

@etu @jtojnar this PR is no longer actual?

@jtojnar
Copy link
Contributor

jtojnar commented Dec 9, 2022

Yeah, it is now easy to use a different source as needed, like we did for 8.2:

#201000

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 9, 2022
@Izorkin Izorkin closed this Dec 9, 2022
@Izorkin Izorkin deleted the php-github branch December 9, 2022 20:43
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

7 participants