Can't install php81Extensions.blackfire

This issue has been tracked since 2022-12-16.

I'm trying to add the blackfire extension to my devbox.json. After looking through NixOS search it seems the correct
package name should be php81Extensions.blackfire for PHP 8.1.

Adding it to my devbox.json:

{
  "packages": [
    "php81",
    "php81Extensions.blackfire"
  ],
  "shell": {
    "init_hook": null
  },
  "nixpkgs": {
    "commit": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04"
  }
}

results in the following error:

Installing nix packages. This may take a while...
Error: apply Nix derivation: running command /nix/var/nix/profiles/default/bin/nix-env --profile /Users/calvinbaart/dev/devbox_test/.devbox/nix/profile/default --install -f /Users/calvinbaart/dev/devbox_test/.devbox/gen/development.nix: exit status 1 with command output: replacing old 'devbox-development'
installing 'devbox-development'
error: attribute 'extensionName' missing

       at /nix/store/j5a7i3dvxslg2ychfy53wdhg1m3xfrwm-source/pkgs/development/interpreters/php/generic.nix:94:29:

           93|
           94|           getExtName = ext: ext.extensionName;
             |                             ^
           95|
(use '--show-trace' to show detailed location information)

It should be noted that other extensions work perfectly (for example the imagick extension from the other issue)

The generated development.nix is this:

let
  pkgs = import (fetchTarball {
    url = "https://github.com/nixos/nixpkgs/archive/52e3e80afff4b16ccb7c52e9f0f5220552f03d04.tar.gz";
  }) {
  };
    php81 = pkgs.php81.withExtensions ({ enabled, all }: enabled ++ (with all; [ blackfire ]));
  in with pkgs;
buildEnv {
  ignoreCollisions = true;
  name = "devbox-development";
  paths = [
    php81
  
    php81Extensions.blackfire
  ];
  pathsToLink = [ "/bin" "/share" "/lib"];
}
loreto wrote this answer on 2022-12-20

Thanks for reporting, taking a look today. @mikeland86

gcurtis wrote this answer on 2022-12-20

Thanks for the detailed report. Can you try updating the nixpkgs.commit in your devbox.json to 7a3f450e4af7c015a78d5d182499c8c6170418e5?

{
  "packages": [
    "php81",
    "php81Extensions.blackfire"
  ],
  "shell": {
    "init_hook": null
  },
  "nixpkgs": {
    "commit": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04"
  }
}

I think the problem is that this version of the package doesn't include an extension name by default. A newer version does though - see NixOS/[email protected]152d320.

@mikeland86 do you know if we should be doing something like this?

-php81 = pkgs.php81.withExtensions ({ enabled, all }: enabled ++ (with all; [ blackfire ]));
+php81 = pkgs.php81.withExtensions ({ enabled, all }: enabled ++ (with all; [ (blackfire // { extensionName = "blackfire"; }) ]));

I'm not sure if this is a devbox problem or if this was just an issue with the package.

calvinbaart wrote this answer on 2022-12-20

7a3f450e4af7c015a78d5d182499c8c6170418e5 works perfectly. I did get an error about the license being unfree but that is unrelated to this ticket.

The extension registers correctly with the new commit:

(devbox) ➜  devbox_test git:(main) ✗ php -v
PHP 8.1.13 (cli) (built: Dec  1 2022 09:35:06) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies
    with blackfire v1.84.0~mac-x64-non_zts81, https://blackfire.io, by Blackfire
Lagoja wrote this answer on 2022-12-20

Closing this issue as resolved.

More Details About Repo
Owner Name jetpack-io
Repo Name devbox
Full Name jetpack-io/devbox
Language Go
Created Date 2022-08-18
Updated Date 2023-03-31
Star Count 4960
Watcher Count 19
Fork Count 68
Issue Count 42

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date