From 34a860cfa6cc8353a7b6a2da517c991d0624cf80 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 30 Aug 2016 23:09:53 +0300 Subject: [PATCH] Limit max sources length for Win to 6000 chars --- platformio/builder/tools/piowinhooks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platformio/builder/tools/piowinhooks.py b/platformio/builder/tools/piowinhooks.py index 2b2dcf3e..c1b0895a 100644 --- a/platformio/builder/tools/piowinhooks.py +++ b/platformio/builder/tools/piowinhooks.py @@ -17,7 +17,9 @@ from os import makedirs from os.path import isdir, isfile, join from platform import system -MAX_SOURCES_LENGTH = 8000 # Windows CLI has limit with command length to 8192 +# Windows CLI has limit with command length to 8192 +# Leave 2000 chars for flags and other options +MAX_SOURCES_LENGTH = 6000 def long_sources_hook(env, sources): @@ -38,7 +40,7 @@ def long_sources_hook(env, sources): def long_incflags_hook(env, incflags): _incflags = env.subst(incflags).replace("\\", "/") - if len(_incflags) < MAX_SOURCES_LENGTH - 2000: + if len(_incflags) < MAX_SOURCES_LENGTH: return incflags # fix space in paths