ci: Call docker exec from Python script to fix word splitting #33732

pull maflcko wants to merge 6 commits into bitcoin:master from maflcko:2510-ci-rewrite-bash-python changing 6 files +52 −64
  1. maflcko commented at 12:13 pm on October 29, 2025: member

    The remaining ci/test/02_run_container.sh is fine, but has a bunch of shellcheck SC2086 word splitting violations.

    This is fine currently, because the only place that needed them had additional escaping, and all other commands happened to split fine on spaces.

    However, this may change in the future. So fix it now, by rewriting it in Python, which is recommended in the dev notes.

  2. ci: Move folder creation and docker kill to Python script
    The container_id is already known in the Python script, as well as the
    folders to create, so just do it there.
    fae2e9a1fa
  3. DrahtBot added the label Tests on Oct 29, 2025
  4. DrahtBot commented at 12:13 pm on October 29, 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/33732.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. maflcko marked this as a draft on Oct 29, 2025
  6. maflcko force-pushed on Oct 29, 2025
  7. maflcko marked this as ready for review on Oct 29, 2025
  8. ci: Remove redundant busybox option
    The option was fine, but it never found an issue, IIRC.
    
    Also, now that there is a dedicated Alpine Linux task, which uses
    BusyBox, it seems redundant.
    (See: ci/test/00_setup_env_native_alpine_musl.sh)
    
    So remove the USE_BUSY_BOX option, along with the BINS_SCRATCH_DIR env
    var.
    
    Also, enable pipefail in the ci/test/00_setup_env.sh script, while
    touching it.
    fafbccd46c
  9. ci: Document the retry script in PATH
    The `retry` script is required for CI_RETRY_EXE and there are two ways
    to put it into PATH:
    
    * When running in a container engine, by copying it into /usr/bin
    * When running without a container engine, by prepending its location to PATH
    faed92dae5
  10. ci: Move macos snippet under DANGER_RUN_CI_ON_HOST
    This move-only refactor clarifies that macos assumes and requires
    DANGER_RUN_CI_ON_HOST.
    
    So move the snippet under the condition for self-documenting code.
    
    Can be reviewed with the git options:
    --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
    3333b5174d
  11. ci: Untangle CI_EXEC bash function
    It contains a large `bash -c` string, which is hard to parse. So pull
    out components:
    
    * CI_EXEC is only called with absolute folders as args, so the `cd` is
      not needed in CI_EXEC. It is only needed to specify the working dir of
      running the tests in 03_test_script.sh, so move it there.
    
    * The PATH modification is only needed after commit
      4756114e505cff8848fb6344ef9a48d8822066c1 to check that depends does
      work properly, even when the PATH contains a space.
    
    * This allows to also drop the `bash -c` and use the proper and safer
      "$@" to forward args without the risk of word splitting.
    fac415764c
  12. Move ci_exec to the Python script
    The Bash script was acceptable, but CI_EXEC_CMD_PREFIX was a single
    string, relying on brittle word splitting that the shellcheck SC2086
    would warn about.
    
    So just fix that by moving everything to the Python script and deleting
    the Bash script.
    
    This also removes the need to export the CI_CONTAINER_ID env var.
    faceba8867
  13. maflcko force-pushed on Oct 29, 2025


maflcko DrahtBot

Labels
Tests


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-11-02 18:12 UTC

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