-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
make-derivation.nix: Factor out makeDerivationArgument
#295378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…duplicate functionality
These two commits make for a cleaner commit history and git blame than NixOS#295105, where this refactor was developed. See its commit messages for details and design choices, esp. up to and including 37f76fd.
... after inlining chooseDevOutputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go!
I believe this change may have broke let
pkgs = import <nixpkgs> {
config.checkMetaRecursively = true;
};
testdrv = pkgs.stdenv.mkDerivation {
name = "hi";
buildCommand = ''
touch $out
'';
};
in testdrv
|
Oddly, I can't reproduce the error, but this change will make it more robust. See #295378 (comment)
Motivation
Refactor and improve performance.
The refactor is good in its own right, and may serve as a step towards #273815 as well as modularization that eventually benefits RFC 92 dynamic derivations and multi-derivation packages (e.g. separate derivation for the
doc
output).Performance
Review by commit
Commits 1 and 2 change the structure of the file to return an attrset "library" of one function.
Commits 3 and 4 were developed in Proof of concept, refactor/extract
makeDerivationArgument
#295105 with a more meticulous commit history, but reapplied "in one go" using the original file text for a cleaner diff and git blame. I.e. the small, safe steps can be traced back there.The subsequent commits are individual pure refactors without changes in behavior.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.