Marlin 2.0 bugfix branch won’t build on Windows? – It’s not your fault!

Today we're gonna talk about why Marlin 2.0 bugfix won't build on Windows.

Hello, my name is Daniel, welcome to the CrossLink channel. Our mission is to help 1 million people getting more successful with 3d printing and if you're here for the first time, subscribe and enable bell notifications so you don't miss anything.

So let's talk firmware. In a lot of my videos, I mentioned how to prepare and setup your Windows Computer to be ready to build Marlin 2.0 firmware.

And this is still working for most part, to be more precise, including the release of Marlin, Marlin firmware still builds on Windows.

BUT - there will be situations, where you need to switch to the latest and greatest code and that is to be found in the bugfix branch of Marlin 2.0.

If you ask for help on github, making a bug report or asking anyone on the Marlin discord channel, the first question about you having an issue with the firmware will be - did you try the bugfix branch? Maybe it's fixed there already.

So anyone with higher expectations towards his beloved 3D printer - like me - will run into this situation sooner or later.

So here we are, trying to build the latest Marlin 2.0 bugfix version on Windows with PlatformIO and - we're running into a problem.

At the very end of the build process there is an error saying "avr-g++: error: CreateProcess: No such file or directory"

And this is totally reproduceable on different Windows machines. And it is also reproduceable with the Arduino IDE, so using this is not an escape hatch unfortunately.

But the reason is not in the firmware, it's a limitation of Windows that we're seeing here.

It's not obvious to understand but Windows cannot handle the length of a command that the build process is trying to execute.

Look at that command, that is really really long. 36613 characters to be precise.

I've spent several hours of research and there is several misleading hints how this should be fixable.

It has nothing to do with a path length limitation - THAT can be changed with a windows setting - but it doesn't solve the issue because it is a completely unrelated problem.

This has to do with the fact that Windows cannot handle commands longer than - drumroll - 32768 characters.

And this cannot be changed. Only Microsoft could fix this.

So this issue is not going to be resolved anytime soon, that is my expectation.

Every time a new feature in Marlin firmware is added and a new file needs to be baked into the final firmware binary, this command is going to get even longer.

That means, everyone who wants to build Marlin 2.0 bugfix and probably any future release version will have to find another way to build it if he has a Windows computer.

When I brought up this topic on the Marlin discord, one answer I got was:

"...most who are wanting to upgrade firmware are technical people and don't use windows!"

I'll let this stand for it's own. I guess, we cannot expect large support from that end - but really, it's an open source project, there is no obligation on anyone to fix this.

So what are the possible solutions?

You could do it on a Mac - if you have one.

Or you could use a virtual machine on Windows running Linux.

Or you could probably use the Linux Subsystem on Windows - I will have to test that.

Or if you have an older PC where you can install Linux, that's also a valid option.

So there are many escape hatches - some of them might induce new problems like not being able to flash firmware over USB from a virtual machine for example. It's getting really complicated to be honest.

So - because of all this mess, I will do a few more videos covering those options.

One of them is already available - how to build Marlin on a Mac - and the rest will follow over time depending on the outcomes.

I am also working on a secret project that will make this whole process much easier for everyone - but I am not ready to talk about it yet. Probably in a few weeks.

Thanks for watching - I've also linked two other interesting videos here in these cards. See you next time! Bye!

Liked it? Take a second to support Daniel Kreuzhofer on Patreon!
Scroll Up