qt6: fix "file name too long" error in gn tool

Fixes #5456
This commit is contained in:
Christian Prochaska 2025-02-18 14:44:21 +01:00 committed by Christian Helmuth
parent 13eef6a87a
commit c9406c246e
3 changed files with 28 additions and 1 deletions

View File

@ -1 +1 @@
1a0072de9fae10738f0d32d367ffff063e6cdc7b
802b7ca16c8e96911c1a190e99f949e07abbb047

View File

@ -6,3 +6,6 @@ DOWNLOADS := qt6.archive
URL(qt6) := https://download.qt.io/archive/qt/6.6/6.6.2/single/qt-everywhere-src-6.6.2.tar.xz
SHA(qt6) := 3c1e42b3073ade1f7adbf06863c01e2c59521b7cc2349df2f74ecd7ebfcb922d
DIR(qt6) := src/lib/qt6
PATCHES := src/qt6/host/patches/qtwebengine_qtbug59769.patch
PATCH_OPT := -p1 -d src/lib/qt6

View File

@ -0,0 +1,24 @@
qtwebengine_qtbug59769.patch
https://bugreports.qt.io/browse/QTBUG-59769
diff --git a/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
index 6e1d2abf1d..c1d879bd2c 100644
--- a/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
+++ b/qtwebengine/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc
@@ -124,7 +124,15 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() {
// each invocation of the rule gets a different response file. This isn't
// strictly necessary for regular one-shot actions, but it's easier to
// just always define unique_name.
+
+ // filename too long issue.
std::string rspfile = custom_rule_name;
+
+ std::hash<std::string> hash_fn;
+ size_t hash_id = hash_fn(rspfile);
+
+ rspfile = std::to_string(hash_id);
+
if (!target_->sources().empty())
rspfile += ".$unique_name";
rspfile += ".rsp";