aboutsummaryrefslogtreecommitdiff
path: root/perl/lib/Nix/Store.xs
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-08 15:48:51 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-08 15:48:51 +0000
commitf7696c66e85008e2b60a579bcdf5ff13c141d0af (patch)
tree554bf7ef543548bae314aecf302189bac1483335 /perl/lib/Nix/Store.xs
parente913a2989fd7dfabfd93c89fd4295386eda4277f (diff)
Fix perl FFI for floating ca derivations
Path is null when not known statically.
Diffstat (limited to 'perl/lib/Nix/Store.xs')
-rw-r--r--perl/lib/Nix/Store.xs8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs
index de60fb939..6fe01fff0 100644
--- a/perl/lib/Nix/Store.xs
+++ b/perl/lib/Nix/Store.xs
@@ -303,11 +303,15 @@ SV * derivationFromPath(char * drvPath)
hash = newHV();
HV * outputs = newHV();
- for (auto & i : drv.outputs)
+ for (auto & i : drv.outputs) {
+ auto pathOpt = i.second.pathOpt(*store(), drv.name);
hv_store(
outputs, i.first.c_str(), i.first.size(),
- newSVpv(store()->printStorePath(i.second.path(*store(), drv.name)).c_str(), 0),
+ !pathOpt
+ ? newSV(0) /* null value */
+ : newSVpv(store()->printStorePath(*pathOpt).c_str(), 0),
0);
+ }
hv_stores(hash, "outputs", newRV((SV *) outputs));
AV * inputDrvs = newAV();