Skip to content

src.meta.changelog#338366

Closed
zimbatm wants to merge 2 commits intoNixOS:masterfrom
zimbatm:stdenv-src-meta
Closed

src.meta.changelog#338366
zimbatm wants to merge 2 commits intoNixOS:masterfrom
zimbatm:stdenv-src-meta

Conversation

@zimbatm
Copy link
Member

@zimbatm zimbatm commented Aug 30, 2024

Description of changes

I'm playing with some ideas inspired by #338301.

What if meta attributes were derived from the source?

In particular, the meta.changelog is a computed value, so having it in the code isn't very valuable as it's not directly accessible.

This also fixed the issue that when src gets overridden, the meta.changelog is out of sync.

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.11 Release Notes (or backporting 23.11 and 24.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.

This opens the road to removing a lot of the repetition we see in the
meta attributes. Most of the time, computed values such as the changelog
URL are already known from the source fetcher.
Assume that the changelog is attached to the release.
@github-actions github-actions bot added 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: stdenv Standard environment labels Aug 30, 2024
@emilazy
Copy link
Member

emilazy commented Aug 30, 2024

I like the idea in principle, but I think we still need to track some information in the package definition, because not all projects use GitHub releases (an in‐repo changelog is usually more useful when available, in fact).

@zimbatm
Copy link
Member Author

zimbatm commented Aug 30, 2024

What would be the downside of having false-negative changelog URLs? Package can still override meta.changelog with its definition.

Or alternatively, if the stdenv patch is dropped, packages could opt-in with:

meta = {
  inherit (src.meta) changelog;
}

@emilazy
Copy link
Member

emilazy commented Aug 30, 2024

I think exposing broken changelog URLs to users would be kind of bad, but I like the idea of inherit (src.meta) changelog;.

@zimbatm
Copy link
Member Author

zimbatm commented Sep 9, 2024

After mulling on this more, even inherit (src.meta) changelog seems too implicit. How would the user know it points to the release unless they read the code?

Maybe a better direction would be a lib that builds common URLs, and maybe used like this:

meta = {
  changelog = lib.urls.github.repo_release src;
};

Not a priority so I'm closing this for now

@zimbatm zimbatm closed this Sep 9, 2024
@zimbatm zimbatm deleted the stdenv-src-meta branch September 9, 2024 14:40
@zimbatm
Copy link
Member Author

zimbatm commented Sep 18, 2024

For the spelunkers, see also #35075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: stdenv Standard environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants