WIP: ci: Test build dir with spaces #35356

Closed
maflcko wants to merge 2 commits from 2605-ci-bld-space into master AGit
maflcko commented 2026-05-22 12:04:14 +00:00 (Migrated from github.com)

In theory this is already tested by setting the scratch dir to scratch_ ₿🧪_ in the CI:

github.com/bitcoin/bitcoin@b9f0040caf/ci/test/00_setup_env.sh (L26)

However, this doesn't cover everything, because on Linux, the build dir will contain symlinks to the Python functional tests, which will drop the space when they are resolved. So the subprocess.h may not see spaces in the command.

In theory, this can be fixed by moving the CI root dir to something with spaces, but this breaks other stuff (like depends).

So, only test subprocess.h handling of paths with spaces on Windows, which creates copies instead of symlinks to Python scripts.

In theory this is already tested by setting the scratch dir to `scratch_ ₿🧪_` in the CI: https://github.com/bitcoin/bitcoin/blob/b9f0040caf45355c4621e792df09fffabf23495e/ci/test/00_setup_env.sh#L26 However, this doesn't cover everything, because on Linux, the build dir will contain symlinks to the Python functional tests, which will drop the space when they are resolved. So the `subprocess.h` may not see spaces in the command. In theory, this can be fixed by moving the CI root dir to something with spaces, but this breaks other stuff (like depends). So, only test `subprocess.h` handling of paths with spaces on Windows, which creates copies instead of symlinks to Python scripts.
DrahtBot commented 2026-05-22 12:04:23 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK hebasto

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

Conflicts

No conflicts as of last run.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35356 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35356.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35356#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Concept ACK | [hebasto](https://github.com/bitcoin/bitcoin/pull/35356#issuecomment-4518667535) | 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. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts No conflicts as of last run. <!--5faf32d7da4f0f540f40219e4f7537a3-->
hebasto commented 2026-05-22 12:32:19 +00:00 (Migrated from github.com)

Concept ACK.

