Skip to content

ci: Test build dir with spaces - #35356

Closed
maflcko wants to merge 2 commits into
bitcoin:masterfrom
maflcko:2605-ci-bld-space
Closed

maflcko wants to merge 2 commits into
bitcoin:masterfrom
maflcko:2605-ci-bld-space

Conversation

@maflcko

@maflcko maflcko commented May 22, 2026

Copy link
Copy Markdown
Member

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

export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch_ ₿🧪_}

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 DrahtBot added the Tests label May 22, 2026
@DrahtBot

DrahtBot commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

@hebasto

hebasto commented May 22, 2026

Copy link
Copy Markdown
Member

Concept ACK.

@fanquake

Copy link
Copy Markdown
Member
[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

maflcko commented May 22, 2026

Copy link
Copy Markdown
Member Author

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 2706758)

hebasto added a commit that referenced this pull request Jul 22, 2026
f3f3021 ci: Put space and non-ASCII char in `BASE_BUILD_DIR` (Hennadii Stepanov)
a7e980a build: Quote host paths in NSIS installer template (Hennadii Stepanov)

Pull request description:

  The CI scratch directory contains a space and non-ASCII symbols to test path handling (see #34614). However, the GHA workflows [override](https://github.com/bitcoin/bitcoin/blob/18c05d93016b28a9afd4c716dfe00b6e0accb30b/.github/actions/configure-environment/action.yml#L10) `BASE_BUILD_DIR` to `${{ runner.temp }}/build` via the `configure-environment` action, bypassing the `$BASE_SCRATCH_DIR/build-$HOST` [default](https://github.com/bitcoin/bitcoin/blob/18c05d93016b28a9afd4c716dfe00b6e0accb30b/ci/test/03_test_script.sh#L109-L110) from `03_test_script.sh`.

  The first commit fixes the NSIS template, which otherwise breaks the `deploy` target when paths contain spaces.

  Related to #35356.

ACKs for top commit:
  maflcko:
    re-ACK f3f3021 🥘
  l0rinc:
    code review ACK f3f3021

Tree-SHA512: 5785dc13961d656e73759888d653967e43d6a9e1eec46a12301c65d042bc53a824f2dd9cdaa602c1bfb1afb52c4753099a705eab3a337f88ac6a68893e2de7f9
@maflcko

maflcko commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

fresh CI

@maflcko maflcko closed this Aug 17, 2026
@maflcko maflcko reopened this Aug 17, 2026
@maflcko

maflcko commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

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

@maflcko maflcko closed this Nov 20, 2026
@maflcko
maflcko deleted the 2605-ci-bld-space branch November 20, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants