Problem
To make overriding more feasible, people often write something like
{
sth,
doCheck? true,
patches? [],
foo? callPackage ./foo.nix,
}:
{ ... }
But this is actually dangerous. We don't know when a top-level package named "doCheck", "patches" or "foo" will appear. While the first two can easily be found on ofBorg failures, the third might be quietly passed, causing more problems (and it even looks unrelated!).
Reproduce
# default.nix
{ aaa? "1" }:
aaa
This should be "1", right?
=> nix eval --impure --expr 'with import <nixpkgs> {}; callPackage ./default.nix {}'
«derivation /nix/store/l36n95rwc21rn1f8sld428j3sarv3ssd-aaa-1.1.1.drv»
Well it's not.
Solution
My idea is that we set some "reserved attribute prefixes", such as names starting with "var-", and make sure that they cannot be used for top-level package names. We may also need to take the same approach for other sets that define callPackage.
Problem
To make overriding more feasible, people often write something like
But this is actually dangerous. We don't know when a top-level package named "doCheck", "patches" or "foo" will appear. While the first two can easily be found on ofBorg failures, the third might be quietly passed, causing more problems (and it even looks unrelated!).
Reproduce
This should be "1", right?
Well it's not.
Solution
My idea is that we set some "reserved attribute prefixes", such as names starting with "var-", and make sure that they cannot be used for top-level package names. We may also need to take the same approach for other sets that define
callPackage.