Concept ACK.
fanquake commented 2026-05-22 13:26:42 +00:00 (Migrated from github.com)
[420](https://github.com/bitcoin/bitcoin/actions/runs/26286704505/job/77376033170#step:14:3421)
 test  2026-05-22T12:47:14.418896Z TestFramework (ERROR): Unexpected exception: 
                                   Traceback (most recent call last):
                                     File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\test_framework.py", line 143, in main
                                       self.run_test()
                                       ~~~~~~~~~~~~~^^
                                     File "D:\a\bitcoin\bitcoin\build_ _\test\functional\wallet_signer.py", line 58, in run_test
                                       self.test_valid_signer()
                                       ~~~~~~~~~~~~~~~~~~~~~~^^
                                     File "D:\a\bitcoin\bitcoin\build_ _\test\functional\wallet_signer.py", line 71, in test_valid_signer
                                       self.nodes[1].createwallet(wallet_name='hww', disable_private_keys=True, external_signer=True)
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                     File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\coverage.py", line 50, in __call__
                                       return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                                     File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\authproxy.py", line 153, in __call__
                                       raise JSONRPCException(response['error'], status)
                                   test_framework.authproxy.JSONRPCException: {'code': -1, 'message': "RunCommandParseJSON error: process(C:\\hostedtoolcache\\windows\\Python\\3.14.5\\x64\\python.exe D:\\a\\bitcoin\\bitcoin\\build_ _\\test\\functional\\mocks\\signer.py enumerate) returned 2: C:\\hostedtoolcache\\windows\\Python\\3.14.5\\x64\\python.exe: can't open file 'D:\\\\a\\\\bitcoin\\\\bitcoin\\\\build_': [Errno 2] No such file or directory\r\n"} [http_status=200]
 test  2026-05-22T12:47:14.424669Z TestFramework (DEBUG): Closing down network thread
```bash [420](https://github.com/bitcoin/bitcoin/actions/runs/26286704505/job/77376033170#step:14:3421) test 2026-05-22T12:47:14.418896Z TestFramework (ERROR): Unexpected exception: Traceback (most recent call last): File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\test_framework.py", line 143, in main self.run_test() ~~~~~~~~~~~~~^^ File "D:\a\bitcoin\bitcoin\build_ _\test\functional\wallet_signer.py", line 58, in run_test self.test_valid_signer() ~~~~~~~~~~~~~~~~~~~~~~^^ File "D:\a\bitcoin\bitcoin\build_ _\test\functional\wallet_signer.py", line 71, in test_valid_signer self.nodes[1].createwallet(wallet_name='hww', disable_private_keys=True, external_signer=True) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\coverage.py", line 50, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File "D:\a\bitcoin\bitcoin\build_ _\test\functional\test_framework\authproxy.py", line 153, in __call__ raise JSONRPCException(response['error'], status) test_framework.authproxy.JSONRPCException: {'code': -1, 'message': "RunCommandParseJSON error: process(C:\\hostedtoolcache\\windows\\Python\\3.14.5\\x64\\python.exe D:\\a\\bitcoin\\bitcoin\\build_ _\\test\\functional\\mocks\\signer.py enumerate) returned 2: C:\\hostedtoolcache\\windows\\Python\\3.14.5\\x64\\python.exe: can't open file 'D:\\\\a\\\\bitcoin\\\\bitcoin\\\\build_': [Errno 2] No such file or directory\r\n"} [http_status=200] test 2026-05-22T12:47:14.424669Z TestFramework (DEBUG): Closing down network thread ```
maflcko commented 2026-05-22 13:28:49 +00:00 (Migrated from github.com)

The Windows CI fails, as expected. To reproduce on Linux:

# ./bld-cmake/test/functional/wallet_signer.py 
2026-05-22T13:25:49.297591Z TestFramework (INFO): PRNG seed is: 1399337446465493161
2026-05-22T13:25:49.349357Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_txcy4g9y
2026-05-22T13:25:50.900451Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
  File "/root/ ₿🧪_/test/functional/test_framework/test_framework.py", line 143, in main
    self.run_test()
    ~~~~~~~~~~~~~^^
  File "/root/ ₿🧪_/./bld-cmake/test/functional/wallet_signer.py", line 58, in run_test
    self.test_valid_signer()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/root/ ₿🧪_/./bld-cmake/test/functional/wallet_signer.py", line 71, in test_valid_signer
    self.nodes[1].createwallet(wallet_name='hww', disable_private_keys=True, external_signer=True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ ₿🧪_/test/functional/test_framework/coverage.py", line 50, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/root/ ₿🧪_/test/functional/test_framework/authproxy.py", line 153, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: {'code': -1, 'message': "RunCommandParseJSON error: process(/usr/bin/python3 /root/ ₿🧪_/test/functional/mocks/signer.py enumerate) returned 1: /usr/bin/python3: can't find '__main__' module in '/root/'\n"} [http_status=200]
2026-05-22T13:25:50.955938Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
2026-05-22T13:25:50.956328Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_txcy4g9y
2026-05-22T13:25:50.956531Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_txcy4g9y/test_framework.log
2026-05-22T13:25:50.956800Z TestFramework (ERROR): 
2026-05-22T13:25:50.957103Z TestFramework (ERROR): Hint: Call /root/ ₿🧪_/test/functional/combine_logs.py '/tmp/bitcoin_func_test_txcy4g9y' to consolidate all logs
2026-05-22T13:25:50.957270Z TestFramework (ERROR): 
2026-05-22T13:25:50.957401Z 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-22T13:25:50.957595Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2026-05-22T13:25:50.957724Z TestFramework (ERROR): 
[node 1] Cleaning up leftover process
[node 0] Cleaning up leftover process



# history 
    4  git clone https://github.com/bitcoin/bitcoin.git  --depth=1 "./ ₿🧪_" && cd "./ ₿🧪_"
    5  cmake -B ./bld-cmake    -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' --preset=dev-mode
    9  cmake --build ./bld-cmake --parallel  $(nproc) 
   10  ./bld-cmake/test/functional/wallet_signer.py 

(failure happens on Linux, before and after 2706758dc3)

The Windows CI fails, as expected. To reproduce on Linux: ``` # ./bld-cmake/test/functional/wallet_signer.py 2026-05-22T13:25:49.297591Z TestFramework (INFO): PRNG seed is: 1399337446465493161 2026-05-22T13:25:49.349357Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_txcy4g9y 2026-05-22T13:25:50.900451Z TestFramework (ERROR): Unexpected exception: Traceback (most recent call last): File "/root/ ₿🧪_/test/functional/test_framework/test_framework.py", line 143, in main self.run_test() ~~~~~~~~~~~~~^^ File "/root/ ₿🧪_/./bld-cmake/test/functional/wallet_signer.py", line 58, in run_test self.test_valid_signer() ~~~~~~~~~~~~~~~~~~~~~~^^ File "/root/ ₿🧪_/./bld-cmake/test/functional/wallet_signer.py", line 71, in test_valid_signer self.nodes[1].createwallet(wallet_name='hww', disable_private_keys=True, external_signer=True) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/ ₿🧪_/test/functional/test_framework/coverage.py", line 50, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File "/root/ ₿🧪_/test/functional/test_framework/authproxy.py", line 153, in __call__ raise JSONRPCException(response['error'], status) test_framework.authproxy.JSONRPCException: {'code': -1, 'message': "RunCommandParseJSON error: process(/usr/bin/python3 /root/ ₿🧪_/test/functional/mocks/signer.py enumerate) returned 1: /usr/bin/python3: can't find '__main__' module in '/root/'\n"} [http_status=200] 2026-05-22T13:25:50.955938Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later. 2026-05-22T13:25:50.956328Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_txcy4g9y 2026-05-22T13:25:50.956531Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_txcy4g9y/test_framework.log 2026-05-22T13:25:50.956800Z TestFramework (ERROR): 2026-05-22T13:25:50.957103Z TestFramework (ERROR): Hint: Call /root/ ₿🧪_/test/functional/combine_logs.py '/tmp/bitcoin_func_test_txcy4g9y' to consolidate all logs 2026-05-22T13:25:50.957270Z TestFramework (ERROR): 2026-05-22T13:25:50.957401Z 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-22T13:25:50.957595Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 2026-05-22T13:25:50.957724Z TestFramework (ERROR): [node 1] Cleaning up leftover process [node 0] Cleaning up leftover process # history 4 git clone https://github.com/bitcoin/bitcoin.git --depth=1 "./ ₿🧪_" && cd "./ ₿🧪_" 5 cmake -B ./bld-cmake -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' --preset=dev-mode 9 cmake --build ./bld-cmake --parallel $(nproc) 10 ./bld-cmake/test/functional/wallet_signer.py ``` (failure happens on Linux, before and after 2706758dc38c7a4e271d9df5ea3104b7135974f3)
maflcko commented 2026-08-17 13:00:37 +00:00 (Migrated from github.com)

fresh CI

fresh CI
First-time contributor

Earlier concerns remain unresolved; see the Run archive linked from the Review report.

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 41380ed56408 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:6a826d2acdafed49b7b1892314cfaf864dace9b431f227178799371fbd9534f8:ed9be5e94133131d95df3bd45346aff47c7772f27c22da7e230a47332f9fcbac --> <!-- ralph-base:ff90ca6cd56b59b803daa82d25145daaada5fb0b --> <!-- ralph-head:41380ed564088e5eb1bdaa5d07553e4fb7a800f3 --> <!-- ralph-case:9c1b63d80d8c050145ffa7152962729c345926c10ec52cb956f03815808ba5fd --> Earlier concerns remain unresolved; see the Run archive linked from the Review report. No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: standard --> --- Reviewed: [`41380ed56408`](<https://git.fish.foo/bitcoin/bitcoin/commit/41380ed564088e5eb1bdaa5d07553e4fb7a800f3>) · [Review report](<https://review.fish.foo/report/35356-41380ed564088e5eb1bdaa5d07553e4fb7a800f3-2598-3.html>) · [Previous reports](<https://review.fish.foo/traces/35356/>) [permalink](<https://review.fish.foo/report/35356-41380ed564088e5eb1bdaa5d07553e4fb7a800f3-2598-3.html>)
maflcko commented 2026-11-20 06:45:15 +00:00 (Migrated from github.com)

Closing for now. There are too many pulls open right now and this can be revisited later.

Closing for now. There are too many pulls open right now and this can be revisited later.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35356
No description provided.