pythonCatchConflictsHook: add test for multiple dependency chains

Add a test where a conflicting package can be found at the end of
multiple dependency chains. This is far too simple an example to
demonstrate the ill effects of exponential time complexity, but does
serve to demonstrate how the error output changes when each path is only
visited once.
This commit is contained in:
Ben Wolsieffer
2024-04-26 21:05:41 -04:00
parent bba47ccccd
commit 21833407b4
@@ -143,4 +143,46 @@ in {
};
in
expectFailure toplevel "Found duplicated packages in closure for dependency 'leaf'";
/*
Transitive conflict with multiple dependency chains leading to the
conflicting package.
Test sets up this dependency tree:
toplevel
dep1
leaf
dep2
leaf
dep3
leaf (customized version -> conflicting)
*/
catches-conflict-multiple-chains = let
# package depending on dependency1, dependency2 and dependency3
toplevel = generatePythonPackage {
pname = "catches-conflict-multiple-chains";
propagatedBuildInputs = [ dep1 dep2 dep3 ];
};
# dep1 package depending on leaf
dep1 = generatePythonPackage {
pname = "dependency1";
propagatedBuildInputs = [ leaf ];
};
# dep2 package depending on leaf
dep2 = generatePythonPackage {
pname = "dependency2";
propagatedBuildInputs = [ leaf ];
};
# dep3 package depending on conflicting version of leaf
dep3 = generatePythonPackage {
pname = "dependency3";
propagatedBuildInputs = [ (customize leaf) ];
};
# some leaf package
leaf = generatePythonPackage {
pname = "leaf";
};
in
expectFailure toplevel "Found duplicated packages in closure for dependency 'leaf'";
}