summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Alberto Lopez Perez <clopez@igalia.com>2024-07-31 09:57:42 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-05 14:31:57 +0100
commite6c6abf2e01c228919287c3764b9ae53ece168e5 (patch)
treea6751c6d5141071b6ee3545f6457c073a35516db
parent33c27974f33f0731b8c97957e2fe227cb358dd18 (diff)
downloadpoky-e6c6abf2e01c228919287c3764b9ae53ece168e5.tar.gz
icu: Backport patch to fix build issues with long paths (>512 chars)
There is a bug libicu that causes libicu to be installed incorrectly when the build system uses long paths (more than 512 chars). This condition is not very difficult to trigger on a OE build system due to the long paths an the deep of the directories that are usually generated by default. Also the bug is very subtle and won't be detected by the QA post-install processes because what this bug causes is that a different version of libicudata.so.X.Y (one without data) is installed instead of the one containing the data, but there won't be any file missed on the installation (just that it installed the wrong one). See: https://unicode-org.atlassian.net/browse/ICU-22813 This patch backports the fix from upstream/main (From OE-Core rev: 67d1352873957decacde30ff208fb7bb635b0c5d) Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch72
-rw-r--r--meta/recipes-support/icu/icu_75-1.bb1
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch b/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch
new file mode 100644
index 0000000000..5b97350e6f
--- /dev/null
+++ b/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch
@@ -0,0 +1,72 @@
1From db70adaddcfa8050db6a69cdfef080a7f1423ad7 Mon Sep 17 00:00:00 2001
2From: Carlos Alberto Lopez Perez <clopez@igalia.com>
3Date: Mon, 1 Jul 2024 22:15:18 +0100
4Subject: [PATCH] ICU-22813 Rise the size of the buffers used for the command
5 strings at pkgdata
6
7The tool pkgdata uses snprintf() to build the strings of the commands that
8will execute later during the install process. But the maximum size of this
9buffers is not enough when there is a long path.
10
11This has caused issues on some CI systems that use very long paths, causing
12the install process to produce a wrong result.
13
14The maximum path on Linux is 4096 (defined as PATH_MAX at <linux/limits.h>)
15So the size of SMALL_BUFFER_MAX_SIZE should be 4096 to avoid errors related
16to truncated paths.
17
18Upstream-Status: Backport [https://github.com/unicode-org/icu/pull/3058]
19
20Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
21---
22 tools/pkgdata/pkgdata.cpp | 6 +++---
23 tools/toolutil/pkg_genc.h | 5 ++---
24 2 files changed, 5 insertions(+), 6 deletions(-)
25
26diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
27index c2ac112..8d08c85 100644
28--- a/tools/pkgdata/pkgdata.cpp
29+++ b/tools/pkgdata/pkgdata.cpp
30@@ -1134,7 +1134,7 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling)
31
32 static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
33 int32_t result = 0;
34- char cmd[SMALL_BUFFER_MAX_SIZE];
35+ char cmd[LARGE_BUFFER_MAX_SIZE];
36
37 auto ret = snprintf(cmd,
38 sizeof(cmd),
39@@ -1205,7 +1205,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
40
41 static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
42 int32_t result = 0;
43- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
44+ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
45
46 if (!T_FileStream_file_exists(installDir)) {
47 UErrorCode status = U_ZERO_ERROR;
48@@ -1237,7 +1237,7 @@ static int32_t pkg_installCommonMode(const char *installDir, const char *fileNam
49 #endif
50 static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
51 int32_t result = 0;
52- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
53+ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
54
55 if (!T_FileStream_file_exists(installDir)) {
56 UErrorCode status = U_ZERO_ERROR;
57diff --git a/tools/toolutil/pkg_genc.h b/tools/toolutil/pkg_genc.h
58index 2dd1b45..f811fe5 100644
59--- a/tools/toolutil/pkg_genc.h
60+++ b/tools/toolutil/pkg_genc.h
61@@ -59,9 +59,8 @@
62 #define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING
63 #endif
64
65-#define LARGE_BUFFER_MAX_SIZE 2048
66-#define SMALL_BUFFER_MAX_SIZE 512
67-#define SMALL_BUFFER_FLAG_NAMES 32
68+#define LARGE_BUFFER_MAX_SIZE 16384
69+#define SMALL_BUFFER_MAX_SIZE 4096
70 #define BUFFER_PADDING_SIZE 20
71
72 /** End platform defines **/
diff --git a/meta/recipes-support/icu/icu_75-1.bb b/meta/recipes-support/icu/icu_75-1.bb
index 88103e4eca..8f7f5e6cc7 100644
--- a/meta/recipes-support/icu/icu_75-1.bb
+++ b/meta/recipes-support/icu/icu_75-1.bb
@@ -120,6 +120,7 @@ SRC_URI = "${BASE_SRC_URI};name=code \
120 file://filter.json \ 120 file://filter.json \
121 file://fix-install-manx.patch \ 121 file://fix-install-manx.patch \
122 file://0001-icu-Added-armeb-support.patch \ 122 file://0001-icu-Added-armeb-support.patch \
123 file://ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch \
123 " 124 "
124 125
125SRC_URI:append:class-target = "\ 126SRC_URI:append:class-target = "\