Skip to content

Commit 5f151e6

Browse files
committed
fix(php plugin): reference php output via explicit flake fragment
The php plugin's generated flake exports two packages (php and composer), but referenced php via the bare `path:{{ .Virtenv }}/flake` (the flake's `default` output) while composer used an explicit `#composer` fragment. Devbox's own flake example documents that flakes exporting more than one package must be referenced with explicit url fragments (e.g. `path:.../flake#pkg`); the bare `default` reference is intended for single-output flakes. Relying on the bare default for one of two outputs is fragile and has been reported to result in the `php` binary not being linked into the environment (only `composer` appears). Add a named `php` output to the plugin flake (keeping `default` for backwards compatibility) and reference it explicitly as `path:.../flake#php`, mirroring the working `#composer` entry. Bump the plugin version so cached create_files are regenerated. Fixes #2788
1 parent be5b810 commit 5f151e6

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

plugins/php.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "php",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "PHP is compiled with default extensions. If you would like to use non-default extensions you can add them with devbox add php81Extensions.{extension} . For example, for the memcache extension you can do `devbox add php81Extensions.memcached`.",
55
"packages": [
6-
"path:{{ .Virtenv }}/flake",
6+
"path:{{ .Virtenv }}/flake#php",
77
"path:{{ .Virtenv }}/flake#composer"
88
],
99
"__remove_trigger_package": true,

plugins/php/flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
in
2222
{
2323
packages.{{ .System }} = {
24+
# This flake exports more than one package (php and composer), so each
25+
# must be referenced from the plugin via an explicit url fragment
26+
# (e.g. path:.../flake#php). The bare `default` output is kept for
27+
# backwards compatibility with anyone referencing the flake directly.
2428
default = php;
29+
php = php;
2530
composer = php.packages.composer;
2631
};
2732
};

0 commit comments

Comments
 (0)