ci: Avoid && dropping errors #32573

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2505-ci-bash-ugh changing 1 files +3 −1
  1. maflcko commented at 7:49 pm on May 20, 2025: member

    In bash, && will ignore errexit. This can lead to silently ignoring errors. Compare the output of:

    0$ bash -c 'set -xe;   false && false   ; true; echo $?'
    1+ false
    2+ true
    3+ echo 0
    40
    

    In theory this could be fixed by using a subshell:

    0$ bash -c 'set -xe; ( false && false ) ; true; echo $?'
    1+ false
    

    However, it is easier to just remove the &&.

    This was introduced in commit faa807bdf8c3002a28005b4765604f518a6f2736

  2. ci: Avoid && dropping errors fab97f583f
  3. DrahtBot commented at 7:49 pm on May 20, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32573.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK janb84, hebasto, laanwj

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on May 20, 2025
  5. maflcko added this to the milestone 30.0 on May 20, 2025
  6. janb84 commented at 9:43 am on May 21, 2025: contributor
  7. hebasto approved
  8. hebasto commented at 9:56 am on May 21, 2025: member

    ACK fab97f583f119f43da352774479dd78e39729632.

    Could this approach be forced by a linter?

  9. maflcko commented at 10:27 am on May 21, 2025: member

    Could this approach be forced by a linter?

    I don’t know how, because ( a && b ) is used and is fine. My preference would be to just stop using bash, but writing this one in Python or Rust will bloat the code. :man_shrugging:

  10. laanwj commented at 11:06 am on May 21, 2025: member

    My preference would be to just stop using bash

    Yes.

    but writing this one in Python or Rust will bloat the code. 🤷‍♂️

    That’s good and bad, i mean bloated code that is straightforward to review might be preferable to a one-line magic incantation that has all kinds of unintuitive, hidden oopses.

  11. laanwj approved
  12. laanwj commented at 11:07 am on May 21, 2025: member
    ACK fab97f583f119f43da352774479dd78e39729632
  13. janb84 commented at 11:08 am on May 21, 2025: contributor

    My preference would be to just stop using bash

    Yes.

    but writing this one in Python or Rust will bloat the code. 🤷‍♂️

    That’s good and bad, i mean bloated code that is straightforward to review might be preferable to a one-line magic incantation that has all kinds of unintuitive, hidden oopses.

    I second this !

  14. fanquake merged this on May 21, 2025
  15. fanquake closed this on May 21, 2025

  16. maflcko deleted the branch on May 21, 2025

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: 2025-05-25 18:12 UTC

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