-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First, change the way in which our checkDerivation functions are call…
…ed so that they get access to either stdenv (for mkDerivation checks) or python (for buildPythonPackage checks), so that they know which interpreter/compiler they're using. Next, using this feature, implement a check for inconsistent versions of python in the same package, as suggested by @SuperSandro2000
- Loading branch information
Showing
15 changed files
with
64 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ let | |
"install" | ||
]; | ||
|
||
checkDerivation = drv: | ||
checkDerivation = stdenv: drv: | ||
(map | ||
(phase: | ||
let | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ builtAttrs | ||
, packageSet | ||
, namePositions | ||
}@attrs: | ||
|
||
final: prev: | ||
let | ||
inherit (prev) lib; | ||
inherit (import ../lib { inherit lib; }) checkBuildPytonPackageFor; | ||
|
||
checkDerivation = python: drv: | ||
let | ||
propagatedBuildInputs = lib.attrByPath ["propagatedBuildInputs"] [] drv; | ||
checkInputs = lib.attrByPath ["checkInputs"] [] drv; | ||
runtimeInputs = checkInputs ++ propagatedBuildInputs; | ||
inputPythonInterpreters = map (p: p.pythonModule) (builtins.filter (p: p ? pythonModule) runtimeInputs); | ||
allPythonInterpreters = lib.unique (inputPythonInterpreters ++ [python]); | ||
in | ||
lib.singleton { | ||
name = "python-inconsistent-interpreters"; | ||
cond = lib.length allPythonInterpreters > 1; | ||
msg = let | ||
allPythonNames = map (p: p.name) allPythonInterpreters; | ||
sources = ["buildPythonPackage"] ++ | ||
(if (lib.length propagatedBuildInputs) > 0 then ["propagatedBuildInputs"] else []) ++ | ||
(if (lib.length checkInputs) > 0 then ["checkInputs"] else []); | ||
in | ||
'' | ||
Between ${lib.concatStringsSep " and " sources}, this derivation seems | ||
to be simultaneously trying to use packages from multiple different python package sets. | ||
Mixing package sets like this is not supported. | ||
Detected pythons: | ||
${lib.concatStringsSep "\n " allPythonNames} | ||
''; | ||
}; | ||
in | ||
checkBuildPytonPackageFor checkDerivation attrs final prev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters