-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(platform)[2.x]: Use iwithprefixbefore to shorten the command lines #10622
Conversation
The command line for the ESP32 compilers is very long, and it is causing problems with the Arduino IDE on Windows systems, which enforce a hard 32kB string limit. This patch uses the iprefix/iwithprefixbefore options to shorten the compiler command line by changing "-I{compiler.sdk.path}/include/aaa" "-I{compiler.sdk.path}/include/bbb" "-I{compiler.sdk.path}/include/ccc" ... to: -iprefix "{compiler.sdk.path}/include/" -iwithprefixbefore aaa -iwithprefixbefore bbb -iwithprefixbefore ccc ... Some targets have up to 200 paths so this can save A LOT of text. On a sample run this patch shortened a single compile command from 28777 bytes to 10728.
@pillo79 do you plan to move away from 2.x? |
@me-no-dev We definitely do, it's just that we need some careful pivot strategy instead of pushing a 3.x point blank to everyone. There's also a reported issue with the Nano and the recovery firmware we need to look into in more detail. We will have to allow using 2.x for a long time I guess, and this linked issue was reported several times in the past as well from users with long names, so I looked into a fix. I've pushed this in our branch as a blanket "sed", but I was about to ask if that was the proper fix for upstream (or if you still accept developments on the 2.x release at all 🙂). |
fix looks OK, we use the same trick for 3.x, though for different reasons. We no longer push anything to 2.x and IDF 4.4 is EOL, but we will accept fixes. I suggest you look into 3.1 as it comes with ZigBee, Thread and Matter (along with many fixes and refactoring of included classes and tools) |
I had initial reports that said it was working flawlessly, but one tester later reported issues such as the following:
The weird thing is that this file is there, in the same directory that contains the including file - which was obviously found. This was reproduced in a different PC... on a different file that gcc still "refuses" to find. We are investigating. |
Issue there is the length of the path on Windows. In newer versions we have renamed the packages with the toolchains to a very short ones in order to help the situation when users have longer usernames |
Wow, I did not notice at first there were two different limits at play! 🤦♂️ Since there's already a proper fix for this in 3.x and this repo is EOL'd, we'll keep this in our downstream for the time being. Again thanks for the help! |
Description of Change
The command line for the ESP32 compilers is very long, and it is causing problems with the Arduino IDE on Windows systems which enforce a hard 32kB string limit.
This PR uses the
-iprefix
/-iwithprefixbefore
options to shorten the compiler command line by changingto:
Some targets have up to 200 paths so this can save A LOT of text. On a sample run this patch shortened a single compile command from 28777 bytes to 10728.
Tests scenarios
Tested on Arduino IDE 2.3.3 on Windows 10 for the Arduino Nano ESP32 target (S3 based), with a username containing spaces and non-ASCII UTF-8 chars.
Related links
Related issue on the arduino-cli repo: arduino/arduino-cli#2716