flattenTree: ignore attributes that throw errors#34
flattenTree: ignore attributes that throw errors#34Pacman99 wants to merge 1 commit intonumtide:mainfrom
Conversation
855dfa4 to
c2f9181
Compare
|
This might filter too many packages. Let's say you modify a package and introduce a Nix error by mistake. The CI might still be building successfully while ignoring the failed package. |
|
I don't think that should be a concern. derivations require a deeper evaluations to check if there are errors in them. I might be missing something here though. |
|
Let's see what my imagination can come up with :) { stdenv, lib, openssl, zlib }:
stdenv.mkDerivation {
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin zlib;
}That package would get filtered out isn't it? |
|
Great example! I just tried it out, I think it works. Here is my repl: where I think the error of missing attributes or any general package error only gets triggered when you access specific attributes in the package or actually evaluate the derivation. So a shallow evaluation of it, wouldn't catch such things. But also I think we came up with a better solution in flake-utils-plus to avoid running into |
|
I'd also want to add that https://github.com/numtide/flake-utils/blob/master/filterPackages.nix was intended for providing any kind of filtering services to users. I can't remember exactly why I didn't touch flattenTree filtering, I think it was because flatten tree does just the ordinary thing expected from any nix tools to recursively collect derivations. |
Improve flattenTree's safety. If attributes throw an error, they should just be ignored, since the goal is to filter out derivations.