!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

76 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
14 Aug 2023
@tgerbet:matrix.orgtgerbet There is the work of Pol https://github.com/loophp/nix-php-composer-builder 18:17:04
15 Aug 2023
@10leej:matrix.org@10leej:matrix.org left the room.19:34:37
20 Aug 2023
@stephank:stephank.nlStéphan joined the room.18:16:30
@skochen:matrix.orgStéphan left the room.18:26:39
30 Aug 2023
@lstrojny:matrix.orgLars Strojny

Pol: I am trying to upgrade to the latest nix-shell version with this custom flake and I am getting this error:

error: attribute 'api' missing

       at /nix/store/dhfg509620jwb0g4v83vxnrlphz3l6by-source/flake.nix:27:17:

           26|         phps = map
           27|           (php: pkgs.api.buildPhpFromComposer { inherit php; src = inputs.self; })

Any hints?

07:28:14
@drupol:matrix.orgPol Lars Strojny: that project has been completely rewritten not so long ago. I'm now relying on https://github.com/loophp/nix-php-composer-builder and no longer expose `api` in loophp/nix-shell. 07:47:55
@drupol:matrix.orgPolThat new flake will be integrated in nixpkgs soon07:48:27
@drupol:matrix.orgPolThe work is at https://github.com/NixOS/nixpkgs/pull/24818407:49:18
@drupol:matrix.orgPolI did that to ease the transition when that PR will be merged 07:49:48
@drupol:matrix.orgPolYou might also like the default basic template for PHP projects in there.08:19:25
@drupol:matrix.orgPolSee the doc: https://github.com/loophp/nix-php-composer-builder#usage08:19:45
@lstrojny:matrix.orgLars Strojny
In reply to @drupol:matrix.org
Lars Strojny: that project has been completely rewritten not so long ago. I'm now relying on https://github.com/loophp/nix-php-composer-builder and no longer expose `api` in loophp/nix-shell.
Ah, thank you very much. Bad timing on my side ;)
09:49:53
@drupol:matrix.orgPolFeel free to test that thing, since it's going to be merged in nixpkgs at some point, testers are always welcome.09:52:45
@lstrojny:matrix.orgLars StrojnyIt works fine but I get a warning: "The pcre extension does not exist, ignoring." That’s both true and not true. ext/pcre exists but it cannot be deactivated AFAIK15:36:02
31 Aug 2023
@drupol:matrix.orgPolTrue. This is something new in the new version.06:04:49
@drupol:matrix.orgPolMaybe I should update the error message !06:05:08
@drupol:matrix.orgPolIt's in here: https://github.com/loophp/nix-php-composer-builder/blob/main/src/build-support/build-php-from-composer.nix#L6106:05:49
@drupol:matrix.orgPolI updated the message... I hope it's better :)07:59:46
@lstrojny:matrix.orgLars StrojnyQ regarding php-composer-builder: how to override a package. E.g. to use PHP 8.3 with xdebug, the latest git revision needs to be build. Any pointers on how to override packages?10:05:05
@drupol:matrix.orgPolThere's currently no xdebug for PHP 8.3 AFAIK10:42:10
@drupol:matrix.orgPolCan you share some nix code so I can give some directions?10:42:24
@drupol:matrix.orgPol(my availability on internet is reduced lately since my flight home has been cancelled, I had to stay in holidays one more week to get a flight back)10:43:04
2 Sep 2023
@drupol:matrix.orgPol Should we add a package depending on PHP on the top level of nixpkgs or nested under php.packages ? See my comment: https://github.com/NixOS/nixpkgs/pull/252778 07:12:30
@drupol:matrix.orgPol Lars Strojny: Here's a solution: 07:31:27
@drupol:matrix.orgPol
php = pkgs.api.buildPhpFromComposer {
          src = inputs.self;
          php = pkgs.php83; # Change to php81, php82, php83 etc.
          withExtensions = [
            (pkgs.php83.extensions.xdebug.overrideAttrs (oldAttrs: {
              src = pkgs.fetchFromGitHub {
                owner = "xdebug";
                repo = "xdebug";
                rev = "7d10e631c17694913eadafb9a07da22fb3736b2c";
                hash = "sha256-El6kdI1rOTWbwmX8bL1yB9KPwpew8GNK+lOb6h3KiOI=";
              };
            }))
          ];
        };
