From 83f43f57ac79fa673fda08805e29763a8303d5ea Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 28 Sep 2017 12:56:02 +0200 Subject: Lower the default response file threshold a bit on Windows It has been observed that values somewhat below 32000 can cause issues as well, so use a "safety offset". Task-number: QBS-1201 Change-Id: Ic82a4b4a9d770d8d92b955d1e70194de5baeae1b Reviewed-by: Jake Petroules --- src/lib/corelib/buildgraph/rulecommands.cpp | 10 +++++++++- src/lib/corelib/buildgraph/rulecommands.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/corelib/buildgraph/rulecommands.cpp b/src/lib/corelib/buildgraph/rulecommands.cpp index 6419d4e58..0044bdd5c 100644 --- a/src/lib/corelib/buildgraph/rulecommands.cpp +++ b/src/lib/corelib/buildgraph/rulecommands.cpp @@ -202,11 +202,19 @@ void ProcessCommand::setupForJavaScript(QScriptValue targetObject) ProcessCommand::ProcessCommand() : m_maxExitCode(0) - , m_responseFileThreshold(HostOsInfo::isWindowsHost() ? 32000 : -1) + , m_responseFileThreshold(defaultResponseFileThreshold()) , m_responseFileArgumentIndex(0) { } +int ProcessCommand::defaultResponseFileThreshold() const +{ + // TODO: Non-Windows platforms likely have their own limits. Investigate. + return HostOsInfo::isWindowsHost() + ? 31000 // 32000 minus "safety offset" + : -1; +} + void ProcessCommand::getEnvironmentFromList(const QStringList &envList) { m_environment.clear(); diff --git a/src/lib/corelib/buildgraph/rulecommands.h b/src/lib/corelib/buildgraph/rulecommands.h index 4e0d88056..57d73a623 100644 --- a/src/lib/corelib/buildgraph/rulecommands.h +++ b/src/lib/corelib/buildgraph/rulecommands.h @@ -129,6 +129,8 @@ public: private: ProcessCommand(); + int defaultResponseFileThreshold() const; + void load(PersistentPool &pool); void store(PersistentPool &pool) const; -- cgit v1.2.3