The filename or extension is too long.

I keep getting this issue,

fork/exec C:\Users\fylit\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc.exe: The filename or extension is too long.

I have tried the suggested change to arduino-builder.exe but that does not help. how can I move that Arduino15 folder somewhere else? I can't find a place to rewrite the path.

Edit: Now I am really confused. I tried a fresh install and adding the arduino-builder.exe and the hardware and tools folders that I got from a forums post for this issue and now I got the error again but the path is way shorter.

fork/exec C:\Arduino\hardware\tools\avr/bin/avr-gcc.exe: The filename or extension is too long.

how is that path too long? I am trying to update my marlin firmware, never had a problem until I upgraded the Arduino IDE to 1.8.13

My understanding is that this problem comes from the huge number of files in Marlin causing the command to be over the 32k character limit imposed by Windows. So the filename is not too long. It's the arguments in the command that are too long. I don't know why the error message says that.

Arduino is very aware of this problem and has been working on a fix. This fix is already completed in the nightly build of Arduino CLI. Arduino CLI is replacing arduino-builder (actually a lot of the arduino-builder code base is already coming from Arduino CLI), so a fix made in Arduino CLI will eventually propagate into all the other official Arduino development software, including an Arduino IDE. I don't know how how long that will be though.

So my recommendation is for you to use the nightly build of Arduino CLI to comp[ile and upload Marlin to your 3D printer. You can download it from the link provided here:
https://arduino.github.io/arduino-cli/latest/installation/#nightly-builds

And instructions for usage here:
https://arduino.github.io/arduino-cli/latest/getting-started/

Please let me know if you have any questions.

Thanks, I'll give that a try.

the only question now, in the instructions you gave me, for uploading to my board....

To upload the sketch to your board, run the following command, using the serial port your board is connected to:
Copied to clipboard

$ arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:samd:mkr1000 MyFirstSketch

where do I put com4? does it go where -p /dev/ttyAMC0 ?
thank you for putting up with my questions.

To upload the sketch to your board, run the following command, using the serial port your board is
where do I put com4? does it go where -p /dev/ttyAMC0 ?

Exactly. That "/dev/ttyAMC0" is a Linux/macOS port name but the -p flag can take COMn port names as well when the tool is used on a Windows system.

Thank you so much!

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per