mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 06:22:42 +01:00
Be more lenient when realisations have a conflicting dependency set
- This can legitimately happen (for example because of a non-determinism causing a build-time dependency to be kept or not as a runtime reference) - Because of older Nix versions, it can happen that we encounter a realisation with an (erroneously) empty set of dependencies, in which case we don’t want to fail, but just warn the user and try to fix it.
This commit is contained in:
parent
db4d4cf4ba
commit
a4ec6cb1da
2 changed files with 14 additions and 6 deletions
|
|
@ -144,8 +144,16 @@ bool Realisation::isCompatibleWith(const Realisation & other) const
|
|||
{
|
||||
assert (id == other.id);
|
||||
if (outPath == other.outPath) {
|
||||
assert(dependentRealisations == other.dependentRealisations);
|
||||
return true;
|
||||
if (dependentRealisations.empty() != other.dependentRealisations.empty()) {
|
||||
warn(
|
||||
"Encountered a realisation for '%s' with an empty set of "
|
||||
"dependencies. This is likely an artifact from an older Nix. "
|
||||
"I’ll try to fix the realisation if I can",
|
||||
id.to_string());
|
||||
return true;
|
||||
} else if (dependentRealisations == other.dependentRealisations) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue