Windows cross-build: unit test system_tests/run_command fails and functional tests cannot start bitcoind #34150

issue DevPatel-11 openend this issue on December 25, 2025
  1. DevPatel-11 commented at 5:10 pm on December 25, 2025: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Following doc/build-windows.md using WSL + MinGW on Windows, build + install succeed and the GUI runs, but tests fail:

    1. The unit test system_tests/run_command in test_bitcoin.exe fails with an assertion on the expected error message.
    2. Functional tests (wallet_basic.py and --coverage) fail to start bitcoind with Assertion failed: base.is_absolute(), file ./util/fs.cpp, line 36.

    So, building and running the GUI works, but the documented unit and functional tests do not pass on this configuration.

    Expected behaviour

    After a successful cross-build using doc/build-windows.md, the enabled unit tests (test_bitcoin) and basic functional tests (like wallet_basic.py and --coverage) should run and pass on this supported WSL + MinGW configuration, in line with src/test/README.md and test/functional/README.md.

    Steps to reproduce

    All commands are run inside WSL (Ubuntu). The source tree is not under /mnt/c, but under the WSL filesystem.

    1. Clone and enter the repo:
    0git clone https://github.com/bitcoin/bitcoin.git
    1cd bitcoin
    
    1. Build depends (per doc/build-windows.md):
    0gmake -C depends HOST=x86_64-w64-mingw32
    
    1. Configure and build (per doc/build-windows.md):
    0cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
    1cmake --build build
    
    1. Install to Windows (bitcoind/bitcoin-qt work fine from here):
    0cmake --install build --prefix /mnt/c/workspace/bitcoin
    
    1. Build unit tests:
    0cmake --build build --target test_bitcoin
    
    1. Run the specific unit test:
    0cd ~/bitcoin/build/bin
    1./test_bitcoin.exe --run_test=system_tests/run_command --log_level=test_suite
    
    1. Run a functional test and coverage (from repo root):
    0cd ~/bitcoin
    1build/test/functional/test_runner.py wallet_basic.py
    2build/test/functional/test_runner.py --coverage
    

    Relevant log output

    Unit test failure:

    0cd ~/bitcoin/build/bin
    1./test_bitcoin.exe --run_test=system_tests/run_command --log_level=test_suite
    

    Output (trimmed):

     0Entering test module "Bitcoin Core Test Suite"
     1./wallet/test/walletload_tests.cpp(14): Test suite "walletload_tests" is skipped because disabled
     2... (many test suites skipped because disabled) ...
     3./test/testnet4_miner_tests.cpp(30): Test suite "testnet4_miner_tests" is skipped because disabled
     4./test/system_tests.cpp(17): Entering test suite "system_tests"
     5./test/system_tests.cpp(21): Entering test case "run_command"
     6./test/system_tests.cpp(56): error: in "system_tests/run_command": check what.find(tfm::format("RunCommandParseJSON error: process(%s) returned 1: \n", command)) != std::string::npos has failed
     7./test/system_tests.cpp(21): Leaving test case "run_command"; testing time: 196716us
     8./test/system_tests.cpp(17): Leaving test suite "system_tests"; testing time: 199262us
     9./test/system_ram_tests.cpp(13): Test suite "system_ram_tests" is skipped because disabled
    10... (more suites skipped) ...
    11Leaving test module "Bitcoin Core Test Suite"; testing time: 433839us
    12
    13*** 1 failure is detected in the test module "Bitcoin Core Test Suite"
    

    Functional test failure (wallet_basic.py):

    0cd ~/bitcoin
    1build/test/functional/test_runner.py wallet_basic.py
    

    Output:

     0Temporary test directory at /tmp/test_runner__🏃_20251225_162435
     1Remaining jobs: [wallet_basic.py]
     21/1 - wallet_basic.py failed, Duration: 57 s
     3
     4stdout:
     52025-12-25T16:24:35.518658Z TestFramework (INFO): PRNG seed is: 6050933089769083783
     62025-12-25T16:24:35.520147Z TestFramework (INFO): Initializing test directory /tmp/test_runner__🏃_20251225_162435/wallet_basic_0
     72025-12-25T16:25:32.647545Z TestFramework (ERROR): Unexpected exception
     8Traceback (most recent call last):
     9  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 138, in main
    10    self.setup()
    11  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 269, in setup
    12    self.setup_network()
    13  File "/home/kelos/bitcoin/build/test/functional/wallet_basic.py", line 44, in setup_network
    14    self.setup_nodes()
    15  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 382, in setup_nodes
    16    self.start_nodes()
    17  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 528, in start_nodes
    18    node.wait_for_rpc_connection()
    19  File "/home/kelos/bitcoin/test/functional/test_framework/test_node.py", line 316, in wait_for_rpc_connection
    20    raise FailedToStartError(self._node_msg(
    21test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 3 during initialization. Assertion failed: base.is_absolute(), file ./util/fs.cpp, line 36
    22************************
    23
    242025-12-25T16:25:32.699370Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    252025-12-25T16:25:32.699638Z TestFramework (WARNING): Not cleaning up dir /tmp/test_runner__🏃_20251225_162435/wallet_basic_0
    262025-12-25T16:25:32.699739Z TestFramework (ERROR): Test failed. Test logging available at /tmp/test_runner__🏃_20251225_162435/wallet_basic_0/test_framework.log
    272025-12-25T16:25:32.699905Z TestFramework (ERROR):
    282025-12-25T16:25:32.700105Z TestFramework (ERROR): Hint: Call /home/kelos/bitcoin/test/functional/combine_logs.py '/tmp/test_runner_₿_🏃_20251225_162435/wallet_basic_0' to consolidate all logs
    292025-12-25T16:25:32.700184Z TestFramework (ERROR):
    302025-12-25T16:25:32.700424Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    312025-12-25T16:25:32.700571Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    322025-12-25T16:25:32.700677Z TestFramework (ERROR):
    33
    34stderr:
    35[node 3] Cleaning up leftover process
    36[node 2] Cleaning up leftover process
    37[node 1] Cleaning up leftover process
    38[node 0] Cleaning up leftover process
    39
    40TEST            | STATUS    | DURATION
    41wallet_basic.py |  Failed  | 57 s
    42
    43ALL             |  Failed  | 57 s (accumulated)
    44Runtime: 57 s
    

    Functional test failure with –coverage:

    0cd ~/bitcoin
    1build/test/functional/test_runner.py --coverage
    

    Output:

     0Temporary test directory at /tmp/test_runner__🏃_20251225_162532
     1Initializing coverage directory at /tmp/coveragemf6gv9tr
     2[node 0] Cleaning up leftover process
     32025-12-25T16:25:32.916746Z TestFramework (INFO): PRNG seed is: 332623413216244638
     42025-12-25T16:25:32.917531Z TestFramework (INFO): Initializing test directory /tmp/test_runner__🏃_20251225_162532/cache
     52025-12-25T16:25:35.676350Z TestFramework (ERROR): Unexpected exception
     6Traceback (most recent call last):
     7  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 138, in main
     8    self.setup()
     9  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 268, in setup
    10    self.setup_chain()
    11  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 356, in setup_chain
    12    self._initialize_chain()
    13  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 814, in _initialize_chain
    14    self.start_node(CACHE_NODE_ID)
    15  File "/home/kelos/bitcoin/test/functional/test_framework/test_framework.py", line 514, in start_node
    16    node.wait_for_rpc_connection()
    17  File "/home/kelos/bitcoin/test/functional/test_node.py", line 316, in wait_for_rpc_connection
    18    raise FailedToStartError(self._node_msg(
    19test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 3 during initialization. Assertion failed: base.is_absolute(), file ./util/fs.cpp, line 36
    20************************
    21
    222025-12-25T16:25:35.729866Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    232025-12-25T16:25:35.730219Z TestFramework (WARNING): Not cleaning up dir /tmp/test_runner__🏃_20251225_162532/cache
    242025-12-25T16:25:35.730333Z TestFramework (ERROR): Test failed. Test logging available at /tmp/test_runner__🏃_20251225_162532/cache/test_framework.log
    252025-12-25T16:25:35.730631Z TestFramework (ERROR):
    262025-12-25T16:25:35.730888Z TestFramework (ERROR): Hint: Call /home/kelos/bitcoin/test/functional/combine_logs.py '/tmp/test_runner_₿_🏃_20251225_162532/cache' to consolidate all logs
    272025-12-25T16:25:35.731025Z TestFramework (ERROR):
    282025-12-25T16:25:35.731110Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    292025-12-25T16:25:35.731245Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    302025-12-25T16:25:35.731393Z TestFramework (ERROR):
    31
    32Traceback (most recent call last):
    33  File "/home/kelos/bitcoin/build/test/functional/test_runner.py", line 931, in <module>
    34    main()
    35  File "/home/kelos/bitcoin/build/test/functional/test_runner.py", line 542, in main
    36    run_tests(
    37  File "/home/kelos/bitcoin/build/test/functional/test_runner.py", line 595, in run_tests
    38    subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + ["--tmpdir=%s/cache" % tmpdir])
    39  File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
    40    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    41  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    42    raise CalledProcessError(retcode, process.args,
    43subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/kelos/bitcoin/build/test/functional/create_cache.py', '--cachedir=/home/kelos/bitcoin/build/test/cache', '--configfile=/home/kelos/bitcoin/build/test/functional/../config.ini', '--coveragedir=/tmp/coveragemf6gv9tr', '--tmpdir=/tmp/test_runner__🏃_20251225_162532/cache']' returned non-zero exit status 1.
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@d861c3820528fad2e17a455949bec70b6ba434dcc

    Operating system and version

    Windows 10.0.26200.7462 (host), WSL2 with Ubuntu; wsl.exe --version: - WSL version: 2.6.2.0 - Kernel version: 6.6.87.2-1 - WSLg version: 1.0.71 - MSRDC version: 1.2.6353 - Direct3D version: 1.611.1-81528511 - DXCore version: 10.0.26100.1-240331-1435.ge-release

    Machine specifications

    CPU:

    • 12th Gen Intel Core i5-12500H (x86_64)
    • 8 cores / 16 threads (lscpu)
    • L3 cache: 18 MiB

    Memory:

    • 16 GiB RAM total
    • ~11 GiB free, 4 GiB swap (free -h)

    Disk:

    • Host C: drive 454 GiB total, 219 GiB free (df -h, /mnt/c)
    • WSL root filesystem on /dev/sdd: 1.0 TiB total, 946 GiB free

    Distro inside WSL:

    • Ubuntu 24.04.3 LTS (noble) (lsb_release -a)
  2. maflcko commented at 7:08 am on December 26, 2025: member

    Not sure what your goal is, but I think you are trying to run a Windows executable inside the WSL env (possibly through Wine?). Is this really what you are doing and what you want to be doing? I think it makes more sense to either:

    • Natively compile for Linux inside WSL, and run natively for Linux inside WSL
    • Cross-compile for Windows inside WSL, and run natively outside of WSL in Windows
    • Compile natively on and for Windows, and run natively on Windows
  3. DevPatel-11 commented at 7:28 am on December 26, 2025: none

    Thanks for the quick reply!

    Just to clarify what I tested:

    • Cross-compile for Windows in WSL using doc/build-windows.md (depends + CMake).
    • Installed to C:\workspace\bitcoin and successfully ran bitcoin-qt.exe on Windows.
    • For tests, I stayed in WSL and ran build/bin/test_bitcoin.exe and build/test/functional/test_runner.py, which then start the cross-built bitcoind.exe.

    If running the Windows test binaries from WSL is considered unsupported, I’m happy to switch to:

    • building natively for Linux in WSL and running tests there, or
    • running tests only with Linux binaries for this environment.

    In that case, this issue can be closed as “unsupported configuration”; I mainly wanted to check whether this cross-build + WSL test combination is expected to work or not.

  4. maflcko commented at 7:43 am on December 26, 2025: member

    For tests, I stayed in WSL and ran build/bin/test_bitcoin.exe and build/test/functional/test_runner.py, which then start the cross-built bitcoind.exe.

    So you did that via Wine? For reference, Wine was dropped from the CI config, due to issues: #31284 (comment).

    If running the Windows test binaries from WSL is considered unsupported, I’m happy to switch to:

    * building natively for Linux in WSL and running tests there, or
    
    * running tests only with Linux binaries for this environment.
    

    In that case, this issue can be closed as “unsupported configuration”; I mainly wanted to check whether this cross-build + WSL test combination is expected to work or not.

    Well, if there is an obvious bug and an obvious fix for an issue, I am happy to review it. However, I don’t think the config will ever be added back to the CI matrix, because I don’t see a real use-case behind it.

  5. DevPatel-11 commented at 7:52 am on December 26, 2025: none

    Thanks for the clarification!

    To answer your question: I did not use Wine anywhere. All commands were run directly in WSL:

    • Cross-compile for Windows in WSL using doc/build-windows.md.
    • Run the resulting .exe binaries from WSL by invoking ./build/bin/test_bitcoin.exe and the functional tests, which then start the cross-built bitcoind.exe.

    Given your comment that this configuration (running Windows binaries under WSL, similar to what CI used to do with Wine) is not really supported and won’t be in the CI matrix, I’m fine treating this as an unsupported setup.

    My goal with this issue was mainly to confirm whether this combination is expected to work or not, and share the exact failures I saw in case they point to an obvious bug / simple fix.

    If you think this should be closed, I’m happy for you to close it !

  6. maflcko commented at 9:16 am on December 26, 2025: member

    For reference, i pushed commit https://github.com/maflcko/bitcoin-core-with-ci/commit/c1387e48e12db0ee3efbdf80b91d5267d81c3301 : and it passed: https://github.com/maflcko/bitcoin-core-with-ci/actions/runs/20518628300/job/58950286007#step:7:4867

     0diff --git a/ci/test/00_setup_env_win64_msvcrt.sh b/ci/test/00_setup_env_win64_msvcrt.sh
     1index 86e0ea9c80..9c72b6fddd 100755
     2--- a/ci/test/00_setup_env_win64_msvcrt.sh
     3+++ b/ci/test/00_setup_env_win64_msvcrt.sh
     4@@ -9,8 +9,9 @@ export LC_ALL=C.UTF-8
     5 export CONTAINER_NAME=ci_win64_msvcrt
     6 export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"  # Check that https://packages.ubuntu.com/noble/g++-mingw-w64-x86-64-posix (version 13.x, similar to guix) can cross-compile
     7 export HOST=x86_64-w64-mingw32
     8-export PACKAGES="g++-mingw-w64-x86-64-posix nsis"
     9-export RUN_UNIT_TESTS=false
    10+export DPKG_ADD_ARCH="i386"
    11+export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
    12+export RUN_UNIT_TESTS=true
    13 export RUN_FUNCTIONAL_TESTS=false
    14 export GOAL="deploy"
    15 export BITCOIN_CONFIG="\
    16diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
    17index d29de80c3e..0b39f205c9 100755
    18--- a/ci/test/03_test_script.sh
    19+++ b/ci/test/03_test_script.sh
    20@@ -157,6 +157,10 @@ if [ -n "${CI_LIMIT_STACK_SIZE}" ]; then
    21   ulimit -s 512
    22 fi
    23 
    24+if [[ $HOST = *-mingw32 ]]; then
    25+  "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
    26+fi
    27+
    28 if [ -n "$USE_VALGRIND" ]; then
    29   "${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
    30 fi
    31diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh
    32new file mode 100755
    33index 0000000000..a0d32a93a3
    34--- /dev/null
    35+++ b/ci/test/wrap-wine.sh
    36@@ -0,0 +1,20 @@
    37+#!/usr/bin/env bash
    38+#
    39+# Copyright (c) 2020-2022 The Bitcoin Core developers
    40+# Distributed under the MIT software license, see the accompanying
    41+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
    42+
    43+export LC_ALL=C.UTF-8
    44+
    45+for b_name in {"${BASE_OUTDIR}/bin"/*,src/univalue/{test_json,unitester,object}}.exe; do
    46+    # shellcheck disable=SC2044
    47+    for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename "$b_name")"); do
    48+      if (file "$b" | grep "Windows"); then
    49+        echo "Wrap $b ..."
    50+        mv "$b" "${b}_orig"
    51+        echo '#!/usr/bin/env bash' > "$b"
    52+        echo "( wine \"${b}_orig\" \"\$@\" ) || ( sleep 1 && wine \"${b}_orig\" \"\$@\" )" >> "$b"
    53+        chmod +x "$b"
    54+      fi
    55+    done
    56+done
    
  7. maflcko commented at 9:17 am on December 26, 2025: member

    My goal with this issue was mainly to confirm whether this combination is expected to work or not, and share the exact failures I saw in case they point to an obvious bug / simple fix.

    If you think this should be closed, I’m happy for you to close it !

    This is up to you. I can’t reproduce the bug and I don’t think anyone will work on this issue, so you’ll have to create and submit a fix yourself. If not, then maybe this can indeed be closed.

    You may also try #33929, if it improves your situation.

  8. DevPatel-11 commented at 9:36 am on December 26, 2025: none
    Thanks for the feedback. I will try #33929 and see if it helps. I’ll close this issue now. Thanks for understanding!
  9. DevPatel-11 closed this on Dec 26, 2025

  10. hebasto added the label Windows on Dec 27, 2025
  11. hebasto commented at 10:29 pm on December 27, 2025: member
    • Cross-compile for Windows in WSL using doc/build-windows.md.

    • Run the resulting .exe binaries from WSL by invoking ./build/bin/test_bitcoin.exe and the functional tests, which then start the cross-built bitcoind.exe.

    FWIW, when working on Windows, it is worth considering building natively using clang-cl.


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-01-07 03:13 UTC

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