Closed Bug 1862601 Opened 1 year ago Closed 23 days ago

build failure using --system-icu and ICU 74.1

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: gaston, Unassigned)

References

Details

Attachments

(1 file)

building with --with-system-icu on OpenBSD, with a work-in-progress update to ICU 74.1, the build fails:

In file included from Unified_cpp_intl_lwbrk0.cpp:2: 
/usr/obj/ports/firefox-120.0beta5/firefox-120.0/intl/lwbrk/LineBreaker.cpp:453:3: error: static_assert failed due to requirement 'U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass)' "Gecko vs ICU LineBreak class mismatch"
static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.  

icu4c 74.1 has a different U_LB_COUNT than 73.2

/usr/local/include/unicode/uchar.h:    U_LB_COUNT = 43
/usr/obj/ports/icu4c-74_1-src/icu/source/common/unicode/uchar.h:    U_LB_COUNT = 48

maybe the array in https://searchfox.org/mozilla-central/source/intl/lwbrk/LineBreaker.cpp#408 should be updated ?

Yes, sUnicodeLineBreakToClass needs to be updated for ICU 74 (bug 1859752). The try-push for the ICU 74 release candidate has this patch:

--- a/intl/lwbrk/LineBreaker.cpp
+++ b/intl/lwbrk/LineBreaker.cpp
@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
       /* JT = 34,                           [JT] */ CLASS_CHARACTER,
       /* JV = 35,                           [JV] */ CLASS_CHARACTER,
       /* CLOSE_PARENTHESIS = 36,            [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
       /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
       /* HEBREW_LETTER = 38,                [HL] */ CLASS_CHARACTER,
       /* REGIONAL_INDICATOR = 39,           [RI] */ CLASS_CHARACTER,
       /* E_BASE = 40,                       [EB] */ CLASS_BREAKABLE,
       /* E_MODIFIER = 41,                   [EM] */ CLASS_CHARACTER,
-      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER};
+      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER,
+      /* AKSARA = 43,                       [AK] */ CLASS_CHARACTER,
+      /* AKSARA_PREBASE = 44,               [AP] */ CLASS_CHARACTER,
+      /* AKSARA_START = 45,                 [AS] */ CLASS_CHARACTER,
+      /* VIRAMA_FINAL = 46,                 [VF] */ CLASS_CHARACTER,
+      /* VIRAMA = 47,                       [VI] */ CLASS_CHARACTER,
+  };
 
   static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
                 "Gecko vs ICU LineBreak class mismatch");
 
   auto cls = GetLineBreakClass(u);
   MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
 
   // Overrides based on rules for the different line-break values given in
Depends on: 1859752

(In reply to André Bargull [:anba] from comment #3)

Yes, sUnicodeLineBreakToClass needs to be updated for ICU 74 (bug 1859752). The try-push for the ICU 74 release candidate has this patch:

--- a/intl/lwbrk/LineBreaker.cpp
+++ b/intl/lwbrk/LineBreaker.cpp
@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
       /* JT = 34,                           [JT] */ CLASS_CHARACTER,
       /* JV = 35,                           [JV] */ CLASS_CHARACTER,
       /* CLOSE_PARENTHESIS = 36,            [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
       /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
       /* HEBREW_LETTER = 38,                [HL] */ CLASS_CHARACTER,
       /* REGIONAL_INDICATOR = 39,           [RI] */ CLASS_CHARACTER,
       /* E_BASE = 40,                       [EB] */ CLASS_BREAKABLE,
       /* E_MODIFIER = 41,                   [EM] */ CLASS_CHARACTER,
-      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER};
+      /* ZWJ = 42,                          [ZWJ]*/ CLASS_CHARACTER,
+      /* AKSARA = 43,                       [AK] */ CLASS_CHARACTER,
+      /* AKSARA_PREBASE = 44,               [AP] */ CLASS_CHARACTER,
+      /* AKSARA_START = 45,                 [AS] */ CLASS_CHARACTER,
+      /* VIRAMA_FINAL = 46,                 [VF] */ CLASS_CHARACTER,
+      /* VIRAMA = 47,                       [VI] */ CLASS_CHARACTER,
+  };
 
   static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
                 "Gecko vs ICU LineBreak class mismatch");
 
   auto cls = GetLineBreakClass(u);
   MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
 
   // Overrides based on rules for the different line-break values given in

thanks, i had more or less the same wip patch locally, will confirm if it fixes the build and if runtime is still ok.

runtime seems ok using 120.0b5 with https://hg.mozilla.org/try/rev/d5f3b0c4f08a426ce00a153c04e177eecb6820e2 applied and built against systemwide icu 74.1.

The severity field is not set for this bug.
:m_kato, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(m_kato)
Severity: -- → S3
Flags: needinfo?(m_kato)
Priority: -- → P3

the 115esr branch is also affected

See Also: → 1864745

With the patch build works with unified build, but with --disable-unified-build the build fails to:

intl/components/src/TimeZone.cpp:345:3: error: use of undeclared identifier 'MOZ_TRY'

Full build log attached as compressed.

With the patch --disable-unified-build is broken, but a unified build works fine. I get:

Duplicate of this bug: 1905055
No longer depends on: 1859752
Depends on: 1927706

:gaston, could you still reproduce this?

Flags: needinfo?(landry)

you're right, it seems i can build m-c fine without patches against systemwide icu 76.1 here; i'm still carrying a patch (https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/www/mozilla-firefox/patches/patch-intl_lwbrk_LineBreaker_cpp?rev=1.2&content-type=text/x-cvsweb-markup) in our ports for that issue, i'll recheck if it's still needed for release/beta.

Flags: needinfo?(landry)

mmm, i'll have to triplecheck, because building 133.0b4 without the above patch fails:

/usr/obj/ports/firefox-133.0beta4/firefox-133.0/intl/lwbrk/LineBreaker.cpp:455:3: error: static assertion failed due to requirement 'U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass)': Gecko vs ICU LineBreak class mismatch
        static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass)
/usr/obj/ports/firefox-133.0beta4/firefox-133.0/intl/lwbrk/LineBreaker.cpp:455:28: note: expression evaluates to '48 == 43'
        static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass)
1 error generated.                

bah, sorry, hadn't realised that m-c had been updated to icu 76 in bug 1927706, which probably explains why m-c builds with system-icu unpatched, and why 133/beta still fails :) i guess we can close this one..

Status: NEW → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: