Open BalancedTernary opened 6 months ago
As far as I remember, this issue is caused by path to the file being too long. @SuGlider @lucasssvaz do you remember if there was any fix for Windows or reason that max path length to be different for some reason?
@BalancedTernary what is the file system of the C drive?
As far as I remember, this issue is caused by path to the file being too long. @SuGlider @lucasssvaz do you remember if there was any fix for Windows or reason that max path length to be different for some reason?
@BalancedTernary what is the file system of the C drive?
The file system of my c drive is NTFS.
It makes no difference which Filesystem is used. The max. len for a cmd is 8191 bytes when using Windows.
@Jason2866 it's not command length, but path length, which was something like 256, but was often found to be a bit less. We already had that issue with RV toolchain and 3.0.0, where we had to rename the package in order to save some bytes for longer usernames.
@Jason2866 it's not command length, but path length, which was something like 256, but was often found to be a bit less. We already had that issue with RV toolchain and 3.0.0, where we had to rename the package in order to save some bytes for longer usernames.
I don't know if this information will be useful: I looked for the "c++allocator.h" file in the "/bits" directory, and it was indeed not found. It looks like it includes a file that doesn't exist, or is in the wrong location.
@me-no-dev Oh, my. Didn't know the issue about Path length. CMD length is restricted as I wrote too. This "bites" in Platformio using Windows. https://github.com/platformio/platformio-core/pull/4856
Microsoft Infos: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
@me-no-dev I remember that this could happen if the path was too long or the extraction of the libraries failed somehow. I checked our talks regarding this and the path limit is 200 characters. It was fixed before in #8750.
@BalancedTernary I would recommend running the get script again to make sure everything was extracted properly.
How long is <UserName>
in the path?
This issue was solved in #8750, as @lucasssvaz mentioned.
I don't know if this information will be useful: I looked for the "c++allocator.h" file in the "/bits" directory, and it was indeed not found. It looks like it includes a file that doesn't exist, or is in the wrong location.
I've found this file in a few folders. The longest path seems to be (for Arduino Core 3.0.0-Alpha3)
C:\Users\UserName\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\xtensa-esp32s3-elf\esp32-psram\no-rtti\bits\c++allocator.h
My suggestion would be to reinstall the Arduino environment.
@BalancedTernary if you can not find the file anywhere in the toolchain folder, then because of that same issue, it was not even extracted.
@me-no-dev I remember that this could happen if the path was too long or the extraction of the libraries failed somehow. I checked our talks regarding this and the path limit is 200 characters. It was fixed before in #8750.
@BalancedTernary I would recommend running the get script again to make sure everything was extracted properly.
I tried to reacquire and install the development library, but it didn't work.
How long is in the path? This issue was solved in #8750, as @lucasssvaz mentioned.
<UserName>
I don't know if this information will be useful: I looked for the "c++allocator.h" file in the "/bits" directory, and it was indeed not found. It looks like it includes a file that doesn't exist, or is in the wrong location.
I've found this file in a few folders. The longest path seems to be (for Arduino Core 3.0.0-Alpha3)
C:\Users\UserName\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\xtensa-esp32s3-elf\esp32-psram\no-rtti\bits\c++allocator.h
My suggestion would be to reinstall the Arduino environment.
My "UserName" has 23 English characters. I can also find this file in a similar directory, but gcc doesn't seem to find it from this directory.
@BalancedTernary if you can not find the file anywhere in the toolchain folder, then because of that same issue, it was not even extracted.
I can find these files under the toolchain folder, but they don't find the directory indicated in the error log. It actually exists in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\xtensa-esp32s3-elf\bits" , but gcc is found in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\bits"
It really seems like the combination of a 23 characters username and the long path is preventing Windows tools from being able to open the files.
The issue seems related to the number of characters from a PATH that Windows is able to deal in GCC tools.
A Not perfect solution could be trying to install the Arduino under a "short user name" and check if this makes it work.
I've found a Windows Microsoft discussion about a problem with path longer than 256 characters: https://developercommunity.visualstudio.com/t/compiler-cant-find-source-file-in-path/10221576
Another similar from GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974
It sounds like a general problem with Windows... Not sure what we could do to help it, beyond what has been done in #8750
A possible solution is depicted in https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
The currently only real solution is not to use Windows. Using a VM running Ubuntu and everything just works. To be clear this is a big bug in Windows, nowhere else!!
It really seems like the combination of a 23 characters username and the long path is preventing Windows tools from being able to open the files.
The issue seems related to the number of characters from a PATH that Windows is able to deal in GCC tools.
A Not perfect solution could be trying to install the Arduino under a "short username" and check if this makes it work.
I tried to use a short username, but the same error still occurred. I tried to copy all the files in "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\xtensa-esp32s3-elf\bits" to "AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\include\c++\8.4.0\bits", and now the problem is temporarily solved.
@BalancedTernary - Can you please check this Windows registry: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
It should be set as 1 (true). When it is '0', Windows will limit the path to 260 chars. Setting it to '1' will extend this limit to 32,767 chars.
Go to the command search text box at the TaskBar, run "regedit.exe" and browse the Registry directory up to
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Double click FileSystem
and check/change its value.
Board
ESP32S3 Dev Module
Device Description
ESP32S3 Dev Module
Hardware Configuration
not anything
Version
v2.0.14
IDE Name
Arduino(Multiple versions, including the latest version)
Operating System
Windows10
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
921600
Description
Any development board that involves ESP32 will compile incorrectly, while a development board that does not involve ESP32 can be successfully compiled
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide