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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchurl: add unpacked passthru #392938

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

pbsds
Copy link
Member

@pbsds pbsds commented Mar 25, 2025

some-package.src.unpacked is great convenience to have when you want to for example view the setup.py or pyproject.toml file in the src of a fetchPypi package.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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.

@github-actions github-actions bot added 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 8.has: documentation This PR adds or changes documentation labels Mar 25, 2025
@pbsds pbsds marked this pull request as ready for review March 25, 2025 01:47
@K900
Copy link
Contributor

K900 commented Mar 25, 2025

Isn't this just pkgs.srcOnly?

@pbsds pbsds force-pushed the feat-ex-1742859731 branch from 26d7e76 to 3e44217 Compare March 27, 2025 00:16
@pbsds
Copy link
Member Author

pbsds commented Mar 27, 2025

Isn't this just pkgs.srcOnly?

Close, but the UX is way better:

$ nix-build . -A hello.src.unpacked
this derivation will be built:
  /nix/store/00b1nzgl2pdnxxardrbxv3349xvhcvz3-hello-2.12.1.tar.gz-unpacked.drv
building '/nix/store/00b1nzgl2pdnxxardrbxv3349xvhcvz3-hello-2.12.1.tar.gz-unpacked.drv'
Running phase: unpackPhase
unpacking source archive /nix/store/pa10z4ngm0g83kx9mssrqzz30s84vq7k-hello-2.12.1.tar.gz
source root is hello-2.12.1
$ head -n2 result/README
This is the README file for the GNU Hello distribution.
Hello prints a friendly greeting.  It also serves as a sample GNU

I've expanded the docs to make the difference more clear

@K900
Copy link
Contributor

K900 commented Mar 27, 2025

I feel like all the allowAliases stuff isn't necessary? Unless your concern is that it will get picked up by Hydra. Also, can we somehow use srcOnly to define this, just to not duplicate the logic?

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.

2 participants