Long git directory name causes error C1083 when building coreclr tests (cl.exe)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cmake, cpp
- Domain
- build-system, operating-systems, testing
Research direction
Reproduce the Windows x64 failure with a long checkout path using src\tests\build.cmd /p:LibrariesConfiguration=Debug, then inspect the generated CMake/Ninja command for the ForeignThreadRevPInvokeUnhandled test. The work is done when the coreclr tests build successfully from the reported path without the cl.exe C1083 error.
Written by the indexing model from the issue text.
Description
Having a long directory name causes issues when building the coreclr tests. I verified that long paths are enabled in both git and the registry.
Repro (Windows x64)
- Create a long directory name such as
C:\git\ThisIsSomewhatOfaLongName - Clone runtime repo into that
build -s clr+libs(this works)src\tests\build.cmd /p:LibrariesConfiguration=Debug(this fails with the error below)
Error:
[219/384] Building CXX object baseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\CMakeFiles\ForeignThreadRevPInvokeUnhandledNative.dir\ForeignThreadRevPInvokeUnhandledNative.cpp.obj
FAILED: baseservices/exceptions/UnhandledExceptionHandler/ForeignThreadRevPInvokeUnhandled/CMakeFiles/ForeignThreadRevPInvokeUnhandledNative.dir/ForeignThreadRevPInvokeUnhandledNative.cpp.obj
C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1443~1.346\bin\Hostx64\x64\cl.exe /nologo /TP -DForeignThreadRevPInvokeUnhandledNative_EXPORTS -DHOST_64BIT -DHOST_AMD64 -DHOST_WINDOWS -DNDEBUG -DTARGET_64BIT -DTARGET_AMD64 -DTARGET_WINDOWS -DURTBLDENV_FRIENDLY=Retail -DWINDOWS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -IC:\git\ThisIsSomewhatOfaLongName\src\native -IC:\git\ThisIsSomewhatOfaLongName\src\tests\Common\Platform /DWIN32 /D_WINDOWS /GR- /O2 /Ob2 /DNDEBUG -MT /GL /Ox /EHa /nologo /W4 /WX /Oi /Oy- /Gm- /Zp8 /Gy /GS /fp:precise /FC /MP /Zm200 /Zc:strictStrings /Zc:wchar_t /Zc:inline /Zc:forScope /wd4065 /wd4100 /wd4127 /wd4131 /wd4189 /wd4200 /wd4201 /wd4206 /wd4239 /wd4245 /wd4291 /wd4310 /wd4324 /wd4366 /wd4456 /wd4457 /wd4458 /wd4459 /wd4463 /wd4505 /wd4702 /wd4706 /wd4733 /wd4815 /wd4838 /wd4918 /wd4960 /wd4961 /wd5105 /wd5205 /we4007 /we4013 /we4102 /we4551 /we4640 /we4806 /we4055 /we4146 /we4242 /we4244 /we4267 /we4302 /we4308 /we4509 /we4510 /we4532 /we4533 /we4610 /we4611 /we4700 /we4701 /we4703 /we4789 /we4995 /we4996 /w34092 /w34121 /w34125 /w34130 /w34132 /w34212 /w34530 /w35038 /w44177 /Zi /ZH:SHA_256 /source-charset:utf-8 /guard:cf /guard:ehcont -wd4100 -wd4242 -wd4244 -wd4514 -wd4625 -wd4626 -wd4668 -wd4710 -wd4711 -wd4774 -wd4820 -wd5025 -wd5026 -wd5027 -wd5039 /showIncludes /Fobaseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\CMakeFiles\ForeignThreadRevPInvokeUnhandledNative.dir\ForeignThreadRevPInvokeUnhandledNative.cpp.obj /Fdbaseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\CMakeFiles\ForeignThreadRevPInvokeUnhandledNative.dir\ /FS -c C:\git\ThisIsSomewhatOfaLongName\src\tests\baseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\ForeignThreadRevPInvokeUnhandledNative.cpp
C:\git\ThisIsSomewhatOfaLongName\src\tests\baseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\ForeignThreadRevPInvokeUnhandledNative.cpp : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
[240/384] Building CXX object profiler\native\CMakeFiles\Profiler.dir\rejitprofiler\rejitprofiler.cpp.obj
ninja: build stopped: subcommand failed.
BUILDTEST: Error: native test build failed.
I did not attempt to diagnose the root cause but note that the path C:\git\ThisIsSomewhatOfaLongName\src\tests\baseservices\exceptions\UnhandledExceptionHandler\ForeignThreadRevPInvokeUnhandled\ForeignThreadRevPInvokeUnhandledNative.cpp is 169 characters, short of MAX_PATH (260).
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·