Repository navigation
update-nixpkgs-inputs: exit non-zero when an input update fails - #599
Conversation
main() counted failed nix flake update runs in the summary but always exited 0, so && chains, CI and cron callers proceeded as if the inputs were updated. Exit 1 after all summaries print when any input failed. The .sh wrapper's || python3 fallback would then have re-run the whole update after a genuine failure; scope it to the cannot-execute exits (126/127, e.g. uv missing for the env -S shebang) and propagate the script's exit status.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4daf81e448
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if failed_total: | ||
| sys.exit(1) |
There was a problem hiding this comment.
Mirror failure propagation in the package-local updater
When the updater is run from the standalone pkgs/id project, its recipes invoke pkgs/id/scripts/update-nixpkgs-inputs.sh, whose Python and shell implementations remain unchanged. Consequently, a failed nix flake update still returns success there (and the old wrapper can rerun it); this is reproducible with a failing stub nix, where the root wrapper exits 1 but the package-local wrapper exits 0. Apply both changes to the package-local script copies as well.
Useful? React with 👍 / 👎.
Fixes #598
What
scripts/update-nixpkgs-inputs.py: after all per-ref and combined summaries print, exit 1 if any input'snix flake updatefailed. Success, already-up-to-date, and no-inputs-found runs still exit 0. Discovery, filtering, and summary formatting are unchanged.scripts/update-nixpkgs-inputs.sh: thepython3fallback now triggers only on cannot-execute exits (126/127 — e.g.uvmissing for theenv -S uv run --scriptshebang) instead of any non-zero exit, so a genuine update failure is never re-run end-to-end; the wrapper propagates the script's exit status.Verification (stub
nix+ minimal flake.lock with one NixOS/nixpkgs input, script copied to a scratch dir)Pre-fix: summary prints
Failed: 1, exit code 0.Post-fix:
nix:python3 update-nixpkgs-inputs.pyexits 1,Failed: 1still printed, exactly 1nixinvocation.nix: exits 0 (Skipped: 1).nix(nouvon the test box, so the 127 fallback path runs): exit 1, exactly 1nixinvocation — no double update.nixinvocation.Need help on this PR? Tag
@codesmith-botwith what you need.