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

php80: init at 8.0.0 #104159

Merged
merged 4 commits into from Dec 1, 2020
Merged

php80: init at 8.0.0 #104159

merged 4 commits into from Dec 1, 2020

Conversation

shyim
Copy link
Member

@shyim shyim commented Nov 18, 2020

Motivation for this change

Amazing new major version of 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.

@etu
Copy link
Contributor

etu commented Nov 25, 2020

Btw, php-8.0.0 tarballs are now on the mirrors in the expected locations. They haven't released any changelogs yet. But it's worth to start targeting that in this PR.

@shyim
Copy link
Member Author

shyim commented Nov 26, 2020

@etu Should I mark all php80Packages and extensions as broken or should I leave them?

@etu
Copy link
Contributor

etu commented Nov 26, 2020

I think it's better to leave them for now, just make sure that the php80 attribute builds with the default set. Then we can test things more and easier when it's cached.

json seems excluded from your default list of extensions, howcome? Is it builtin now or some other reason?

@shyim
Copy link
Member Author

shyim commented Nov 26, 2020

json is now always active as extension

@etu
Copy link
Contributor

etu commented Nov 26, 2020

Then we should disable json as extension if it's newer than 8.0 to not cause build errors there :)

@shyim shyim changed the title php80: init at 8.0.0RC5 php80: init at 8.0.0 Nov 26, 2020
@shyim
Copy link
Member Author

shyim commented Nov 26, 2020

So I have built 8.0.0 and included the Build Fix for Opcache from php/php-src@4633e70 ( I guess will be released with 8.0.1)

@etu I have no glue how to remove json only in php80 attribute 🙈 . Can you help me here?

@etu
Copy link
Contributor

etu commented Nov 26, 2020

I have no glue how to remove json only in php80 attribute see_no_evil . Can you help me here?

That's easy!

{ name = "json"; enable = lib.versionOlder php.version "8.0"; }

@shyim
Copy link
Member Author

shyim commented Nov 26, 2020

Done :)

@etu
Copy link
Contributor

etu commented Nov 26, 2020

So now things that depends on the json extension is failing, because it's built in and therefore doesn't exist as a separate extension.

Example in couchbase we have this:

{
  internalDeps = [ php.extensions.json ];
}

Thinking we could do something like:

{
  internalDeps = [] ++ lib.optionals (lib.versionOlder php.version "8.0") [ php.extensions.json ];
}

In places where we use php.extensions.json.

@aanderse
Copy link
Member

I think the perl package handles a situation somewhat similar. Without taking the time to think it through what would happen if we set json = null; for versions 8.0 and above?

@etu
Copy link
Contributor

etu commented Nov 30, 2020

@aanderse We can start with optionals, we've used it before.

@shyim Could you add this diff:

diff --git a/pkgs/development/php-packages/couchbase/default.nix b/pkgs/development/php-packages/couchbase/default.nix
index abe4b7efdea..58c276c1a4e 100644
--- a/pkgs/development/php-packages/couchbase/default.nix
+++ b/pkgs/development/php-packages/couchbase/default.nix
@@ -16,7 +16,7 @@ buildPecl {
   configureFlags = [ "--with-couchbase" ];
 
   buildInputs = with pkgs; [ libcouchbase zlib ];
-  internalDeps = [ php.extensions.json ];
+  internalDeps = [] ++ lib.optionals (lib.versionOlder php.version "8.0") [ php.extensions.json ];
   peclDeps = [ php.extensions.igbinary ];
 
   patches = [
diff --git a/pkgs/development/php-packages/redis/default.nix b/pkgs/development/php-packages/redis/default.nix
index 41ff8f38689..a61ae1194ff 100644
--- a/pkgs/development/php-packages/redis/default.nix
+++ b/pkgs/development/php-packages/redis/default.nix
@@ -7,8 +7,9 @@ buildPecl {
   sha256 = "1cfsbxf3q3im0cmalgk76jpz581zr92z03c1viy93jxb53k2vsgl";
 
   internalDeps = with php.extensions; [
-    json
     session
+  ] ++ lib.optionals (lib.versionOlder php.version "8.0") [
+    json
   ] ++ lib.optionals (lib.versionOlder php.version "7.4") [
     hash
   ];

This will fix the eval, then I think we can merge this and start testing it.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 1, 2020

  • For Couchbase, the patch above is not sufficient. It needs For PHP 8 support couchbase/php-couchbase#31 but that does not apply because we only have legacy branch of php-couchbase. We probably need to remove couchbase from php80.extensions.

  • For blackfire, I pushed c2f1e7b to master.

  • For Imagick, we need:

    --- a/pkgs/development/php-packages/imagick/default.nix
    +++ b/pkgs/development/php-packages/imagick/default.nix
    @@ -1,4 +1,4 @@
    -{ buildPecl, lib, pkgs, pcre' }:
    +{ buildPecl, fetchpatch, lib, pkgs, pcre' }:
     
     buildPecl {
       pname = "imagick";
    @@ -6,6 +6,14 @@ buildPecl {
       version = "3.4.4";
       sha256 = "0xvhaqny1v796ywx83w7jyjyd0nrxkxf34w9zi8qc8aw8qbammcd";
     
    +  patches = [
    +    # Fix compatibility with PHP 8.
    +    (fetchpatch {
    +      url = "https://github.com/Imagick/imagick/pull/336.patch";
    +      sha256 = "nuRdh02qaMx0s/5OzlfWjyYgZG1zgrYnAjsZ/UVIrUM=";
    +    })
    +  ];
    +
       configureFlags = [ "--with-imagick=${pkgs.imagemagick.dev}" ];
       nativeBuildInputs = [ pkgs.pkgconfig ];
       buildInputs = [ pcre' ];

@shyim
Copy link
Member Author

shyim commented Dec 1, 2020

We could mark couchbase as broken until there is a upstream version of it

@etu
Copy link
Contributor

etu commented Dec 1, 2020

We could mark couchbase as broken until there is a upstream version of it

Yeah, that's fine :)

@jtojnar
Copy link
Contributor

jtojnar commented Dec 1, 2020

Should we update extensions that have new version supporting PHP 8 here? E.g. XDebug. Even though it might have API changes like Couchbase 3?

@shyim
Copy link
Member Author

shyim commented Dec 1, 2020

@jtojnar XDebug 3 contains also complete new configuration. Maybe build a own package of it?

@etu
Copy link
Contributor

etu commented Dec 1, 2020

xdebug 3.0 is already updated in #105332

@etu
Copy link
Contributor

etu commented Dec 1, 2020

@shyim The optional for json in couchbase is still needed to fix eval

And a rebase on master should give us xdebug 3 to test with.

@shyim
Copy link
Member Author

shyim commented Dec 1, 2020

Rebased, added json as optional and marked as broken for php 8

Copy link
Contributor

@etu etu left a comment

Choose a reason for hiding this comment

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

I'd say that this is good to go for now.

We don't break eval. We have a building package with all default extensions that existed since before in the default install.

We can always touch up things later when it's easier to test with binary caches etc.

Marking packages that doesn't build as broken is a common practice before next release if we don't get to it before then.

@etu etu merged commit d5c9e8e into NixOS:master Dec 1, 2020
@aanderse
Copy link
Member

aanderse commented Dec 1, 2020

🎉 thanks everyone!

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

5 participants