diff options
| author | Andrew Childs <lorne@cons.org.nz> | 2022-06-17 14:42:04 +0900 |
|---|---|---|
| committer | Artturin <Artturin@artturin.com> | 2024-02-28 15:29:08 +0200 |
| commit | 741377b30058c5742e5ae08b1d8a85bcc9aa6d55 (patch) | |
| tree | f5f242220586547e4230d35f571c3df5be3219c0 /pkgs/development/python-modules/rangehttpserver | |
| parent | 6780926802f953c2266e8a4215c7a4be86803dfa (diff) | |
lib/customization: propagate function arguments in callPackagesWith
makeOverridable is very careful to ensure the arguments to the
overridden function are the same as the input function. As a result,
the arguments of hello.override are exactly the same as the original
arguments of the hello function that produced the derivation.
However, callPackagesWith calls makeOverridable with a lambda that
does not propagate the arguments. The override function for a package
instantiated with callPackagesWith will not have the original
arguments.
For example:
nix-repl> lib.functionArgs hello.override
{ callPackage = false; fetchurl = false; hello = false; lib = false; nixos = false; stdenv = false; testers = false; }
nix-repl> lib.functionArgs openssl.override
{ }
By copying the arguments onto the inner lambda before passing it to
makeOverridable, we can make callPackage and callPackages behave the
same.
nix-repl> lib.functionArgs openssl.override
{ buildPackages = false; coreutils = false; cryptodev = false; enableSSL2 = true; enableSSL3 = true; fetchurl = false; lib = false; perl = false; removeReferencesTo = false; static = true; stdenv = false; withCryptodev = true; withPerl = true; }
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions
