ci: Rewrite broken wrap-valgrind.sh to .py #35396

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2605-ci-less-sh changing 4 files +34 −20
  1. maflcko commented at 2:55 PM on May 27, 2026: member

    The first commit fixes an error about INSTALL_BCC_TRACING_TOOLS being unbound.

    The second commit rewrites the wrap-valgrind Bash script to Python to fix the shellcheck SC2044 violation.

    Without this, the script would fail in CI when a path with spaces was used:

    ...
    + /ci_container_base/ci/test/wrap-valgrind.sh
    Wrap /ci_container_base/ci/scratch_ ...
    mv: cannot stat '/ci_container_base/ci/scratch_': No such file or directory
    Wrap ₿🧪_/out/bin/bitcoin ...
    mv: cannot stat '₿🧪_/out/bin/bitcoin': No such file or directory
    /ci_container_base/ci/test/wrap-valgrind.sh: line 14: ₿🧪_/out/bin/bitcoin: No such file or directory
    /ci_container_base/ci/test/wrap-valgrind.sh: line 15: ₿🧪_/out/bin/bitcoin: No such file or directory
    chmod: cannot access '₿🧪_/out/bin/bitcoin': No such file or directory
    
  2. ci: refactor: Avoid warning: INSTALL_BCC_TRACING_TOOLS: unbound variable
    The variable is never set and will always be unbound.
    
    The only way to set it correctly is via this hack:
    
    .github/workflows/ci.yml-        # In the image build step, no external environment variables are available,
    .github/workflows/ci.yml-        # so any settings will need to be written to the settings env file:
    .github/workflows/ci.yml:        run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh
    
    So just silence the warning, which happens when running the task
    locally:
    
    ```
    ./ci/test/00_setup_env_native_asan.sh: line 12: INSTALL_BCC_TRACING_TOOLS: unbound variable
    ```
    faf7e38973
  3. ci: Rewrite broken wrap-valgrind.sh to .py
    Shellcheck marked the script as violating SC2044.
    
    Instead of re-writing the Bash from scratch, just use Python.
    fa98d44951
  4. DrahtBot renamed this:
    ci: Rewrite broken wrap-valgrind.sh to .py
    ci: Rewrite broken wrap-valgrind.sh to .py
    on May 27, 2026
  5. DrahtBot added the label Tests on May 27, 2026
  6. DrahtBot commented at 2:55 PM on May 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK hebasto, fanquake

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  7. hebasto commented at 2:57 PM on May 27, 2026: member

    Concept ACK.

  8. DrahtBot added the label CI failed on May 27, 2026
  9. DrahtBot removed the label CI failed on May 27, 2026
  10. fanquake commented at 9:07 AM on May 28, 2026: member

    Concept ACK

  11. fanquake commented at 10:16 AM on May 28, 2026: member

    Tested (this branch rebased on master) locally. native_fuzz_with_valgrind.sh runs fine. native_valgrind.sh locally fails with:

    349/350 Test [#134](/bitcoin-bitcoin/134/): secp256k1.tests.ecmult_constants ..................................   Passed   23.76 sec
    350/350 Test [#335](/bitcoin-bitcoin/335/): coinselector_tests ................................................   Passed   34.23 sec
    
    100% tests passed, 0 tests failed out of 350
    
    Label Time Summary:
    secp256k1_exhaustive        =  15.83 sec*proc (1 test)
    secp256k1_noverify_tests    =  45.62 sec*proc (97 tests)
    secp256k1_tests             =  79.32 sec*proc (97 tests)
    
    Total Test time (real) =  44.88 sec
    + '[' true = true ']'
    + eval 'TEST_RUNNER_EXTRA=(--exclude rpc_bind --exclude feature_bind_extra)'
    ++ TEST_RUNNER_EXTRA=(--exclude rpc_bind --exclude feature_bind_extra)
    + LD_LIBRARY_PATH=/ci_container_base/depends/aarch64-unknown-linux-gnu/lib
    + '/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/test_runner.py' -j17 --tmpdirprefix '/ci_container_base/ci/scratch_ ₿🧪_/test_runner/' --ansi --combinedlogslen=99999999 --timeout-factor=40 --exclude rpc_bind --exclude feature_bind_extra --quiet --failfast
    [node 0] Cleaning up leftover process
    2026-05-28T09:18:54.493541Z TestFramework (INFO): PRNG seed is: 238594661659130723
    2026-05-28T09:18:54.545162Z TestFramework (INFO): Initializing test directory /ci_container_base/ci/scratch_ ₿🧪_/test_runner/test_runner_₿_🏃_20260528_091854/cache
    2026-05-28T09:19:09.092636Z TestFramework (ERROR): Unexpected exception:
    Traceback (most recent call last):
      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 139, in main
        self.setup()
        ~~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 271, in setup
        self.setup_chain()
        ~~~~~~~~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 359, in setup_chain
        self._initialize_chain()
        ~~~~~~~~~~~~~~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 847, in _initialize_chain
        self.stop_nodes()
        ~~~~~~~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 536, in stop_nodes
        node.wait_until_stopped()
        ~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_node.py", line 547, in wait_until_stopped
        self.wait_until(lambda: self.is_node_stopped(**kwargs), timeout=timeout)
        ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/ci_container_base/test/functional/test_framework/test_node.py", line 959, in wait_until
        return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.timeout_factor, check_interval=check_interval)
      File "/ci_container_base/test/functional/test_framework/util.py", line 436, in wait_until_helper_internal
        if predicate():
           ~~~~~~~~~^^
      File "/ci_container_base/test/functional/test_framework/test_node.py", line 547, in <lambda>
        self.wait_until(lambda: self.is_node_stopped(**kwargs), timeout=timeout)
                                ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
      File "/ci_container_base/test/functional/test_framework/test_node.py", line 523, in is_node_stopped
        assert return_code in expected_ret_code, self._node_msg(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: [node 0] Node returned unexpected exit code (1) vs ((0,)) when stopping
    2026-05-28T09:19:09.147182Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2026-05-28T09:19:09.147492Z TestFramework (WARNING): Not cleaning up dir /ci_container_base/ci/scratch_ ₿🧪_/test_runner/test_runner_₿_🏃_20260528_091854/cache
    2026-05-28T09:19:09.147561Z TestFramework (ERROR): Test failed. Test logging available at /ci_container_base/ci/scratch_ ₿🧪_/test_runner/test_runner_₿_🏃_20260528_091854/cache/test_framework.log
    2026-05-28T09:19:09.147680Z TestFramework (ERROR): 
    2026-05-28T09:19:09.147795Z TestFramework (ERROR): Hint: Call /ci_container_base/test/functional/combine_logs.py '/ci_container_base/ci/scratch_ ₿🧪_/test_runner/test_runner_₿_🏃_20260528_091854/cache' to consolidate all logs
    2026-05-28T09:19:09.147850Z TestFramework (ERROR): 
    2026-05-28T09:19:09.147886Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2026-05-28T09:19:09.147942Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2026-05-28T09:19:09.147975Z TestFramework (ERROR): 
    Excluding rpc_bind.py --ipv4
    Excluding rpc_bind.py --ipv6
    Excluding rpc_bind.py --nonloopback
    Excluding feature_bind_extra.py
    Traceback (most recent call last):
      File "/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/test_runner.py", line 954, in <module>
        main()
        ~~~~^^
      File "/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/test_runner.py", line 569, in main
        run_tests(
        ~~~~~~~~~^
            test_list=test_list,
            ^^^^^^^^^^^^^^^^^^^^
        ...<8 lines>...
            results_filepath=results_filepath,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/test_runner.py", line 623, in run_tests
        subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + ["--tmpdir=%s/cache" % tmpdir])
        ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/subprocess.py", line 472, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
               ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   **kwargs).stdout
                   ^^^^^^^^^
      File "/usr/lib/python3.13/subprocess.py", line 577, in run
        raise CalledProcessError(retcode, process.args,
                                 output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/create_cache.py', '--cachedir=/tmp/functional_test_cachep10_tqgt', '--timeout-factor=40', '--configfile=/ci_container_base/ci/scratch_ ₿🧪_/build-aarch64-unknown-linux-gnu/test/functional/../config.ini', '--tmpdir=/ci_container_base/ci/scratch_ ₿🧪_/test_runner//test_runner_₿_🏃_20260528_091854/cache']' returned non-zero exit status 1.
    Command '['docker', 'exec', '--env', 'DANGER_RUN_CI_ON_HOST=1', '7b93d8ab1dc9ba118608cd992b1757b57cb6a3e2fc21eb8b613453b26dff71ba', '/ci_container_base/ci/test/03_test_script.sh']' returned non-zero exit status 1.
    
    real	11m20.197s
    

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-05-31 17:50 UTC

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