Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scripts/update-nixpkgs-inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,15 @@ def main():
if len(refs) > 1:
print_combined_summary(all_ref_data)

# A run that failed to update any input is a failure, even though the
# summaries above printed normally: callers (&& chains, CI, cron) must
# not proceed as if the inputs were updated.
failed_total = sum(
1 for rd in all_ref_data for r in rd["results"] if r["status"] == "failed"
)
if failed_total:
sys.exit(1)
Comment on lines +325 to +326

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.



if __name__ == "__main__":
main()
13 changes: 11 additions & 2 deletions scripts/update-nixpkgs-inputs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/usr/bin/env bash
# Wrapper: tries uv (via .py shebang) first, falls back to python3
# Wrapper: tries uv (via .py shebang) first, falls back to python3 only
# when the script cannot be executed at all (exit 126/127, e.g. uv is
# missing) — never after a genuine update failure, which would re-run
# the whole update and mask the first run's results.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT="$SCRIPT_DIR/update-nixpkgs-inputs.py"

"$SCRIPT" "$@" || python3 "$SCRIPT" "$@"
"$SCRIPT" "$@"
status=$?
if [ "$status" -eq 126 ] || [ "$status" -eq 127 ]; then
python3 "$SCRIPT" "$@"
status=$?
fi
exit "$status"
Loading