Repository navigation
fix(libcurl): build the curl backend from a checkout path with spaces on Windows - #20120
Merged
oneandonlydean merged 1 commit intoNov 14, 2026
Conversation
… on Windows GNU windres hands its include directories to the preprocessor unquoted, so an include directory that contains a space splits into two arguments and the bundled curl's libcurl.rc fails with "No such file or directory" for every -I. libcurl.rc includes only <winver.h> and "../include/curl/curlver.h", which resolves relative to the file, so on MinGW the curl backend's resource rule now omits the include directories. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
12 tasks done
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The full Windows build fails when the checkout path contains a space, for example under a Windows user folder whose name has one. It stops in the bundled curl backend at
lib/CMakeFiles/libcurl.dir/libcurl.rc.obj:GNU windres hands its include directories to the preprocessor unquoted, so each
-Ithat contains a space splits into two arguments. Reduced outside the build with WinLibs binutils 2.46:windres -O coff -I "<dir with a space>" libcurl.rc out.objfails the same way with-I,--include-dir=,--preprocessor-arg=-I...and--use-temp-file; a-Dvalue or a source path with a space is accepted, and the same command without-Isucceeds.libcurl.rcincludes only<winver.h>and"../include/curl/curlver.h", which resolves relative to the file, so it needs no include directory. On MinGW the curl backend now gets a resource rule without<INCLUDES>, throughCMAKE_PROJECT_INCLUDEof theExternalProject. Nothing changes for Linux or macOS, and the 3rdparty/curl submodule is untouched.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7 (
x86_64-ucrt-posix-seh, binutils 2.46), CMake 4.3.1, Ninja, Release,BUILD_TESTING=ON, checkout under a path with a space.maina20547ffb7:cmake --build buildstops atlibcurl.rc.objwith the error above, once per include directory.main32a2f1e1d7: withlibcurl.rc.objandlibcurl.adeleted,cmake --build build --target libcurlrebuilds the backend (Building RC object lib/CMakeFiles/libcurl.dir/libcurl.rc.objsucceeds), andctest --test-dir build -R "^guest_curl"passes 10 of 10.cmake --build build) completes with this change merged with fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899, which fixes an unrelatedsetenvcompile error on Windows.python3 tools/check_conventions.py --base origin/mainpasses;python3 tools/pr_overlap.py --branchreports no conflicting open pull request (feat(libcurl): implement curl_m[v]fprintf and curl_m[v]printf #18468 could not be compared automatically; it changes theadd_libraryand test-topic lines, not these).Not tested: MSYS2 UCRT64, and a checkout path without a space on this change (the rule no longer depends on the path).
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code