Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/fetchers: document downloadToTemp for fetchurl #288762

Merged
merged 2 commits into from Feb 22, 2024

Conversation

teto
Copy link
Member

@teto teto commented Feb 14, 2024

and postFetch

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

Comment on lines 83 to 85
- `downloadToTemp`: defaults to false. If true, saves the source under
`$TMPDIR/file`, to be used in conjunction with `postFetch`...
- `postFetch`: postprocess the downloaded archive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some more text explaining that these are only applicable to fetchurl, and not fetchzip? The section this text is in talks about both, and the paragraph just before this ends talking about fetchzip, so this new text is definitely confusing as-is.

Regarding the documentation for downloadToTemp, I think documenting that it saves to $TMPDIR/file might not be a good idea to avoid people directly using that value in their code. It might be best to document that the temporary file path will be at $downloadedFile.
Also, can you add more text explaining postFetch? What type is it? How do you use it? The documentation in the code for postFetch is more descriptive, you can use it as a starting point.

@teto
Copy link
Member Author

teto commented Feb 22, 2024

@DanielSidhion I would rather not selfmerge this since it's your area of expertise. I did the change because I was looking into how to use downloadToTemp for another PR.

doc/build-helpers/fetchers.chapter.md Outdated Show resolved Hide resolved
doc/build-helpers/fetchers.chapter.md Outdated Show resolved Hide resolved
@fricklerhandwerk fricklerhandwerk merged commit 0c3eca2 into NixOS:master Feb 22, 2024
3 of 7 checks passed
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-02-22-documentation-team-meeting-notes-110/40145/1

sarahec pushed a commit to sarahec/nixpkgs that referenced this pull request Feb 25, 2024
* doc/fetchers: document downloadToTemp for fetchurl

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants