guix: Make guix-clean more careful #34776

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/03/guix_clean_destructive changing 1 files +18 −0
  1. hodlinator commented at 10:12 am on March 9, 2026: contributor
    • Show preview and ask for confirmation before git clean unless used with “–force”
    • Error out when user tries to pass args such as “guix-clean –help”
  2. DrahtBot added the label Build system on Mar 9, 2026
  3. DrahtBot commented at 10:12 am on March 9, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Stale ACK kevkevinpal, svanstaa

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  4. hodlinator renamed this:
    guix: Make guix-clean less destructive
    guix: Make guix-clean more cautious
    on Mar 9, 2026
  5. hodlinator renamed this:
    guix: Make guix-clean more cautious
    guix: Make guix-clean more careful
    on Mar 9, 2026
  6. willcl-ark commented at 10:18 am on March 9, 2026: member
    I am using guix-clean in scripts, and I think this would the ability to do that. I would prefer, if we make this change, to also accept a --force or -y flag which means my automation would still be able to clean automagically :)
  7. hodlinator marked this as a draft on Mar 9, 2026
  8. hodlinator commented at 10:21 am on March 9, 2026: contributor
    Thanks for the feedback, will rework it.
  9. hodlinator force-pushed on Mar 9, 2026
  10. DrahtBot added the label CI failed on Mar 9, 2026
  11. hodlinator force-pushed on Mar 9, 2026
  12. hodlinator marked this as ready for review on Mar 9, 2026
  13. hodlinator commented at 10:53 am on March 9, 2026: contributor
    Now supports non-interactive scripts through “–force” in response to #34776 (comment).
  14. hodlinator force-pushed on Mar 9, 2026
  15. DrahtBot removed the label CI failed on Mar 9, 2026
  16. kevkevinpal commented at 3:43 pm on March 9, 2026: contributor
    A good follow-up would be to add a --exclude-dir or --exclude option to ignore specific files/directories
  17. kevkevinpal commented at 3:45 pm on March 9, 2026: contributor

    tACK beb87b9

    Was able to test that both --force and the promt for yes or no worked.

    I like the addition of the dry run to explain what is going to be deleted aswell

  18. sedited commented at 5:14 pm on March 9, 2026: contributor
    Seems fine, I think the first time I ran the script I was also confused about what it actually removes.
  19. svanstaa commented at 6:44 pm on March 9, 2026: none

    tACK beb87b9

    Tested:

    • unknown argument gets rejected
    • prompt for y works as expected
    • prompt for n aborts the script
    • argument –force works

    Nit: line 91 uses single brackets which is inconsistent with the double brackets used elsewhere. Since the script is bash-only, I suggest using [[ ]] throughout:

    0if [[ $FORCE == 0 ]]; then
    

    Also, before I was not aware that guix-clean actually nukes all untracked files in the whole Bitcoin repo, not just the Guix build artifacts! So the name is a bit misleading. Good call to warn the user before about what exactly will be deleted.

  20. guix: Make guix-clean less destructive
    * Show preview and ask for confirmation before git clean unless used with "--force"
    * Error out when trying to pass args such as "guix-clean --help"
    be6d24ec22
  21. hodlinator force-pushed on Mar 9, 2026
  22. hodlinator commented at 7:23 pm on March 9, 2026: contributor

    Nit: line 91 uses single brackets which is inconsistent with the double brackets used elsewhere. Since the script is bash-only, I suggest using [[ ]] throughout:

    Aargh, I couldn’t live with this inconsistency - fixed in latest push. Double brackets indeed seem like the way to go. Thanks for spotting!

    A good follow-up would be to add a --exclude-dir or --exclude option to ignore specific files/directories

    Indeed, that would be useful. Would be tempting to switch to Python argparse for that though. With this PR as it is currently, one can just abort after the preview and manually rm -rf <copied> <subset> <from> <preview> <list>.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-10 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me