Skip to content

Long git directory name causes error C1083 when building coreclr tests (cl.exe) #110407

Open
@steveharter

Description

@steveharter

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions