resholve: use originalSrc for nixpkgs-update bot#191354
resholve: use originalSrc for nixpkgs-update bot#191354thiagokokada merged 1 commit intoNixOS:masterfrom
Conversation
|
@thiagokokada Hoping you can take a look at this since you reviewed the previous PR, but no worries if you don't have time. |
thiagokokada
left a comment
There was a problem hiding this comment.
I think the better solution here would be to just have a default passthru.updateScript that knows how to handle the outputHash from the resholve derivations.
Effort to fix automatic nixpkgs-update updates for resholved packages in 9f6310d did help the bot get further, but it then failed to find the source outputHash (the outer derivation's source is the inner derivation; bot looks for outer.src.outputHash; ours is at outer.src.src.outputHash). This change uses `originalSrc` to indicate the source of the inner derivation. Along with nix-community/nixpkgs-update#324, this enables the bot to fall back on an attr that Nix/nixpkgs are not directly depending on, supporting automatic updates for packages built with `resholve.mkDerivation`.
4b6704f to
ff44e1f
Compare
|
The force-push I just made takes this in another direction, but I want to document a little of the ground covered just in case the record is useful later. Feel free to skip this comment and just read the next one :)
I got similar advice from @ryantm, so I spent a few hours banging my head against this with nothing to show for it. Unless I'm missing one or more things (likely, since the documentation here seems to be vaporware :) the majority of all update scripts I can find as examples are extremely idiomatic to the source/release infrastructure of individual packages. I've tried using the most-generic updaters I've been able to find: Again assuming I'm not missing something, the updateScript approach feels ~right for individual packages, and like a minefield for a builder (unless/until we build something universal, canonical, and well-documented within Nixpkgs that can help cope with edge-case builders). |
|
I ended up going with your suggestion to see about fixing this at the nixpkgs-update level in nix-community/nixpkgs-update#324. This PR no longer engages in misleading sourcery--it uses a new attr that shouldn't be load-bearing in Nix or nixpkgs. :) |
| # fallback attr for update bot to query our src | ||
| originalSrc = unresholved.src; |
There was a problem hiding this comment.
Maybe we should document this somewhere. Looks like it could be useful for a few other use cases.
There was a problem hiding this comment.
Not needed for this PR though.
There was a problem hiding this comment.
Maybe we should document this somewhere. Looks like it could be useful for a few other use cases.
I agree, though I'm at a bit of a loss for where since nixpkgs-update doesn't seem to be mentioned in the nixpkgs manual or the nixos wiki.
I feel like there could/should probably be a whole section there, or maybe a distinct guide, that covers the broad topic of propagating updates to nixpkgs. At least:
- how to write and run update scripts both bespoke or via
genericUpdater,nix-update-script, and any others - code-generation best-practices for nix-ecosystem projects that need to maintain an in-tree copy of code they develop out of tree
- notes on the existence of the update bot, how to help it update your package, etc.
I have at least opened a PR over at nixpkgs-update to make it a little more discoverable: nix-community/nixpkgs-update#325
Description of changes
Effort to fix automatic nixpkgs-update updates for resholved packages in 9f6310d (#191003) did help the bot get further along, but it still failed to find the source outputHash (because the outer derivation's source is the inner derivation; the bot is looking for outer.src.outputHash but before this commit it is at outer.src.src.outputHash). (log)
Change abuses passthru to set the outer src to
inner.srcin a way that (IIUC) will not affect the build, but will affect ~queries like nixpkgs-update is using (e.g.nix eval -f . --raw pkgs.bats.src.drvAttrs.outputHash)I'm not at all certain this will satisfy nixpkgs-update; treat me with some skepticism :)
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notesThis one's a bit weird, so I've confirmed that:
nixpkgs-review reports
No diff detected, stopping review...I can
nix-buildbothbatsandbats.tests(bats is built with resholve)The nixpkgs-update
nix evalcommand I'm trying to fix appears to work: