Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow buildInputs to be regular files
If a build input is a regular file, use it as a setup hook. This makes setup hooks more efficient to create: you don't need a derivation that copies them to $out/nix-support/setup-hook, instead you can use the file as is.
- Loading branch information
b23dbb1
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.
This causes problems for derivations that take regular files that are not setup hooks, and crash when sourced by bash.
b23dbb1
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.
Hmm, true, but why else should one have a single file in
buildInputs
? It's typically used to add stuff to various search paths.b23dbb1
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.
I've been using it to pass a build config file.
b23dbb1
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.
Well, but how do you access it within the build? I don't see how
buildInputs
serves for that.b23dbb1
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.
Hmm. I had originally thought it needed to be in the
buildInputs
to be available during the build, but I guess that's not the case, is it?b23dbb1
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.
Right, any environment variable will do.
b23dbb1
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.
Yes, or one can often directly supply it e.g. within
makeFlags
or similar vars/commands.