summaryrefslogtreecommitdiffstats
path: root/patches/qt-everywhere-src-5.12.2/0106-HACK-qtwebengine-workaround-for-too-long-file-names.patch
blob: bef3dfc2f62dfcca0751b8bf599f95b86037169b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Michael Olbrich <m.olbrich@pengutronix.de>
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 <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 .../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.