nRF Connect SDK v3.4.0 - Windows 11 - Fails to compile builds with error CMAKE_BINARY_DIR length (109) exceeds 90 characters

Hello,

Under Windows 11 Pro, nRF Connect SDK v3.4.0 fails to compile builds with error "CMAKE_BINARY_DIR length (109) exceeds 90 characters."

The same build on Windows 11 Pro & NCS v3.3.3 (and previous releases) builds successfully. Also, the same source builds successfully under macOS Sequoia.

I'm not sure why the errors occurs, as Windows 11 MAX_PATH  length is 260 characters.

Appreciate if someone in Support can assist. Thank you.



Kind Regards.

Parents Reply Children
  • Hi Amanda,

    Under Windows 11, I'm trying to use the shorter paths as possible with the project close to the "C" drive. However, I'm still seeing similar messages from "memfault-firmware-sdk".

    In the latest modified "Asset Tracker Template" for nrf9151dk build under Windows 11, as you can see "memfault-firmware-sdk" introduces a pretty long path that causes the warning message.

    Although in this case the flash to nRF9151DK works. However, as per the warning message, the build may not work properly.

    For NCS development under Windows 11, Is there any other recommendation that Nordic can provide that would resolve the issue, other than removing Memfault from the firmware?

    As mentioned before, this path issue does not exist on macOS. Our primary dev environment is macOS but have recently got some builds done under Windows 11.

    In reviewing several "CMAKE_OBJECT_PATH_MAX" issues on DevZone, it appears that under Windows 11, nRF Connect SDK development will be an issue for us. We cannot simply shorten the path for all out projects.

    Nordic should offer a resolution rather than a workaround. Thank you.

    Regards,
    Ravi

  • Hi Ravi-

    Unfortunately I don't have access to a Windows 11 computer for testing, but I see some workarounds, like increasing the limit with this powershell command (reference: https://stackoverflow.com/a/68353105):

    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
    -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

    Let us know if that helps- it seems like there are some other possible workarounds too, like enabling cmake "response files" to bypass shell limitations: https://stackoverflow.com/a/79507972

    Thanks,
    Noah

  • Hi Noah,

    Thank you for your workarounds. I've come across these before but they require Windows Registry changes. We're reluctant to make these for a workaround. I haven't come across them working properly. 

    What would be appropriate is a resolution that'll work for nRF Connect SDK development "out of the box" without any user changes to the Windows Registry.

    Fortunately, nearly all our NCS development is under macOS and the issue doesn't exist on macOS.

    If we are to use NCS under Windows 11, then the "CMAKE_OBJECT_PATH_MAX" issue is, unfortunately, a show stopper for us.


    Kind Regards,
    Ravi

Related