CMake Long Path Error in Zephyr Twister on Windows Despite LongPathsEnabled and CMAKE_OBJECT_PATH_MAX Settings #93264
Unanswered
NamrataGagare-eaton
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background:
While running multiple examples using Twister in Zephyr, I encountered the following error for some test cases:
C:/blr_deps/zephyr-v3.6.0/zephyr/scripts/twister-out/nucleo_u575zi_q/utility/etl-containers-vector/examples.utility.etl_containers_vector/modules/stm32/stm32cube/CMakeFiles/..__modules__hal__stm32__stm32cube.dir/./
has 214 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
cannot be safely placed under this directory. The build may not work
correctly.
Experimentations done:
Set environment variable in PowerShell:
$env:CMAKE_OBJECT_PATH_MAX = "512"
Set system-wide environment variable (as Administrator):
setx CMAKE_OBJECT_PATH_MAX "512" /M
Enabled long path support in Windows Registry:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Verified with:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled"
Output confirms: LongPathsEnabled = 1
Added below in zephyr/CMakeLists.txt and project specific CMakelists.txt
if(WIN32)
set(CMAKE_OBJECT_PATH_MAX 512)
endif()
None of the above helped.
Support Required:
What configuration or workaround is required to resolve the long path error with CMake when using Twister on Windows?
Thanks in advance for your support!
Beta Was this translation helpful? Give feedback.
All reactions