07:31:31
@lstrojny:matrix.orgLars StrojnyTerrific, thank you very much07:33:45
@drupol:matrix.orgPol *
php = pkgs.api.buildPhpFromComposer {
  src = inputs.self;
  php = pkgs.php83; # Change to php81, php82, php83 etc.
  withExtensions = [
    (pkgs.php83.extensions.xdebug.overrideAttrs (oldAttrs: {
      src = pkgs.fetchFromGitHub {
        owner = "xdebug";
        repo = "xdebug";
        rev = "7d10e631c17694913eadafb9a07da22fb3736b2c";
        hash = "sha256-El6kdI1rOTWbwmX8bL1yB9KPwpew8GNK+lOb6h3KiOI=";
      };
    }))];
        };
07:33:59
@drupol:matrix.orgPol *
php = pkgs.api.buildPhpFromComposer {
  src = inputs.self;
  php = pkgs.php83; # Change to php81, php82, php83 etc.
  withExtensions = [
    (pkgs.php83.extensions.xdebug.overrideAttrs (oldAttrs: {
      src = pkgs.fetchFromGitHub {
        owner = "xdebug";
        repo = "xdebug";
        rev = "7d10e631c17694913eadafb9a07da22fb3736b2c";
        hash = "sha256-El6kdI1rOTWbwmX8bL1yB9KPwpew8GNK+lOb6h3KiOI=";
      };
    }))
  ];
};
07:34:14
@drupol:matrix.orgPolLet me know how it goes07:34:49
@lstrojny:matrix.orgLars Strojny

Seems to be still picking up the stock version. This is the flake: https://github.com/lstrojny/uffff/blob/php-8.3/flake.nix

trace: warning: The pcre extension does not exist or is enabled by default in PHP 8.3.0RC1, ignoring.
trace: warning: The pcre extension does not exist or is enabled by default in PHP 8.3.0RC1, ignoring.
error: builder for '/nix/store/jvaykbfdbmsn32ws08wrym63b490alk6-php-xdebug-3.2.2.drv' failed with exit code 1;
       last 10 log lines:
       > checking for PHP includes... -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php/main -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php/TSRM -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php/Zend -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php/ext -I/nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php/ext/date/lib
       > checking for PHP extension directory... /nix/store/ry064mmz1j95pvnyy8g2f2x8n76yvmsj-php-8.3.0RC1/lib/php/extensions
       > checking for PHP installed headers prefix... /nix/store/h74ww6409cjw2rrvzy9mc5w6cy54imb0-php-8.3.0RC1-dev/include/php
       > checking if debug is enabled... no
       > checking if zts is enabled... no
       > checking for gawk... gawk
       > checking whether to enable Xdebug support... yes, shared
       > checking whether to enable Xdebug developer build flags... no
       > checking whether to compress profiler files (requires zlib)... yes
       > checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 8.0.0 and < 8.3.0 (found 8.3.0RC1)
       For full logs, run 'nix log /nix/store/jvaykbfdbmsn32ws08wrym63b490alk6-php-xdebug-3.2.2.drv'.
error: 1 dependencies of derivation '/nix/store/q23pzqnz65dhx33kp8sp8df2n6c5srj5-php-extra-init-8.3.0RC1.ini.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vhx6kp081lwdckaaycs8gcrgfm05gd3r-php-with-extensions-8.3.0RC1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qy81pchx64hx5bwb84fgk6rmk320gwh7-nix-shell-env.drv' failed to build```
08:49:58

Show newer messages


Back to Room ListRoom Version: 6