Skip to content

doc: Add hint about avoiding spaces in paths when building on Windows #32397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Brotcrunsher
Copy link
Contributor

When running the configuration step

cmake -B build --preset vs2022-static

from a directory with spaces in its path, CMake issues the following warning:

Warning: Paths with embedded space may be handled incorrectly by configure

The build subsequently fails with error code 77.

While the underlying issue should ideally be resolved, this hint may help users avoid related build failures in the meantime.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 1, 2025

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/32397.

Reviews

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

@DrahtBot DrahtBot added the Docs label May 1, 2025
@laanwj
Copy link
Member

laanwj commented May 1, 2025

That's too bad, we'd finally solved all the build-with-spaces issues with the old build system.

But yes i suppose it doesn't hurt too add a warning in the meantime...

@hebasto
Copy link
Member

hebasto commented May 1, 2025

from a directory with spaces in its path, CMake issues the following warning:

Warning: Paths with embedded space may be handled incorrectly by configure

This is a vcpkg upstream issue. Another one has already been documented:

If building with `BUILD_GUI=ON`, vcpkg installation during the build
configuration step might fail because of extremely long paths required during
vcpkg installation if your vcpkg instance is installed in the default Visual
Studio directory. This can be avoided without modifying your vcpkg root
directory by changing vcpkg's intermediate build directory with the
`--x-buildtrees-root` argument to something shorter, for example:
```powershell
cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg"
```

This is not specific to CMake in general, nor to the Bitcoin Core build system.

When running the configuration step
    cmake -B build --preset vs2022-static
from a directory with spaces in its path, vcpkg issues the following warning:

    Warning: Paths with embedded space may be handled incorrectly by configure

The build subsequently fails with error code 77.

While the underlying issue should ideally be resolved, this hint may help users avoid related build failures in the meantime.
@Brotcrunsher
Copy link
Contributor Author

@hebasto Thanks for your feedback! I fixed the wording in the commit message to mention vcpkg instead of CMake. I agree that this isn't Bitcoin Cores fault, but IMO it would still be "nice" for new devs to have a warning in place. Might save them a minor headache.

@hebasto hebasto added the Windows label May 1, 2025
@laanwj
Copy link
Member

laanwj commented May 2, 2025

This is not specific to CMake in general, nor to the Bitcoin Core build system.

Happy about that. i know it was something we explicitly considered and tested when going to CMake so hence my surprise.

In general, Windows users are the most likely to have spaces in any path they're allowed to write to. For example, from that iconv vcpkg issue:

That would require me to reinstall my entire operating system (Windows 11 setup asks you for your name and then sets the user folder name to that, including spaces). Not sure if that is something that should be accounted for within vcpkg or within Windows itself

So hope this will get resolved upstream sooner than this documentation change would make it into a release.

@Brotcrunsher
Copy link
Contributor Author

@laanwj I don't think that the time of the next release is necessarily the important thing here. This is documentation about how to build bitcoin core, which I assume is often done with the master of this repo.

@fanquake
Copy link
Member

fanquake commented May 2, 2025

It's not clear what is failing to build? If it is libiconv, how is that related to our build; is this something we can just avoid? In either case, please adjust the hint to be explcit about spaces being unsupported, and remove vaugeries like "they have been known to cause build issues.". Either spaces are supported, in which case we can test the behaviour, or they are not supported.

@hebasto
Copy link
Member

hebasto commented May 2, 2025

It's not clear what is failing to build? If it is libiconv, how is that related to our build; is this something we can just avoid?

libiconv is listed as a direct dependency of the qt package (see the output of vcpkg depend-info qt).

@hebasto
Copy link
Member

hebasto commented May 2, 2025

According to the vcpkg docs, the default install directory (${CMAKE_BINARY_DIR}\vcpkg_installed) can be overridden by setting the VCPKG_INSTALLED_DIR variable to a path that contains no spaces. This resolves the issue.

@fanquake
Copy link
Member

What is the status of this? Do we need to add something to the docs?

@hebasto
Copy link
Member

hebasto commented May 15, 2025

What is the status of this? Do we need to add something to the docs?

I believe it would be helpful to mention a workaround in the build documentation. Here's a suggestion you could consider including.

Feel free to grab it.

cc @davidgumberg

@laanwj
Copy link
Member

laanwj commented May 16, 2025

It would be useful to document, but not in the way it is here. It's not a problem when cloning the repository. The current warning is confusing, it should be more specific (also to make it more clear when the problem is solved and the warning can be removed again).

I believe it would be helpful to mention a workaround in the build documentation. Here's a suggestion you could consider including.

+1

@fanquake
Copy link
Member

fanquake commented Jul 2, 2025

Closing for now. @hebasto maybe you can followup with your own suggestion.

@hebasto
Copy link
Member

hebasto commented Jul 2, 2025

Closing for now. @hebasto maybe you can followup with your own suggestion.

Sure. #32858.

fanquake added a commit that referenced this pull request Jul 3, 2025
…edded spaces

0a1af44 doc: Add workaround for vcpkg issue with paths with embedded spaces (Hennadii Stepanov)

Pull request description:

  This PR is an alternative to #32397 suggested in #32397 (comment).

ACKs for top commit:
  sipsorcery:
    ACK 0a1af44.

Tree-SHA512: 09efc3f8b8c38eb8d8de1022c5b11685fba334cdb950209d35b3b0d907fa50de3f85f45c66ac3670b5b104d5bb0b01461c36a0c1e595327b5e62c6abca323deb
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.

5 participants