-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
File set combinators base: lib.fileset.toSource
#245623
Conversation
0ef9aeb
to
36822c6
Compare
68eb01e
to
7b4aec4
Compare
92e11e8
to
e56062e
Compare
I'll mark this as ready to review because it's almost done, there's only two relatively minor things left:
|
8c6de7b
to
ecc3ec5
Compare
This is now very ready! |
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.
Just tiny nitpicks in the docs to clarify wording.
Thanks @infinisil and @roberth for making this happen, step by step.
|
||
Arguments: | ||
- (+) Such paths are usually produced by derivations, which means `toSource` would either: | ||
- Require IFD if `builtins.path` is used as the underlying primitive |
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.
- Require IFD if `builtins.path` is used as the underlying primitive | |
- Require [Import From Derivation](../../pkgs/README.md#import-from-derivation) if `builtins.path` is used as the underlying primitive |
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 that section is only saying that IFD is disallowed in Nixpkgs, but the file set library isn't really meant to be used in Nixpkgs. I'd say let's leave this for now and wait for NixOS/nix#7332
7acbb0f
to
4c28b98
Compare
Thanks, applied all your suggestions! |
4c28b98
to
465e05c
Compare
This is as ready as it gets, I'll merge this myself! 🚀 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/easy-source-filtering-with-file-sets/29117/11 |
Description of changes
This is the first PR split off from the more complete file set combinators PR, in order to make it easier to incrementally review and merge it. This PR implements a severely limited interface, only containing a single new function:
Despite that, it's kind of neat how even this simple filtering was previously rather tricky to implement using
lib.sources
filters, and simple mistakes can break it:How to do it without this function
Edit: Actually it occurred to me that this might have a mistake, iirc something relating to the filesystem root.
This work is sponsored by Antithesis ✨
Things done