@@ -78,15 +78,36 @@ Drv::Drv(std::string &attrPath, nix::EvalState &state,
78
78
// fallback if we encounter an error
79
79
try {
80
80
outputsQueried = packageInfo.queryOutputs (true );
81
- } catch (const nix::UnimplementedError &e) {
81
+ } catch (const nix::Error &e) {
82
+ // We could be hitting `nix::UnimplementedError`:
83
+ // https://github.com/NixOS/nix/blob/39da9462e9c677026a805c5ee7ba6bb306f49c59/src/libexpr/get-drvs.cc#L106
84
+ //
85
+ // Or we could be hitting:
86
+ // ```
87
+ // error: derivation 'caDependingOnCA' does not have valid outputs:
88
+ // error: while evaluating the output path of a derivation at
89
+ // <nix/derivation-internal.nix>:19:9:
90
+ //
91
+ // 18| value = commonAttrs // {
92
+ // 19| outPath = builtins.getAttr outputName strict;\n
93
+ // | ^
94
+ // 20| drvPath = strict.drvPath;
95
+ //
96
+ // error: path
97
+ // '/0rmq7bvk2raajd310spvd416f2jajrabcg6ar706gjbd6b8nmvks' is not in
98
+ // the Nix store
99
+ // ```
100
+ // i.e. the placeholders were confusing it.
101
+ //
102
+ // FIXME: a better fix would be in Nix to first check if
103
+ // `outPath` is equal to the placeholder. See
104
+ // https://github.com/NixOS/nix/issues/11885.
82
105
if (!nix::experimentalFeatureSettings.isEnabled (
83
106
nix::Xp::CaDerivations)) {
84
107
// If we do have CA derivations enabled, we should not encounter
85
- // this error .
108
+ // these errors .
86
109
throw ;
87
110
}
88
- // we are probably hitting this:
89
- // https://github.com/NixOS/nix/blob/39da9462e9c677026a805c5ee7ba6bb306f49c59/src/libexpr/get-drvs.cc#L106
90
111
outputsQueried = packageInfo.queryOutputs (false );
91
112
}
92
113
for (auto &[outputName, optOutputPath] : outputsQueried) {
0 commit comments