From: Michael Olbrich Date: Tue, 7 Nov 2017 10:20:09 +0100 Subject: [PATCH] HACK: qtwebengine: workaround for too long file names Without this building fails with: ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_v8_bindings_modules_v8_generated_init_partial__XXX_path_to_the_bsp_platform_XX_build-target_qt-everywhere-opensource-src-5.9.2-build_qtwebengine_src_toolchain_target__rule.rsp): Unable to create file. File name too long Hack taken from the upstream bugreport: https://bugreports.qt.io/browse/QTBUG-59769 Signed-off-by: Michael Olbrich Signed-off-by: Philipp Zabel --- .../src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qtwebengine/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc b/qtwebengine/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc index 7e945c0de0ed..cd98df3c5657 100644 --- a/qtwebengine/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +++ b/qtwebengine/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc @@ -118,9 +118,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { // strictly necessary for regular one-shot actions, but it's easier to // just always define unique_name. std::string rspfile = custom_rule_name; + + //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end + //please note ".$unique_name" is not used at the moment + int pos = 0; + std::string delimiter("_"); + while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) + rspfile = rspfile.substr(0,pos); + if (!target_->sources().empty()) rspfile += ".$unique_name"; rspfile += ".rsp"; + out_ << " rspfile = " << rspfile << std::endl; // Response file contents.