ESP compilation errors due to MAX_PATH limit

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.
Post Reply
Steve-Matrix
Matrix Staff
Posts: 1253
http://meble-kuchenne.info.pl
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

ESP compilation errors due to MAX_PATH limit

Post by Steve-Matrix »

TL;DR - If you run into compilation issues with the ESP32 toolchain then try moving your Flowcode project to something like "C:\MyProj\" and trying again.

This morning I hit an issue where my ESP32 projects were failing to compile, even though they were compiling fine a week ago. The error was something like this:

Code: Select all

LONG_PATH....curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.c.obj.d: error opening file
The problem was caused by the path to this file being longer that the MAX_PATH setting in Windows (which is 260 characters) and so that file was not being created during compilation. I had moved my projects to a different folder, which increased the path length of these created files.

After some research I found a Windows registry setting that enables longer paths in this Microsoft article. However, I found this setting was already enabled in my registry. Further research showed that others were still having this problem even with this setting enabled.

I checked within Windows Explorer and this would not let me create files beyond this 260 path limit. Oddly, I could create files in long paths from a command prompt and even view them in Windows Explorer. So it seems like Windows Explorer has only partial support for this setting.

And I assume some part of the ESP32 toolchain also lacks support for long paths on Windows systems.

The workaround is to move the Flowcode project to a shorter folder name closer to the root of the drive and then compilation was successful.

Of course, there could be other reasons for a compilation failure. But it might be worth this quick test to ensure it is not caused by a long path issue.

Post Reply