-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
document fetchTree
#9258
document fetchTree
#9258
Conversation
|
||
<!-- TODO: It would be soooo much more predictable to work with (and | ||
document) if `fetchTree` was a curried call with the first paramter for | ||
`type` or an attribute like `builtins.fetchTree.git`! --> |
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.
Very interesting, nested builtin to disambiguation the type. On the other hand, this makes the idempotency a little more awkward.
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.
A few fixups and TODOs, but this is in line with our last review session. Would be good to have a more discerning eye take a look (@infinisil , does this address your doctor concerns?)
This one is so big, I think it would be better to put in a separate file which is |
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 looks so much better! Left some minor suggestions :)
> **Example** | ||
> | ||
> Fetch a GitHub repository using the attribute set representation: | ||
> | ||
> ```nix | ||
> builtins.fetchTree { | ||
> type = "github"; |
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.
Better not use something that's experimental as an example.
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.
There's a good chance we'll stabilize these together, considering that possibly a majority of usages of fetchTree are with this type.
I'm not sure |
Given we're carving out this particular builtin, everything specific to its behavior should be part of its documentation. The |
We do want things deduplicated long term, yes. But for now the only release blocker is worrying about the docs for the newly stable things. Deduplicating with the Flakes docs is not a release blocker because it comes later. That said, my automation can help with this. |
That makes no sense. There are a lot of builtins whose behaviour is not fully explained by the builtin's docs, e.g. anything having to do with the Nix store. It seems very poor writing to duplicate information everywhere. |
I agree with @edolstra that for reference docs, there shouldn't be duplication and a lot of linking seems preferable. (though I'll take good docs with some duplication over bad docs any day of the week 🙂) |
I never said we should duplicate information, I simply didn't get to moving it around in this PR yet. Although that may become quite an effort altogether, so don't count on it getting merged yesterday. |
src/libexpr/primops/fetchTree.cc
Outdated
Downloads are cached in `$XDG_CACHE_HOME/nix`. | ||
The remote source will be fetched from the network if: | ||
- The resulting store path is not [valid](@docroot@/glossary.md#gloss-validity) | ||
- There is no cache entry |
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.
and or or?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-11-03-nix-team-meeting-minutes-100/35245/1 |
405e3c4
to
398181e
Compare
Co-authored-by: tomberek <tomberek@users.noreply.github.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
we have to enable the new `fetchTree` experimental feature to render it at all. this was a bug introduced when adding that new feature flag.
398181e
to
7fcf764
Compare
Reworked together with @roberth. We decided to leave the documentation on the |
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.
Looking pretty good!
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.
Final fixups for now. This documentation is far from perfect, but it's the best we can do before overhauling it.
Can't push to |
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
#9390 has been reverted by this PR accidentally I guess |
This reverts commit 3c200da.
Sorry for the confusion. It hasn't been reverted. Both instances are incomplete and conflict each other. Few things I notice:
EDIT: Maybe it's worth considering deduplicating the docs. The docs of |
As discussed with @NixOS/nix-team.
Priorities
Add 👍 to pull requests you find important.