Compare commits

...
Author SHA1 Message Date
Clifford Yapp f60c70ad33 Reverting 6fa113eaa8 - causes compile error on Linux w/ gcc 13.2.0-23ubuntu4
Was causing the following error:

include/unicode/localpointer.h:561:26: error: ‘auto’ parameter not permitted in this context
  561 | template <typename Type, auto closeFunction>
2024-06-24 20:47:32 -04:00
Clifford Yapp 8b24235043 Merge tag 'release-75-1' into RELEASE 2024-06-24 20:23:40 -04:00
DraganBesevic 7750081bda ICU-22535 Integrate CLDR 45 release beta5 2024-04-15 17:55:43 -07:00
Markus Scherer 0379e638a9 ICU-22520 doc: uloc_getName() & others may fail
for example with a U_ILLEGAL_ARGUMENT_ERROR since PR #2813
in some cases where the implementation may have
returned with a misleading U_BUFFER_OVERFLOW_ERROR
2024-04-15 15:59:57 -07:00
Fredrik Roubert d8ee6843b9 ICU-22726 Add new CLDR 45 currency code XCG also to gCurrencyList. 2024-04-15 15:56:45 -07:00
Rahul Pandey 530e9a509f ICU-22535 BRS_75_GA: Update cldr-to-icu version to 75.1 2024-04-15 12:28:25 -07:00
Mihai Nita aebd5ba54b ICU-22533 Change API version annotation from 75.0 to 75 2024-04-15 11:17:15 -07:00
DraganBesevic 9518b26a91 ICU-22535 Integrate CLDR 45 release beta4, part 5, restore copyright headers in catalog.txt 2024-04-12 16:21:12 -07:00
DraganBesevic dcae3872f0 ICU-22535 Integrate CLDR 45 release beta4, part 4, build updates 2024-04-12 16:21:12 -07:00
DraganBesevic c27199ec9c ICU-22535 Integrate CLDR 45 release beta4, part 3, data updates 2024-04-12 16:21:12 -07:00
DraganBesevic 66c8c65857 ICU-22535 Integrate CLDR 45 release beta4, part 2, personName test data updates 2024-04-12 16:21:12 -07:00
DraganBesevic 97a046d116 ICU-22535 Integrate CLDR 45 release beta4, part 1, binary files 2024-04-12 16:21:12 -07:00
Rahul Pandey 2f7a3ea491 ICU-22535 BRS_75_GA: Update ICU version to 75.1 (no more -SNAPSHOT) 2024-04-12 09:36:09 -07:00
Elango Cheran a1bce0c096 ICU-22261 Refactor error handling for internal MF2 array-allocating functions 2024-04-12 09:22:15 -07:00
Fredrik Roubert 75eab42060 ICU-22261 Improved identification of the MSVC compiler and library.
It's not uncommon for code for Windows to use the _MSC_VER preprocessor
macro to identify that it's being compiled for Windows so it's also not
uncommon for compilers other than the real MSVC compiler to also set
this to be able to compile such code.

It's also not possible to use _MSC_VER to determine whether the C++
standard library implementation used is the Microsoft STL.

Clang will however refuse to instantiate a template with a forward
declared type, so the code that currently does this needs to be moved to
after the type has been properly defined, which in turn makes MSVC warn
that those templates aren't instantiated, so those warnings need to be
disabled, but then the disabling of warning C4661 doesn't work any
longer (for some unknown reason) but this can be resolved by properly
deleting the non-existent operators instead of disabling the warning.
2024-04-11 15:35:23 -07:00
Frank Tang 6d4cea57ed ICU-22727 fix addLikelySubtags for 5-8 chars lang codes
Fix C++ code, add tests for C, C++ and Java API
2024-04-11 12:31:36 -07:00
Tim Chevalier 9e1c66daf7 ICU-22261 Refactor MF2 attributes and options parsing code
Previously, there were separate overrides for the options and
attributes parsing methods in the parser that were used in different
context. (Options can appear in Operator and Markup, while attributes
can appear in Expression and Markup.)

This is a refactoring that eliminates this duplicated code.
To enable it, a builder is added for the internal OptionMap type.

Separately, this patch also explicitly deletes copy constructors
and copy assignment operators for all Builder classes; a bug in an
earlier version of this patch caused me to notice this hadn't been
done. Also explicitly deletes move constructors/assignment operators
with the exception of OptionMap::Builder (OptionMap is non-public,
so that shouldn't cause confusion).
2024-04-09 08:15:54 -07:00
Fredrik Roubert bae39adf67 ICU-22532 Resolve new / free() mismatch. 2024-04-08 22:04:00 +02:00
Tim Chevalier 4f0c2ca71c ICU-22261 Remove MF2 formatter caching optimization
The implementation was keeping a cache of FormatterFactory
    objects so that subsequent calls to the same formatter re-use the
    same object.
    The problem is that this is unsafe, because
    `MFFunctionRegistry::getFormatter()` returns a non-const `FormatterFactory*`;
    so if the caller deleted the resulting pointer, the formatter cache
    would contain a dangling pointer.
    
    This optimization was added because of an ICU4J test that checked for
    the presence of the optimization. However, for separate reasons
    (making `adoptFormatter()` actually adopt its argument), this test
    was already removed.
    
    The caching could be re-added later if that optimization is needed,
    but for now, remove it (also, no tests were checking for its presence).
2024-04-05 13:14:34 -07:00
yumaoka 43cde6bdbf ICU-22534 Updating pom version to 75.1-SNAPSHOT 2024-04-04 09:45:56 -07:00
DraganBesevic 9c466d43d9 ICU-22535 Integrate CLDR 45 release beta3 2024-04-04 08:49:37 -07:00
DraganBesevic fc91b6bb7f ICU-22535 Integrate CLDR 45 release beta2, part 2, data and source files 2024-04-02 13:29:34 -07:00
DraganBesevic 492a8441db ICU-22535 Integrate CLDR 45 release beta2, part 1, binary files 2024-04-02 13:29:34 -07:00
Craig 97335dfa7e ICU-22534 add mf2 to docmain.h 2024-03-28 17:18:48 -07:00
Craig 1ac14c4ea7 ICU-22534 ICU4C API change report update 2024-03-28 16:27:46 -07:00
Frank Tang b2539f44df ICU-22534 BRS75 Remove fixed logKnownIssue
CLDR17099 is fixed in CLDR44 and the test now passed. Remove
the logKnownIssue so it will test and report future breakage.
2024-03-28 16:11:34 -07:00
Frank Tang 0127e4f760 ICU-22534 BRS75 Remove fixed logKnownIssue for CLDR-17024
CLDR-17024 is fixed in CLDR45 and the test now passed.
Remove the logKnownIssue so it will test and report future breakage.
2024-03-28 16:11:27 -07:00
Tim Chevalier 070a1f420b ICU-22261 Add missing API tags for MessageFormat 2 methods/constants 2024-03-28 15:46:32 -07:00
Frank Tang d83d26cc5d ICU-9972 Fix Chinese/Dangi Calendar getActualMaximum(UCAL_DAY_OF_YEAR)
Also fix ICU-12620 which is mark duplicate of ICU-9972 just now.
and fix ICU-22258.

Separate the new year and winter solstice cache since the calculated
value for these two calendar are mostly but not always the same due
to slightly different observation timeZone.

Remove the epochYear and zoneAstroCalc from the member data
and instead return them from a getStting() method with the two caches
since all four of them are constant per subclass of ChineseCalendar
and do not need to be different per object.

The known issues in the TestLimit is caused by both Calendar get/put the
value from the same cache while the calculated result depends on the
timeZone zoneAstroCalc.
2024-03-28 11:02:21 -07:00
Victor Chang 9e6173fcef ICU-22536 Fix ICUServiceThreadTest flakiness
Sometimes getVisibleIDs() method returns a null reference which might happend
because of inaccurate concurrent access. This change attempts to fix this
ICUServiceThreadTest flakiness.
2024-03-28 10:55:49 -07:00
Tim Chevalier aff1bbaa14 ICU-22261 Add UCONFIG_NO_MF2 flag that can be used to disable MessageFormat 2 functionality 2024-03-28 08:48:35 -07:00
Rich Gillam cce642a84f ICU-22534 Regenerate urename.h for the ICU 75 release candidate. 2024-03-28 08:39:08 -07:00
Tim Chevalier f7d641d5ad ICU-22261 Add tech preview implementation for MessageFormat 2.0 to icu4c 2024-03-27 17:04:07 -04:00
Fredrik Roubert 4b8f8f3c48 ICU-22628 Replace log_err() with log_knownIssue() for known failure. 2024-03-27 15:58:19 +01:00
Fredrik Roubert 86b07da451 ICU-22618 Make unisetperf/draft possible to compile. 2024-03-27 15:54:42 +01:00
rp9-next 4b6c85737a ICU-22693 Remove workaround in CI for ICU4C due to failures running ./configure 2024-03-27 12:43:27 +05:30
Rich Gillam d4bc9bef26 ICU-22611 Fixed failures in EnvTest. 2024-03-26 16:59:48 -07:00
Frank Tang 869cc60f3c ICU-22711 Set EnvTest frequency to nightly in March/April/Sept/Oct 2024-03-26 16:20:08 -07:00
Shane F. Carr 8a1df5a7f4 ICU-22692 Change SimpleNumber truncateAt to setMaximumIntegerDigits
Also promotes the remaining draft SimpleNumber functions to stable.

See #2892
2024-03-26 16:13:46 -07:00
yumaoka 57fc3094f9 ICU-22534 BRS75 J Serialization test data 2024-03-26 08:51:38 -04:00
yumaoka 6ad2ffb9db ICU-22534 BRS75 J API Signature file and API change report 2024-03-26 08:51:16 -04:00
yumaoka 4f75c62767 ICU-22534 BRS75 clean up import statements 2024-03-26 08:50:56 -04:00
Rahul Pandey 8ba19195f9 ICU-22534 Update version number to 75.1 2024-03-26 07:02:45 +05:30
Mihai Nita 141e820f71 ICU-22690 Update ICU4J MessageFormatter to the latest spec, LDML 45 2024-03-22 14:39:02 -07:00
Rich Gillam 13bf3c8313 ICU-22611 Fixed the RBNF MultiplierSubstitution to only perform floor() on the value being formatted when the
substitution is using a DecimalFormat and its owning rule also has a modulus substitution.  Took out a redundant
call to floor().  Added a hack to allow the caller to change the rounding behavior with setRoundingMode().
Added appropriate unit tests. Added additional documentation of the behavior to the API docs.
2024-03-22 11:18:27 -07:00
Elango Cheran 6eb43b1648 ICU-22533 Update badges for CI pipelines, user guide docs about CI 2024-03-22 12:18:47 +05:30
Fredrik Roubert 142850ae2c ICU-22691 Make sample code possible to compile with current ICU4C. 2024-03-21 23:19:54 +01:00
Fredrik Roubert dd7b0a9d6d ICU-22691 Update configure files from configure.ac using autoreconf. 2024-03-21 23:19:54 +01:00
Fredrik Roubert 2a6bc212d4 ICU-22691 Delete abandoned sample code. 2024-03-21 23:19:54 +01:00
Fredrik Roubert b3032aba0c ICU-22643 Verify that UCHAR_TYPE works for all public header files. 2024-03-21 23:18:53 +01:00
Frank Tang 37bdffb240 ICU-22679 Fix broken header test
See #2918
2024-03-21 15:12:10 -07:00
Frank Tang d259da8118 ICU-22700 Fix large POSIX charset name cause hang
Fix fuzzer found issue of hang that caused by long POSIX charset name.
Limit the POSIX charset name to at most 64 chars.
2024-03-21 11:33:52 -07:00
Frank Tang fbc1f33e7e ICU-22679 Clean up Calendar code.
1. Remove redudant implementation of default system ceuntry by using
   macro
2. Fold long if / else block if one block return.
2024-03-21 09:50:10 -07:00
dependabot[bot] 94305fc59b ICU-22532 Bump the github-actions group with 9 updates
See #2916
2024-03-21 09:45:50 -07:00
Fredrik Roubert 028fa70c29 ICU-22701 Bugfix: Make test independent of the default locale.
The original intention behind this test case was to use the root locale,
but ures_getFunctionalEquivalent() is implemented by calling ures_open()
which sets URES_OPEN_LOCALE_DEFAULT_ROOT which will cause the default
locale to be loaded before the root locale.

To avoid that, pick a locale other than the root locale for the test.
2024-03-21 09:16:05 -07:00
Fredrik Roubert e246d3b712 ICU-22643 Make UCHAR_TYPE work as intended with C++11, C11 & macOS.
Since ICU4C requires C++11 and C11 the char16_t data type can be used
everywhere, as long as the uchar.h header file gets included when
building as C (where it isn't a keyword as in C++), but this doesn't
work on macOS which for unknown reasons lacks the uchar.h header file
and therefore needs a workaround to define char16_t.
2024-03-21 15:44:20 +01:00
Fredrik Roubert 91721504ef ICU-22621 Clang-Tidy: modernize-return-braced-init-list
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/return-braced-init-list.html
2024-03-21 13:50:45 +01:00
Pedro Kaj Kjellerup Nacht 80a01a475b ICU-22482 Hash-pin GHA, add dependabot to keep them updated
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

Use latest version, uses a version >= 2.0.6 to overcome invalid key bug
2024-03-20 22:14:52 -07:00
Markus Scherer 5e95ed8294 ICU-22689 reminder for 16.0 update 2024-03-20 15:49:44 -07:00
Frank Tang 0b77215040 ICU-22698 Clean up CalendarAstronomer 2024-03-20 13:36:17 -07:00
Markus Scherer cce162bf4d ICU-11396 new properties Identifier_Status & Identifier_Type
See #2879
2024-03-20 13:20:14 -07:00
Elango Cheran 1be861209e ICU-22689 Add PPUCD-based data driven test for binary props
See #2889
2024-03-20 09:11:57 -07:00
Frank Tang 7a3dfe877d ICU-22679 Remove getType and string comparsion
Change the logic of handling year in era 0 counting backwards
to depend on a boolean virtual function instead of adding
string comparsion code in the base class to have specific knowledge of
behavior of subclass.
2024-03-19 17:44:37 -07:00
Frank Tang 6b67715a94 ICU-22633 Fix hang on large negative day in hebrew calendar
Check error status and return error early in the loop
2024-03-19 16:32:06 -07:00
Fredrik Roubert 7c22ff7541 ICU-22621 Clang-Tidy: readability-string-compare
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/string-compare.html
2024-03-19 15:55:56 +01:00
Fredrik Roubert ade671e252 ICU-22621 Clang-Tidy: readability-static-definition-in-anonymous-namespace
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/static-definition-in-anonymous-namespace.html
2024-03-19 15:55:56 +01:00
Fredrik Roubert 6ad78a08c7 ICU-22621 Clang-Tidy: readability-redundant-control-flow
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/redundant-control-flow.html
2024-03-19 15:55:56 +01:00
Fredrik Roubert e017edc97d ICU-22621 Clang-Tidy: readability-qualified-auto
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/qualified-auto.html
2024-03-19 15:55:56 +01:00
DraganBesevic 4f2cefb7ca ICU-22534 Integrate CLDR 45 release beta1 2024-03-18 20:49:00 -07:00
Frank Tang 606623cf30 ICU-22679 Refactor ChineseCalendar
See #2898
2024-03-18 18:51:27 -07:00
Markus Scherer 16b87419ed ICU-22612 remove obsolete comment 2024-03-18 17:13:53 -07:00
Rich Gillam 281d8ef140 ICU-22152 Uncommented a bunch of commented-out test cases in ULocaleCollationTest.TestNameList() and made them pass again. 2024-03-18 17:01:14 -07:00
Fredrik Roubert ce052f52c2 ICU-22621 Clang-Tidy: readability-delete-null-pointer
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/delete-null-pointer.html
2024-03-18 17:14:23 +01:00
Fredrik Roubert cbab919682 ICU-22621 Clang-Tidy: readability-container-size-empty
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/container-size-empty.html
2024-03-18 17:14:23 +01:00
Fredrik Roubert 2295478716 ICU-22621 Clang-Tidy: readability-const-return-type
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/readability/const-return-type.html
2024-03-18 17:14:23 +01:00
Younies Mahmoud 4405c543ad ICU-22686 Fix Unit preferences calculation in Cpp 2024-03-18 13:23:58 +01:00
Younies Mahmoud 80b33416e8 ICU-22686 Fix Unit preferences calculation in Java
See #2899
2024-03-18 13:23:37 +01:00
Frank Tang a1c5294ae7 ICU-22679 Remove duplicate code inside Islamic calendar 2024-03-15 16:25:52 -07:00
Frank Tang f709987818 ICU-22679 Refactor Islamic Calendar and Optmize starting condition of loop.
Refactor different rules into implementation of private interface Algorithm.
Since IslamicCalendar is public in Java (not in C++), we cannot put them into different subclass of Calendar and have to let them use the same class and object since the caller UNFORTUNALLY can call setCalculationType and setCivil to change the object to different rule. With this refactoring, we group the formula for the same rule into the same Algorithm
implementaiton and now we only do the if/switch check in the constructor or during the call of setCalculationType and setCivil only. The calculation operation is then just delegate the work to the assigned concrete Algorithm.

Improve the efficency while the month is very large. Apply the same optimization in PR 2853 which estimate starting point of year iteration based on an inverse calculation.

ICU-22679 change parameter name

ICU-22679 Use Consumer
2024-03-15 15:01:51 -07:00
Fredrik Roubert 5401c12018 ICU-22621 Clang-Tidy: modernize-use-nullptr
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-nullptr.html
2024-03-15 14:31:54 +01:00
Frank Tang de9910659d ICU-22661 Limit the size of variants in Locale
See #2821
2024-03-14 16:23:51 -07:00
Elango Cheran 104214aeae ICU-22532 Use previous Ubuntu version for ICU4C in GH Actions CI for now 2024-03-14 16:20:49 -07:00
Rich Gillam c771fc444f ICU-22523 Cut down the large tables in the APIs docs for SimpleDateFormat and included a link to the full table
in the LDML spec.
2024-03-14 14:32:29 -07:00
Rich Gillam 2b6ddc50fe ICU-22202 Fixed DateIntervalFormat to solve a couple "conflicting fields" errors. 2024-03-14 14:31:48 -07:00
DraganBesevic b396885aae ICU-22534 Integrate CLDR 45 release alpha 3, part 4, update supplementalData to rollback root changes 2024-03-14 08:30:09 -07:00
DraganBesevic 1b2d28b042 ICU-22534 Integrate CLDR 45 release alpha 3, part 3, source files 2024-03-14 08:30:09 -07:00
DraganBesevic fc18bcb05f ICU-22534 Integrate CLDR 45 release alpha 3, part 2, data files 2024-03-14 08:30:09 -07:00
DraganBesevic 0906aae169 ICU-22534 Integrate CLDR 45 release alpha 3, part 1, binary files 2024-03-14 08:30:09 -07:00
Frank Tang 9a912bb51b ICU-22633 Add more Calendar overflow tests
Test set+set, set+add, set+roll, add+add, roll+roll
Fix more int32_t overflow problems.

Optimize both Java and C++ Hebrew Calendar month/year advancement by first consider
every 235 months is 19 years before iteration.
2024-03-13 15:48:25 -07:00
Fredrik Roubert 2a1853c9a9 ICU-22621 Clang-Tidy: modernize-use-emplace
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-emplace.html
2024-03-13 16:31:47 +01:00
Fredrik Roubert 3000bfb67e ICU-22621 Clang-Tidy: modernize-make-unique
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/make-unique.html
2024-03-13 16:31:47 +01:00
Fredrik Roubert 1a4fc9b009 ICU-22621 Clang-Tidy: modernize-concat-nested-namespaces
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/concat-nested-namespaces.html
2024-03-13 16:31:47 +01:00
Rich Gillam 00072801a5 ICU-22687 Fix genren.pl not to skip C++ functions on Mac 2024-03-12 16:56:26 -07:00
Rich Gillam 1cedbbd90d ICU-22534 Fixed a couple issues from the API-promotions PR that Frank found in code review. 2024-03-12 16:47:57 -07:00
Frank Tang d43d216feb ICU-22633 Test and fix int32_t overflow for Calendar set
Add test to set with INT32_MAX and INT32_MIN then call getTime()
and fix all the undefined errors.
2024-03-12 16:46:53 -07:00
Elango Cheran 18c7d48b3e ICU-22533 Add docs on Continuous Integration
See #2876
2024-03-12 09:14:24 -07:00
Shuhei Iitsuka 37ecee3a0c ICU-22666 Update ML model to improve Japanese phrase breaking quality 2024-03-11 12:00:03 -07:00
Peter Edberg ceee4f0b46 ICU-22655 Implement "special" conversion for speed-beaufort, part 2 icu4c 2024-03-09 19:52:42 -08:00
Rich Gillam 4c664b2180 ICU-22534 Changed ExternalBreakEngine so that it's surrounded by U_HIDE_INTERNAL_API instead of U_HIDE_DRAFT_API. 2024-03-08 17:49:33 -08:00
Frank Tang 784056dfdb ICU-22633 Fix overflow in Chinese calendar
Fix issue found by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67256
2024-03-07 16:03:00 -08:00
Craig ebaf3e9f75 ICU-22534 BRS#19 Update ICU4C API Change Report (frontloading) 2024-03-07 14:37:06 -08:00
Fredrik Roubert 3a88e99a27 ICU-22520 Add a StringByteSink<CharString> template specialization.
This makes it possible to call public functions that take a string class
as a template parameter and return an object of that class (implemented
through the StringByteSink helper class) also with the CharString class,
even though this class doesn't actually provide the public API required
by StringByteSink.

This makes it possible to use such more modern APIs also internally.
2024-03-07 17:35:48 +01:00
Rahul Pandey a0cdb9cda5 ICU-22597 Add MSVC build bot to build ICU4C without exceptions
See #2829
2024-03-07 16:14:16 +01:00
Craig 89cf56333f ICU-22534 BRS#27 fix CI-Exhaustive-Main breakage for locale qaa 2024-03-07 13:47:49 +01:00
Frank Tang e0a711c0a4 ICU-22633 Fix Hebrew overflow issue 2024-03-06 14:52:19 -08:00
Fredrik Roubert c0c46988c5 ICU-22612 Update configure files from configure.ac using autoreconf. 2024-03-06 10:56:53 +01:00
Vincent Torri 3a6b1ef80e ICU-22612 usage of C++11 implies the existence of stdint.h, so remove useless checks
See #2860
2024-03-06 10:56:53 +01:00
Fredrik Roubert 53568e8dfc ICU-22520 Refactor CharString & CharStringByteSink into helper.
The repeated sequence of allocating a CharString and CharStringByteSink,
before calling some function that writes into this, can be moved into a
single shared helper function which then is used to give all ulocimp.h
functions that write to ByteSink an overload that instead returns a
CharString, to make call sites look like perfectly normal C++ code.
2024-03-05 23:44:50 +01:00
Craig 7bc202ae87 ICU-22534 BRS#27 scrub closed issues (frontload) 2024-03-05 11:15:28 -08:00
Fredrik Roubert 02a1bfc59f ICU-22520 Refactor CheckedArrayByteSink & u_terminateChars into helper.
The repeated sequence of allocating a CheckedArrayByteSink, calling some
function that writes into this, then checking for overflow and returning
through u_terminateChars() can all be moved into a single shared helper
function.
2024-03-05 20:09:54 +01:00
Rich Gillam c610d7f986 ICU-22534 Promote (almost) all @draft ICU 73 APIs to @stable ICU 73 2024-03-04 18:05:29 -08:00
Fredrik Roubert 232362bf17 ICU-22520 Use operator* instead of calling std::optional::value().
There's a subtle difference between these two ways of accessing the
value of an optional and that is that the value() method can throw an
exception if there isn't any value, but operator* won't do that (it's
just undefined behavior if there isn't any value).

ICU4C code never tries to access any optional value without first
checking that it exists, but the ability of the value() method to throw
an exception in case there wasn't any such check first is the reason why
std::exception symbols previously could show up in debug builds.

This reverts the changes that were made to dependencies.txt by
commit dc70b5a056.
2024-03-04 23:40:15 +01:00
Frank Tang 73744ea41f ICU-22633 Fix overflow cause by large AM PM value
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66771
2024-03-04 13:48:24 -08:00
Frank Tang 37526240e1 ICU-22274 Mark known issue for 3 timezones for EnvTest
tz2024a change "Asia/Qostanay" "Asia/Almaty" but test machines has
not yet update their zoneinfo to 2024a so we mark them as known issues

extern long timezone; in <time.h> (set man tzset on Linux shell)
returns wrong value when TZ=America/Scoresbysund
2024-03-04 11:06:39 -08:00
Shane F. Carr 71b9b88200 ICU-22319 Fix number range semanticallyEquivalent
See #2385
2024-03-04 08:23:00 -08:00
Frank Tang aa3e49fa9a ICU-22274 Add zdump info while env test fail 2024-02-29 14:36:14 -08:00
Fredrik Roubert 929cd9bb4f ICU-22520 Standardize return on error for all locale functions.
· No function should do anything if an error has already occurred.
· On error, a value of 0, nullptr, {}, etc., should be returned.
· Values shouldn't have overloaded meanings (eg. index or found).
· Values that are never used should not be returned at all.
2024-02-29 20:42:03 +01:00
David Carlier 35353f2d7f ICU-22671 format_date should use c++ nullptr instead of 0 for udat_open/DateFormat::create
- [x] Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22671
- [x] Required: The PR title must be prefixed with a JIRA Issue number. <!-- For example: "ICU-1234 Fix xyz" -->
- [x] Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
- [x] Required: Each commit message must be prefixed with a JIRA Issue number. <!-- For example: "ICU-1234 Fix xyz" -->
- [ ] Issue accepted (done by Technical Committee after discussion)
- [ ] Tests included, if applicable
- [ ] API docs and/or User Guide docs changed or added, if applicable
2024-02-29 20:02:20 +01:00
Fredrik Roubert 137b4c9e47 ICU-22556 Update configure files from configure.ac using autoreconf. 2024-02-29 19:43:43 +01:00
Jordan Williams 75ff7952b9 ICU-22556 Prefer cc and c++ compilers
When building icu4c, it defaults to clang instead of gcc when the default compiler, cc / c++, is a symlink to gcc / g++.
This not the expected behavior when building C and C++ code.
It appears that this behavior was put in place originally for supporting C++11, which hopefully is no longer such a concern.
This PR adjusts the configure.ac for icu4c to prefer the cc and c++ compilers first.
2024-02-29 19:43:43 +01:00
Craig 96fb7ae73a ICU-22534 ICU4J 75 frontload API change report 2024-02-29 08:49:43 -08:00
Frank Tang 0563859d8c ICU-22679 Optimize calendar code for edge cases
See #2853
2024-02-28 17:08:24 -08:00
Peter Edberg 7d636aecf7 ICU-22655 Implement "special" conversion for speed-beaufort, part 1 icu4j 2024-02-28 12:57:33 -08:00
Craig 09ccfb9956 ICU-22534 ICU4J 75 frontload: API status update 2024-02-28 11:38:41 -08:00
Frank Tang ceca6c4120 ICU-22274 display tz db version on the test machine. 2024-02-28 11:07:32 -08:00
Elango Cheran 0d7cedc0dd ICU-22532 Trigger CI workflows when workflow definitions change 2024-02-28 12:50:43 -05:00
DraganBesevic a1925abf4f ICU-22534 CLDR 45 alpha2 integration to ICU 2024-02-28 08:28:08 -08:00
Craig d271d3f269 ICU-21952 fix draft version of withoutLocale to ICU 75 2024-02-27 17:03:46 -08:00
Markus Scherer d1fa15bc1f ICU-22571 add Aran script code variant 2024-02-27 14:23:59 -08:00
Elango Cheran c2b328267e ICU-22532 Increase timeout for exhaustive ICU4J tests 2024-02-27 10:58:18 -08:00
Elango Cheran 3df505b511 ICU-22532 Increase Github Actions CI parallelism from 2 to 4 2024-02-27 10:58:09 -08:00
Frank Tang ec800e7407 ICU-22633 Return error if era is out of range 2024-02-27 10:56:28 -08:00
Fredrik Roubert 314f03eeaf ICU-22532 Don't dereference nullptr (-Wtautological-undefined-compare). 2024-02-27 14:11:38 +01:00
Mihai Nita 201af462fc ICU-22675 Migrate from deprecated boxed primitive constructors to their replacements 2024-02-26 16:39:05 -08:00
Rūdolfs Mazurs 394341edba ICU-22646 Update collation test for Latvian locale
This test is also relevant to issues ICU-12765 ICU-13508 ICU-20532
2024-02-26 14:09:40 -08:00
Steven R. Loomis ea1c6da07f ICU-22677 update LICENSE and README.md and pom.xml
- https://github.com/unicode-org/.github/issues/15
- use Unicode-3.0 in pom instead of raw license link
- https://github.com/unicode-org/.github/issues/15
2024-02-26 14:34:59 -06:00
Steven R. Loomis 6d15faab48 ICU-22677 update CONTRIBUTING.md
- https://github.com/unicode-org/.github/issues/12
2024-02-26 11:44:35 -06:00
Rahul Pandey 3c82e6857c ICU-22676 Undefine move32 since it is interpreted system call with MSVC ARM64 2024-02-26 08:55:31 -08:00
Shane F. Carr fd5d6c97b1 ICU-22532 Improve commit checker instructions
See #2622
2024-02-23 16:38:14 -06:00
Elango Cheran 4633254f9e ICU-22314 Move Cygwin test to post-merge pipeline 2024-02-22 11:23:17 -08:00
Diego Gutierrez Yepiz f3e50a7624 ICU-22582 Avoid synchronizing in RuleBasedBreakIterator and ULocale unless strictly necessary
See #2775
2024-02-21 09:38:41 -08:00
Elango Cheran 8acebe4a0c ICU-22314 Add PR triggers for Azure pipelines
See #2835
2024-02-21 13:38:48 +05:30
Rahul Pandey df46d089d5 ICU-22314 Refactor Azure CI into workflows conditional on modified paths
See #2701
2024-02-16 15:23:47 +05:30
Markus Scherer 90b2eed71a ICU-22533 compact norm16 tables
See #2827
2024-02-14 14:49:43 -08:00
Markus Scherer 164a56b736 ICU-22533 move custom normalization page from Sites to GitHub 2024-02-14 09:35:14 -08:00
Frank Tang b24b251bca ICU-22633 Fix more int overflow issues in calendar 2024-02-13 17:24:18 -08:00
Fredrik Roubert 939f08f274 ICU-22520 Use C++ function signatures for internal C++ functions.
Some of this code was originally written as C code and some of this code
was originally written as C++ code but made to resemble the then already
existing code that had once been C code. Changing it all to normal C++
now will make it easier and safer to work with going forward.

· Use unnamed namespace instead of static.
· Use reference instead of non-nullable pointer.
· Use bool instead of UBool.
· Use constexpr for static data.
· Use U_EXPORT instead of U_CAPI or U_CFUNC.
· Use the default calling convention instead of U_EXPORT2.
2024-02-12 21:44:06 +01:00
Fredrik Roubert 69c8e12642 ICU-22520 Remove local custom code for parsing variant subtags.
Now when the parseTagString() helper function just is a wrapper over
ulocimp_getSubtags() it can be replaced by calling that function
directly instead and letting it handle variant subtags as well.
2024-02-09 20:26:09 +01:00
Fredrik Roubert 61fdbe0d06 ICU-22520 Refactor code to remove the use of goto for error handling.
This is to facilitate further refactoring of the locale code, goto
doesn't play all too well with C++ memory handling.
2024-02-09 18:47:22 +01:00
Peter Edberg 2c16b037cf ICU-22557 Add kxv_IN to build-icu-data.xml, update generate stubs 2024-02-09 09:40:52 -08:00
Frank Tang abcb80fd53 ICU-22615 Test TimeZoneNames API will not assert with non ASCII.
Add tests and return error when the ID is non ASCII
2024-02-08 23:37:14 -08:00
yumaoka cd251ee62e ICU-22659 tzdata2024a updates in ICU repo 2024-02-08 15:00:39 -05:00
Fredrik Roubert 63ae786bf7 ICU-22520 Refactor function macros into inline functions.
This is to facilitate further refactoring of the locale code.
2024-02-08 14:24:48 +01:00
Robin Leroy ba1208e49b ICU-22518 Add a flag to export the output of the reference implementation from the old segmentation monkey tests 2024-02-08 04:54:33 +01:00
Fredrik Roubert 699555a5bd ICU-22520 Use a ByteSink append buffer instead of a local CharString.
These functions that eventually write their output to a ByteSink need a
small temporary buffer for processing the subtag they're about to write
and currently use a local CharString object to provide this buffer,
which then gets written to the ByteSink and discarded.

This intermediate step is unnecessary as a ByteSink can provide an
append buffer which can be used instead, eliminating the need to
allocate a local temporary buffer and to copy the data around.

This approach also makes it natural to split the processing into two
steps, first calculating the length of the subtag, then processing it,
which makes it possible to return early when no output is requested.
2024-02-08 00:38:09 +01:00
Fredrik Roubert a210fc8351 ICU-22651 Add a docstring for LocalOpenPointer. 2024-02-07 21:47:13 +01:00
Frank Yung-Fong Tang 0b66fada30 ICU-22633 Fix integer overflow inside Calendar code
See #2806
2024-02-07 10:58:41 -08:00
Fredrik Roubert a6efa924ad ICU-22520 Let ulocimp_getRegionForSupplementalData() return CharString. 2024-02-07 14:27:40 +01:00
Fredrik Roubert 56509e88bf ICU-22651 Move LocalOpenPointer into an internal nested namespace. 2024-02-07 14:27:17 +01:00
Peter Edberg 43ab3d1de8 ICU-22583 BRS 75rc CLDR 45-alpha0 to ICU main part 4 (fix to get new unitPrefixes data) 2024-02-06 18:07:44 -08:00
Peter Edberg 12cbf73e39 ICU-22583 BRS 75rc CLDR 45-alpha0 to ICU main part 3 (source and test code changes) 2024-02-06 18:07:44 -08:00
Peter Edberg c7245a36df ICU-22583 BRS 75rc CLDR 45-alpha0 to ICU main part 2 (data generated or copied from CLDR) 2024-02-06 18:07:44 -08:00
Peter Edberg b79ef68c32 ICU-22583 BRS 75rc CLDR 45-alpha0 to ICU main part 1 (binary data, binary-like source data) 2024-02-06 18:07:44 -08:00
Fredrik Roubert d28e12b1f2 ICU-22520 Replace char arrays with icu::CharString. 2024-02-06 19:53:53 +01:00
Fredrik Roubert 930b4d9ab9 ICU-22520 Add convenience wrappers for calling ulocimp_getSubtags().
These wrappers that call ulocimp_getSubtags() to get only one particular
subtag and then return that as icu::CharString will be convenient for
replacing code that currently calls the uloc_get*() functions writing
into a fixed size buffer.
2024-02-06 19:53:53 +01:00
Fredrik Roubert 835b009314 ICU-22520 Make ulocimp_get*() internal to ulocimp_getSubtags().
These functions now no longer have any other callers so they can be made
internal to the compilation unit of ulocimp_getSubtags(), thus bringing
them back to how they originally were intended to be used (and making
the comment above them true once again).

This also makes it possible to remove the temporary icu::CharString
objects that previously were returned to callers and instead write
directly to icu::ByteSink, making the code both simpler and less
wasteful (also that how this was once intended).
2024-02-06 13:12:55 +01:00
Fredrik Roubert 1b768edbdf ICU-22520 Update all users of ulocimp_get*() to ulocimp_getSubtags().
This simplifies the code by removing the need for finding the positions
of the subtags, all that logic is now in just one single place.
2024-02-06 13:12:55 +01:00
Fredrik Roubert dc70b5a056 ICU-22520 Move all localeID parsing logic into new ulocimp_getSubtags().
The logic for parsing a localeID string into its constituent subtags is
currently repeated over and over again in each one of the uloc_get*()
functions, so that calling all these functions one after the other in
order to get all the subtags does the parsing all over again from the
beginning for each function call.

In order to avoid having to do this parsing over and over again, a lot
of code instead has its own copy of the parsing logic in order to call
the underlying ulocimp_get*() functions directly for lower runtime cost
at the price of increased code complexity and repetition.

This new ulocimp_getSubtags() function, which writes natively to
icu::ByteSink and has a convenience wrapper to write to icu::CharString,
removes the repeated code from the uloc_get*() functions and makes it
possible to update all code that calls the ulocimp_get*() functions.
2024-02-06 13:12:55 +01:00
Fredrik Roubert 678d5c1273 ICU-22520 Replace use of ulocimp_forLanguageTag() in uloc_getVariant().
Originally added by commit 24055f8585
for ICU-7882, converting any language tag with a BCP-47 extension into a
legacy Unicode locale ID was a simple way to make the existing code keep
working unchanged also with BCP-47 extensions.

But the only thing that uloc_getVariant() needs is being able to find
out where variants end and extensions begin, for which converting the
entire language tag is unnecessary, it's much more straightforward to
instead just check for the -t-, -u- or -x- marker that indicates the
start of a BCP-47 extension.
2024-02-06 13:12:55 +01:00
Fredrik Roubert 6fa113eaa8 ICU-22651 Refactor U_DEFINE_LOCAL_OPEN_POINTER into a template. 2024-02-05 14:15:15 +01:00
Frank Tang b8271577b6 ICU-22649 Fix possible leakage by using LocalUResourceBundlePointer 2024-02-02 10:24:21 -08:00
Fredrik Roubert 6562a7df85 ICU-22627 Delete obsolete test case letest/api/ScriptTest. 2024-02-02 15:55:27 +01:00
Frank Tang 9515e82741 ICU-22633 Fix Integer-overflow in icu_75::Calendar::add
See #2805
2024-02-01 13:49:41 -08:00
Fredrik Roubert ae9cc8cbd1 ICU-22520 Replace char arrays with icu::CharString. 2024-01-30 12:04:53 +01:00
Fredrik Roubert 1b0f5e41c5 ICU-22520 Switch to using CharString for calling uloc_setKeywordValue(). 2024-01-30 12:04:53 +01:00
Fredrik Roubert 340806bf9a ICU-22520 Add a ulocimp_setKeywordValue() that writes to icu::ByteSink. 2024-01-30 12:04:53 +01:00
Frank Tang e1415d1282 ICU-22635 Avoid integer-overflow for invalid large UChar32 2024-01-29 11:57:12 -08:00
Frank Tang 8f80c62aa2 ICU-22638 Fix cast overflow issue 2024-01-25 12:11:56 -08:00
Elango Cheran 400d97e7d2 ICU-22533 Update Maven CLI instructions for multi-module ICU4J
See #2791
2024-01-23 13:59:56 -08:00
Frank Tang f7f9dbb88d ICU-22641 Change const refs in the class to const pointers
The function may return nullptr, we cannot just deref the return value.
Change them to const pointer instead.
2024-01-23 13:39:49 -08:00
Fredrik Roubert e81b8727aa ICU-22532 Move the definition of _POSIX_C_SOURCE to the Makefile.
This is already set in Makefile.in and therefore results in a macro
redefined warning if also defined in the source file. It seems that
setting this in the Makefile was how it was originally intended do be
done (but then it was just never updated there).
2024-01-23 13:00:54 +09:00
Fredrik Roubert 5eded36279 ICU-22520 Bugfix: Use macro parameter name instead of variable name. 2024-01-23 13:00:26 +09:00
Frank Tang 7c48842e23 ICU-22637 Accept non-ASCII digit to fix mistake 2024-01-22 14:00:12 -08:00
Fredrik Roubert 49a7a1e76d ICU-22520 Update urename.h with ulocimp_getParent().
This was forgotten in commit 037449fff8.
2024-01-22 12:30:37 +09:00
Fredrik Roubert 9167d6beaf ICU-21107 Update configure files from configure.ac using autoreconf. 2024-01-22 12:30:24 +09:00
Fredrik Roubert ac7e3de879 ICU-21107 Remove obsolete conditional use of C++17 std::string_view.
ICU4C now requires C++17 so std::string_view must always be available.
2024-01-22 12:30:24 +09:00
Frank Tang 9832f48e22 ICU-22636 Return U_BRK_RULE_SYNTAX when status number is too large
See #2793
2024-01-19 17:16:54 -08:00
Fredrik Roubert 7cec4a9308 ICU-21107 Replace use of adapter and binder classes removed in C++17. 2024-01-19 19:49:44 +09:00
Frank Tang c8336085bb ICU-22637 Rewrite custom timezone parser
See #2792
2024-01-19 01:44:52 -08:00
Frank Tang 3eb8923b97 ICU-22638 Use parseNumber to fix buffer-overflow
See #2795
2024-01-19 01:43:35 -08:00
Fredrik Roubert 7b690aa8c7 ICU-22639 Revert now obsolete bug workarounds.
This reverts changes from commit 47b9a517be.
This reverts changes from commit 214ae60d94.
2024-01-19 13:11:49 +09:00
Fredrik Roubert c5160765d4 ICU-22639 Clone the calendar so we don't mess with the real one. 2024-01-19 08:07:22 +09:00
Fredrik Roubert ca53838b83 ICU-22576 Remove now obsolete pre-C11 backward compatibility code. 2024-01-19 08:05:24 +09:00
Fredrik Roubert d0672fa8ab ICU-21107 Simplify type_traits expressions for C++17. 2024-01-18 20:28:39 +09:00
Fredrik Roubert 981057143c ICU-21107 Remove CI jobs using MSVC too old to support C11.
Versions before VS 2019 don't have C11 standard library features:

https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1
2024-01-18 13:03:45 +09:00
Mihai Nita 47b9a517be ICU-21107 Specify language standard versions C11 & C++17 also for MSVC
ICU-21107 Specify language standard versions C11 & C++17 also for MSVC
2024-01-17 09:26:22 -08:00
Fredrik Roubert 4a8cd80973 ICU-21107 Clarify the C11 & C++17 requirement in the userguide. 2024-01-17 17:48:10 +09:00
Fredrik Roubert 2d65456a3b ICU-21107 Specify language standard versions C11 & C++17 also for Bazel.
This is copied (with C11 added) from:

https://github.com/tensorflow/tensorflow/blob/v2.15.0/.bazelrc

There were until now no versions specified at all, relying on the
default (or commandline overrides) to be sufficiently recent.
2024-01-17 16:26:57 +09:00
Fredrik Roubert 078b88a11a ICU-21107 Specify language standard versions C11 & C++17 also for MSVC.
There were until now no versions specified at all, relying on the
default (or commandline overrides) to be sufficiently recent.
2024-01-16 22:22:05 +09:00
Fredrik Roubert 214ae60d94 ICU-21107 Bugfix: Break up statement to force execution order. 2024-01-16 22:22:05 +09:00
Fredrik Roubert ab72ab1d4a ICU-22520 Replace char arrays with icu::CharString & icu::MemoryPool. 2024-01-13 17:05:58 +09:00
Frank Tang 509405c9f2 ICU-22626 Fix leakage when 2 '=' in PluralRules
See #2782
2024-01-12 09:36:29 -08:00
yumaoka dc7014fda6 ICU-22620 tz2023d updates 2024-01-11 11:41:23 -05:00
Fredrik Roubert a837e0d399 ICU-22532 Set a value for _POSIX_C_SOURCE to get symlink() declared.
ISO C99 and later do not support implicit function declarations.
2024-01-11 17:35:28 +09:00
Frank Tang 23d1fc5989 ICU-22549 Fix incorrect pointer
Remove the adjustment of data pointer to avoid buffer-overflow
Fix bug https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65632
2024-01-10 12:36:39 -08:00
Fredrik Roubert 906093f31b ICU-22520 Make icu::CharString comparable with itself. 2024-01-10 17:30:32 +09:00
Fredrik Roubert 87ca023447 ICU-22520 Replace char arrays with icu::CharString. 2024-01-10 12:19:44 +09:00
Frank Tang ed970751ef ICU-22520 Add test case for oss-fuzz issue #65635. 2024-01-10 12:19:44 +09:00
Frank Tang 3f054adaf3 ICU-22549 Fix fuzzer to call Locale with null-terminiate string 2024-01-05 01:18:48 -08:00
Frank Tang cfba9a8caf ICU-22549 Reland PR2770 w/ fix
Reland PR2770 w/ the fix that null termination the input to Locale
constuctor.
2024-01-05 01:18:10 -08:00
Fredrik Roubert 539e8f41a3 ICU-22532 Compiler warning: conversion from 'double' to 'int32_t'.
The definition of kOneDay is 1.0 * U_MILLIS_PER_DAY so there's no
reason whatsoever to not just use U_MILLIS_PER_DAY directly here.
2024-01-04 09:40:40 +09:00
Frank Yung-Fong Tang 52ff51e82c ICU-22549 Revert "Improve fuzzer to test more locale"
See #2770
2024-01-03 14:19:32 -08:00
Shane F. Carr 1a60a038e1 ICU-21952 Add withoutLocale functions to LocalizedNumber[Range]Formatter
See #2483
2023-12-28 22:04:02 -08:00
Fredrik Roubert 02740597ce ICU-22520 Replace char arrays with icu::CharString. 2023-12-29 11:30:57 +09:00
Manish Goregaokar 74abcfe288 ICU-22481 Add toml support to gendict
(and use it in CI)
2023-12-27 22:59:57 -08:00
Fredrik Roubert 7eb56fee1e ICU-22520 Remove now superfluous intermediate buffers. 2023-12-28 11:13:38 +09:00
Fredrik Roubert 5fa7d4c7ff ICU-22520 Delete unused internal feature alternateTags. 2023-12-28 11:13:38 +09:00
Fredrik Roubert 03a870a23c ICU-22520 Replace uprv_malloc() / uprv_free() with icu::CharString. 2023-12-28 10:27:35 +09:00
Fredrik Roubert 9a91599fd4 ICU-22520 Replace uprv_malloc() / uprv_free() with icu::LocalPointer. 2023-12-23 10:42:55 +09:00
Steven R. Loomis 9d3e12b820 ICU-22601 v74.2 fix dangling LICENSE file
- 'git archive' works on a subtree so did not include LICENSE
- we copy the LICENSE file from the build dir
- broken by ICU-22309
2023-12-22 09:28:09 -08:00
Fredrik Roubert 887005b68a ICU-22520 Remove unnecessary copying of statically allocated strings. 2023-12-22 08:43:55 +09:00
Fredrik Roubert daa0171501 ICU-22608 Add necessary using statements for namespace icu. 2023-12-22 08:12:47 +09:00
Frank Tang 23dd2b8b54 ICU-22549 Add PluralRule Fuzzer 2023-12-21 14:21:33 -08:00
Fredrik Roubert ef78f2a863 ICU-21107 Update configure files from configure.ac using autoreconf. 2023-12-21 09:31:55 +09:00
Fredrik Roubert 45d351ca4e ICU-21107 Update ICU4C minimum standard version from C99 to C11. 2023-12-21 09:31:55 +09:00
Frank Tang fc6e282d98 ICU-22549 Limit Normalizer2 Fuzzer for 5K of input
To avoid timeout
2023-12-19 13:58:03 -08:00
Clifford Yapp 96128db44d Make sure RELEASE contents match 74.1 2023-12-19 12:44:37 -05:00
Clifford Yapp d19dec1556 Update RELEASE to release-74-1 2023-12-19 12:43:10 -05:00
Fredrik Roubert 1384d9f395 ICU-22532 Remove redundant 'void' from empty C++ parameter lists.
https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/redundant-void-arg.html
2023-12-19 09:27:18 +09:00
Fredrik Roubert 85b7f5fda2 ICU-22604 Use 'void' for empty C parameter lists (-Wstrict-prototypes). 2023-12-19 09:27:01 +09:00
Frank Tang 838227ce95 ICU-22614 Fix buffer overflow in TimeZoneNames
See #2752
2023-12-18 16:26:06 -08:00
Frank Tang 11d1148e56 ICU-22549 Improve fuzzer to test more locale
We found bogus locale cause crash in DateFormat so here
we enhance the fuzzer to also test locale name which are not
return by the available locale list.
2023-12-18 13:31:06 -08:00
Frank Tang 4ba5d9191b ICU-22549 Add DateFormatSymbols fuzzer 2023-12-15 16:17:38 -08:00
Frank Tang 7bef50e71d ICU-22609 Fix nulldef w/ bogus locale in DateFormat::create* 2023-12-15 16:14:56 -08:00
Frank Tang 5cf5ec1adb ICU-22549 Add TimeZoneNames fuzzer 2023-12-15 11:30:45 -08:00
Frank Tang 77759422dd ICU-22549 Add Normalizer2 Fuzzer
ICU-22549 Remove unnecessary include files
2023-12-15 11:30:33 -08:00
Mihai Nita e76094c55a ICU-22605 Exclude the data files from the -sources.jar 2023-12-15 09:08:22 -08:00
Frank Tang 19af9e7ce3 ICU-22602 Fix stack overflow inside flattenVariables
Limit the recursive call of flattenVariables to maximum depth 3500
since Java on my machine throw stack overflow exception around 3900.
2023-12-14 15:14:21 -08:00
Fredrik Roubert 99f6be4345 ICU-22593 Add missing layout/ prefix for Layout Engine header files. 2023-12-14 23:51:10 +01:00
Fredrik Roubert 391e3b85fe ICU-22591 Delete obsolete source file. 2023-12-14 20:42:00 +01:00
Fredrik Roubert 6f2e37ecb5 ICU-22590 Delete useless source file. 2023-12-14 20:41:44 +01:00
Fredrik Roubert e2d1d3ed43 ICU-22592 Rename source file that should not be directly compiled. 2023-12-14 20:11:50 +01:00
Fredrik Roubert e112f896a2 ICU-22576 Use standard alignof() with modern C. 2023-12-14 19:11:29 +01:00
Fredrik Roubert 1bc059e7d6 ICU-21107 Update configure files from configure.ac using autoreconf. 2023-12-14 09:36:22 -08:00
Fredrik Roubert 7ec1765ce8 ICU-21107 Update ICU4C minimum standard version from C++11 to C++17. 2023-12-14 09:36:22 -08:00
Frank Tang 4a7d61d261 ICU-22579 Fix Null deref while Unicode Set only has string 2023-12-12 14:39:12 -08:00
Frank Tang 8b14c05791 ICU-22585 Fix infinity loop while unicode set contains single surrogate 2023-12-11 15:33:12 -08:00
Frank Tang 7d3cd7cba5 ICU-22584 Fix def of nullptr
ICU-22584 fix
2023-12-11 14:35:10 -08:00
Frank Tang 4da7ffaa36 ICU-22580 Address infinity loop in RBBI
ICU-22580 Fix tests
2023-12-11 11:34:47 -08:00
Frank Tang 73f972f7ff ICU-22581 Fix RBBI leakage
Duplicate variable references in the rule should not cause leakage
2023-12-08 15:47:51 -08:00
Rahul Pandey 665d9dbbe9 ICU-22534 BRS 75 front-load update version to 75.0.1
See #2726
2023-12-08 14:32:40 -08:00
Andy Heninger e6892996b1 ICU-22584 Fix RBBI rule builder stack overflow.
The problem was found by fuzz testing.

A rule consisting of a long literal string produces a large, unbalanced parse tree,
one node per string element. Deleting the tree was recursive, once per node, resulting
in deep recursion.

This PR changes node deletion to use an iterative (non-recursive) approach.

This change only affects rule building. There is no change to the RBBI run time
using pre-built rules.
2023-12-08 12:49:26 -08:00
yumaoka da83309900 ICU-22595 GitHub release file generation script to include javadoc for each artifact in addition to full javadoc 2023-12-07 10:37:15 -08:00
Frank Tang 2a3cb99f6e ICU-22589 Avoid timeout in TimeZone test 2023-12-05 16:24:33 -08:00
Frank Tang b246489074 ICU-22588 Limit test data to avoid meaningless timeout 2023-12-05 16:24:02 -08:00
Rich Gillam bcae6f2a43 ICU-22575 Change AvailableFormatsSink to allow locales to inherit availableFormats items from the root locale. 2023-12-04 12:47:50 -08:00
Fredrik Roubert 394ebaaee0 ICU-22522 Update configure files from configure.ac using autoreconf. 2023-12-04 16:17:20 +01:00
Fredrik Roubert e5f3295b91 ICU-22522 Revert "Use the Clang -Wno-ambiguous-reversed-operator flag".
This reverts commit dc1b8ca26e.
2023-12-04 16:17:20 +01:00
Fredrik Roubert e48d2734c6 ICU-22522 Revert "Add early check for AX_CHECK_COMPILE_FLAG".
This reverts commit 9f358ccb24.
2023-12-04 16:17:20 +01:00
Fredrik Roubert d2a5638336 ICU-22522 Make operator==() const to resolve C++20 ambiguity. 2023-12-04 16:17:20 +01:00
Frank Tang d93c7b60fc ICU-22568 return TimeZomeFormat::createInstance for bogus locale 2023-12-01 15:10:41 -08:00
Frank Tang 83327fb92c ICU-22549 Add Fuzzer for TimeZone 2023-12-01 15:04:51 -08:00
Frank Tang e8e19454da ICU-22549 Add fuzzer for NumberFormatter 2023-12-01 15:04:22 -08:00
Frank Tang 368d67316c ICU-22549 Add UnicodeSet fuzzer 2023-11-30 08:32:09 -08:00
Fredrik Roubert 78b1a3fc46 ICU-22522 Update the Azure CI from Clang 14 to Clang 16. 2023-11-30 15:34:36 +01:00
Fredrik Roubert f99f8c678b ICU-22522 Delete unused variables.
Clang 16 is more thorough in finding unused variables, so these must be
removed to be able to compile this code using Clang 16 and -Werror.
2023-11-30 15:34:36 +01:00
Frank Tang ba4e8f2ef7 ICU-22549 Add Fuzer for Unicode property API 2023-11-29 16:30:46 -08:00
Elango Cheran 2adf957de2 ICU-22314 Refactor GH CI jobs into workflows triggered by modified paths 2023-11-29 17:59:41 -05:00
Frank Tang 0bfa5f4c44 ICU-22549 Add DateTimePatternGenerator fuzzer
See #2708
2023-11-29 14:45:21 -08:00
Frank Tang 276d3dc865 ICU-22493 Implement First Day Override in Calendar 2023-11-29 11:55:51 -08:00
Frank Tang 5d3e84afc0 ICU-22549 Add RuleBasedBreakIterator fuzzer 2023-11-29 11:55:09 -08:00
Frank Tang 757d2cd90a ICU-22555 Fix infinity loop in RuleBasedCollator constructor
Fix C++ and Java code.
Add unit tests for both C++ and Java.
2023-11-29 11:31:27 -08:00
Frank Tang 8d3d214ad7 ICU-22531 Remove X from XLikelySubtags* 2023-11-17 14:49:39 -08:00
Frank Tang 102ed8b6bd ICU-22563 Limit the size for calendar fuzzer
Limit to 1000 bytes of valid test data so the fuzzer will
not timeout because of running many operations.

ICU-22563 fix comment
2023-11-16 14:55:00 -08:00
Elango Cheran 511e5efe56 ICU-22533 Update BRS instructions for tagging release 2023-11-10 15:33:31 -08:00
Mihai Nita 091fcf6f82 ICU-22533 Don't mention 'Release Candidate' in javadoc 2023-11-09 16:09:55 -08:00
Frank Tang fa6a4661ba ICU-22545 Fix addLikelySubtags for pseudo Locales 2023-10-31 15:00:34 -07:00
Frank Tang 1bb711ad20 ICU-22540 Add new CLDR units ronto, ronna, quecto, and quetta 2023-10-31 14:58:52 -07:00
yumaoka a7c7d8f214 ICU-22561 Added maven-gpg-plugin in pom.xml to sign artifacts for maven central release. 2023-10-30 19:51:44 -07:00
Shane F. Carr b070c932ad ICU-22560 Merge ICU 74 maintenance branch to main (#2689) 2023-10-30 13:50:52 -07:00
Frank Tang 92eeb45811 ICU-22547 fix addLikelySubtags for 4 chars script code
Also fix ICU-22546 to correct the comments in the API doc
and add additional unit tests
2023-10-27 17:29:05 -07:00
Markus Scherer 9edac7b783 ICU-22326 ICU 74 release not candidate 2023-10-27 15:56:19 -07:00
Peter Edberg d44f5bc9f0 ICU-22326 logKnownIssue skip for exhaustive test failures with kxv(_Deva)? day/month names 2023-10-27 14:59:16 -07:00
Shane F. Carr e04f4427dc ICU-22559 Hardcode the macroregions in XLikelySubtags and add a debug assertion
See #2688
2023-10-27 14:18:51 -07:00
Frank Tang cdab88ff4e ICU-22513 Return error if days is too large in IslamicUmalquraCalendar
If the year is too large it may overflow the int32_t variable and cause
slow or infinity loop, return error if the year is too large that the
conversion to day may overflow int32_t. Limit the value to max value of
int32_t divide by 400.
2023-10-26 17:09:41 -07:00
Mihai Nita 9f64d3f269 ICU-22534 Script preparing the GitHub icu4j release files
See #2665
2023-10-26 14:50:31 -07:00
Yoshito Umaoka 1caf1c9c55 ICU-22326 BRS74 clean up import statements
See #2685
2023-10-26 13:04:06 -07:00
JALAJ HARKAWAT 97e2f3b018 ICU-22326 Version number update for GA
See #2685
2023-10-26 13:03:43 -07:00
Elango Cheran 683df2254e ICU-22326 Fix build problems
See #2685
2023-10-26 11:17:30 -07:00
Peter Edberg da874594ef ICU-22326 CLDR release-44-beta5 to ICU main part 4 (manually add kxv_Latn* stubs) 2023-10-26 10:59:18 -07:00
Peter Edberg 2f7bfd87cb ICU-22326 CLDR release-44-beta5 to ICU main part 3 (ICU sources: lib, tools, tests) 2023-10-26 10:59:18 -07:00
Peter Edberg f15f8a41a4 ICU-22326 CLDR release-44-beta5 to ICU main part 2 (data generated or copied from CLDR) 2023-10-26 10:59:18 -07:00
Peter Edberg 91a94c78d3 ICU-22326 CLDR release-44-beta5 to ICU main part 1 (binaries, binary-like source) 2023-10-26 10:59:18 -07:00
Peter Edberg 8499f338ee ICU-22326 CLDR release-44-beta4 to main part 2 (data generated or copied from CLDR) 2023-10-25 14:00:46 -07:00
Peter Edberg 5591fd65c0 ICU-22326 CLDR release-44-beta4 to main part 1 (binaries, binary-like source) 2023-10-25 14:00:46 -07:00
Mihai Nita 7200b4d18b ICU-22322 Fix include to use double quotes 2023-10-24 16:27:30 -07:00
Philip Allgaier 01388fa5ef ICU-22323 Typo fixes in docs for ICU TimeZone Classes 2023-10-19 16:03:57 -07:00
Elango Cheran 3c44e031be ICU-22505 Ensure default TZ remains unchanged by each test
See #2670
2023-10-16 16:25:01 -07:00
Mohamed Akram 3d1dee6837 ICU-22528 Improve date formatting performance 2023-10-13 18:43:04 -07:00
Frank Tang cb7b1b6506 ICU-22548 Reduce the loop limit to fail faster
Reduce the error return from about 100s to 30s to avoid
fuzzer 60s timeout error.
Also add a include file to fix uint8_t build breakage.
2023-10-13 16:29:29 -07:00
Frank Yung-Fong Tang ca631eaa26 ICU-22541 Fix MacOS 14 default timezone issue
See #2669
2023-10-12 17:16:05 -07:00
Sarvesh Arora bd9e5ed620 ICU-21991 added VS2022 checks and changed windows SDK version 2023-10-12 14:36:27 +05:30
Elango Cheran 6a4ae3b95f ICU-22537 Fix CI checks to run with UCONFIG_NO_SERVICE
See #2667
2023-10-10 16:28:29 -07:00
Steven R. Loomis 4b65cdeae1 ICU-22537 remove inconsistent UCONFIG_NO_SERICE guards 2023-10-10 12:42:53 -05:00
Jeffrey Riaboy cdbf0ef6df ICU-22529 Update services.md
All external links were incorrectly pointing to the current directory with .md as the file extension.

Changed all links to be "../" with the .md extension removed
2023-10-09 13:01:06 -07:00
Mihai Nita 049c8ad365 ICU-22534 Script preparing the GitHub icu4j release files
See #2665
2023-10-06 16:49:26 -07:00
Elango Cheran 2e9d1288dd ICU-22324 Add docs for Maven usage
See #2655
2023-10-05 13:43:38 -07:00
Elango Cheran deab8eef82 ICU-22324 Update Maven migration scripts
See #2661
2023-10-05 13:43:31 -07:00
Elango Cheran cc777ef48c ICU-22324 Remove Ant build's shared directory 2023-10-05 08:43:18 -07:00
Elango Cheran 623cb1accc ICU-22324 Update BRS task docs 2023-10-04 21:05:20 -07:00
Mihai Nita 1b5542da42 ICU-22324 Mavenization: fix the with_full_javadoc profile
See #2658
2023-10-04 16:29:18 -07:00
DraganBesevic 597e3110a5 ICU-22325 CLDR 44 beta2 integration to ICU part three, source files changes 2023-10-04 15:18:56 -07:00
DraganBesevic 72099ee64c ICU-22325 CLDR 44 beta2 integration to ICU part two, source files generated or copied from CLDR 2023-10-04 15:18:56 -07:00
DraganBesevic 34883e931c ICU-22325 CLDR 44 beta2 integration to ICU part one, binary and binary source files 2023-10-04 15:18:56 -07:00
Frank Tang d82ad9975d ICU-22526 Allow GMT-23:59 time zone
ECMA402 now allow offset timezone from -23:59 to 23:59.
We need to lower the minimum ZONE_OFFSET value to -23:59
2023-10-04 14:43:36 -07:00
yumaoka 1651e63b33 ICU-22325 BRS74 ICU4J API signature file 2023-10-04 12:11:07 -04:00
Fredrik Roubert c587069895 ICU-22527 Add -Wambiguous-reversed-operator test code. 2023-10-04 00:05:31 +02:00
Shane F. Carr fc386c3a9a ICU-22149 Be more graceful with missing lang bundle data
See #2635
2023-10-03 14:20:26 -07:00
Mihai Nita e09adbf05a ICU-22324 Mavenization: removed license links (error on Windows)
See #2652
2023-10-03 12:47:48 -07:00
Yoshito Umaoka 3cc4e1aac6 ICU-22325 BRS74 Updating ICU4J serialization test data 2023-10-03 15:20:03 -04:00
Mihai Nita e6f7ef7ef4 ICU-22324 Mavenization, remove maven proof of concept and ant script 2023-10-03 10:58:25 -07:00
Peter Edberg e1af930c6a ICU-22325 BRS 74rc move cldr testdata to consistent place, adjust test & tools to match 2023-10-03 10:24:27 -07:00
Craig dff59b61f9 ICU-22325 ICU4C update APIChangeReport 73 -> 74 2023-10-03 07:21:20 -07:00
Frank Tang 05b0e7abaf ICU-22517 Limit the closure expansion loop and return error
To avoid very slow return from the constructor, we return
error while the Collation rule expand too big.
Add a soft limit to limit to the number of loop needed for 8 Hanguls
  Necessary number of loop: H(0)=0; H(i)=3H(i-1)+2.
  Where i is the length of Hangul in the rule.
  H(1) = 2, H(2) = 8, H(3)=26, H(4)=80, H(5) = 242 ...
2023-10-02 19:06:38 -07:00
Markus Scherer f6d09d514d ICU-22527 add Measure::operator!=() 2023-10-02 17:03:28 -07:00
Craig Cornelius e73d9736c9 ICU-22325 Update docs.md to change ant commands to new scripts 2023-10-02 16:04:02 -07:00
Yoshito Umaoka 3446660d27 ICU-22325 BRS74 Clean up import statements 2023-10-02 17:22:26 -04:00
Antonio Bueno f24e0a0ff3 ICU-22323 Describe date field symbol ee as 02, not 2
See #2636
2023-10-02 12:29:59 -07:00
DraganBesevic 38643e14e5 ICU-22325 CLDR 44 beta1 integration to ICU part two, source files generated or copied from CLDR 2023-09-29 20:29:49 -07:00
DraganBesevic 5fa75fb9cc ICU-22325 CLDR 44 beta1 integration to ICU part one, binary and binary source files 2023-09-29 20:29:49 -07:00
Mihai Nita 76b9e089be ICU-22324 Mavenization, publish the root pom to Maven 2023-09-28 17:32:30 -07:00
Frank Tang 07137b64e4 ICU-22521 Return U_INTERNAL_PROGRAM_ERROR instead of % 0
When the gap is 0, return status as U_INTERNAL_PROGRAM_ERROR
and avoid the operation of "% gap"
2023-09-28 14:23:07 -07:00
Shane F. Carr acfe1c299b ICU-22325 Update double-conversion to v3.3.0 2023-09-28 14:31:16 +02:00
Markus Scherer bfbf578f1c ICU-22325 docmain ICU 74 new C services 2023-09-27 17:55:37 -07:00
Robin LeroyandMarkus Scherer 9ed8532d2d ICU-22332 document advanced usage of bidi confusability
Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-09-28 02:22:05 +02:00
Mihai Nita aa377d7366 ICU-22324 Mavenization, script to generate serial test data 2023-09-27 16:11:39 -07:00
Mihai Nita 7a0373411e ICU-22324 Mavenization, building the CLDR utilities 2023-09-27 11:01:06 -07:00
Markus Scherer c670bbd5b0 ICU-22420 GB18030 change 3 mappings for GBK/web compat 2023-09-27 08:37:24 -07:00
Mihai Nita 87fe057838 ICU-22324 Mavenization, add -SNAPSHOT back to the maven version 2023-09-27 06:46:31 -07:00
Fredrik Roubert 037449fff8 ICU-21289 Switch to using CharString for calling uloc_getParent(). 2023-09-26 23:41:24 +02:00
Fredrik Roubert 96dcaf7da8 ICU-21289 Switch to using CharString for calling uloc_forLanguageTag(). 2023-09-26 17:52:51 +02:00
Elango Cheran 99026f01cc ICU-22325 BRS74RC: Update version number to 74.1
See #2613
2023-09-26 08:21:21 -07:00
Fredrik Roubert 9bce52f003 ICU-21289 Switch to using CharString for calling uloc_toLanguageTag(). 2023-09-26 13:26:11 +02:00
Fredrik Roubert 2df1ab7240 ICU-21289 Switch to using CharString for calling uloc_canonicalize(). 2023-09-26 00:52:13 +02:00
Fredrik Roubert 47b28d6740 ICU-21289 Switch to using CharString for calling uloc_getBaseName(). 2023-09-26 00:52:13 +02:00
Fredrik Roubert 558df3aeb8 ICU-21289 Switch to using CharString for calling uloc_getName(). 2023-09-26 00:52:13 +02:00
Frank Tang c1475f4bbd ICU-22516 Return error while the style is invalid
To avoid later unknown address in icu_74::UnicodeString::copyFrom
2023-09-25 15:43:49 -07:00
Fredrik Roubert 6d1999fbb9 ICU-21289 Switch to using CharString for calling uloc_getKeywordValue(). 2023-09-25 19:02:41 +02:00
Younies Mahmoud c4689841c0 ICU-22463 Fix the conversion from gasoline-equivalent units to kilograms-per-meter-squared-per-second
See #2616
2023-09-23 06:48:25 +02:00
Mihai Nita 8c4af504a0 ICU-22324 Mavenization, minimize the places that need a version 2023-09-22 13:08:25 -07:00
Fredrik Roubert 6e0468d3bf ICU-22498 Write directly to sink (instead of into legacy buffers). 2023-09-22 15:01:42 +02:00
Frank Tang cdcea0c378 ICU-22479 Enahnce the fuzzer for ListFormatter
Add the testing for invalid type and width.
Also test formatStringsToValue
2023-09-21 21:21:21 -07:00
Mihai Nita 501fe1b74a ICU-22324 Mavenization, preparing for maven central deployment 2023-09-21 18:21:06 -07:00
Craig c3544278cb ICU-22325 BRS#13: urename.h 2023-09-21 16:45:25 -07:00
Frank Tang 77bc51e03e ICU-22479 Add fuzzer for RelativeTimeFormatFuzzer
And also fix a bug by checking the unit
2023-09-21 14:50:35 -07:00
Craig 263db44a3a ICU-22325 BRS#19 ICU4J 74 Status and Change Report
Change FormattedNumber.getNounClass to @stable ICU 72
2023-09-21 13:21:20 -07:00
Elango Cheran f14b24a845 ICU-22324 Allow single Maven cache creation and multiple read-only usage 2023-09-21 08:39:05 -07:00
Frank Tang 4fcf8d22b9 ICU-22507 Fix stack overflow in ChineseCalendar::isLeapMonthBetween
Rewrite the recursive call to while loop to avoid stack overflow
when the two values have big gap.
Include tests to verify the problem in unit test.
2023-09-20 23:56:15 -07:00
Rich Gillam 1b980e5999 ICU-21877 Fixed it so that getAllChildrenWithFallback() correctly calls its sink with every possible resource the
one the user requested might be inheriting elements from.
2023-09-20 14:09:21 -07:00
Frank Tang 6a42197331 ICU-22510 Fix Calendar::set to check the field is valid. 2023-09-20 13:50:56 -07:00
Rich Gillam 2ca7c49662 ICU-22464 Fix Java DateFormatSymbols to copy abbreviated day period names to the other sizes when appropriate. 2023-09-20 13:46:00 -07:00
Frank Tang 87d606c39a ICU-22509 Fix the RelativeDateFormat to reject unsupported dateStyle 2023-09-20 12:02:57 -07:00
Elango Cheran f4227f5d54 ICU-22324 Include all unit tests, move tests needing multiple components 2023-09-20 10:51:19 -07:00
Mihai Nita 9be9ed3231 ICU-22324 Mavenization, resolve some of the release tasks 2023-09-20 10:27:12 -07:00
Yoshito Umaoka 2f7090256a ICU-22502 Fix TestPersonNames failure on Windows 2023-09-19 22:54:46 -04:00
Frank Tang c4a596e18e ICU-22508 Reject NaN as input to Calendar::setTime
Fix DateFormat::format issue
2023-09-19 15:55:02 -07:00
Frank Tang 990779c4bf ICU-22509 Limit the dateStyle and timeStyle in fuzzer to only valid enum 2023-09-19 15:54:04 -07:00
Frank Tang 6df1babae2 ICU-22479 Add Fuzzer for ListFormat 2023-09-19 15:52:42 -07:00
Frank Tang f3b869cbb0 ICU-22512 Fix broken TestHebrewCalendarInTemporalLeapYear
Fix broken test mistakenly landed in
https://github.com/unicode-org/icu/pull/2274

Some important steps were missed in the last landing.
2023-09-19 09:47:03 -07:00
Markus Scherer d8659b476d ICU-22404 new properties IDS_Unary_Operator, ID_Compat_Math_*, NFKC_SCF 2023-09-16 14:41:51 -07:00
Frank Tang d082de574f ICU-22479 Add Fuzzer for DateFormat 2023-09-15 17:47:17 -07:00
Rich Gillam 14ca2b0e6d ICU-22313 Various fixes for duration formatting:
- Changed the C++ and Java interfaces to that the URBNF_DURATION ruleset is marked deprecated.
- Fixed a bug in RuleBasedNumberFormat in both Java and C++ that caused the existing duration-formatting rules to produce bogus results when used on a non-integral value.

(Earlier versions of this PR added code to use a MeasureFormat under the covers when a caller used
unum_open(UNUM_DURATION).  I took that out because of backward compatibility concerns, so we're still using RBNF
in the C API.  I'm hoping to add a "real" duration formatter in ICU 75.)
2023-09-15 16:27:58 -07:00
Rich Gillam 71a483d174 ICU-22495 Added support for "genitive" and "vocative" field modifiers; cleaned up PersonNameConsistencyTest. Fixed
bug in implementation of "retain" keyword.
2023-09-15 15:04:01 -07:00
Peter Edberg 28572ab67e ICU-22325 CLDR release-44-alpha3 to main part 3 (ICU sources: lib, tools, tests) 2023-09-15 14:02:20 -07:00
Peter Edberg 7ff2fff2b8 ICU-22325 CLDR release-44-alpha3 to main part 2 (data generated or copied from CLDR) 2023-09-15 14:02:20 -07:00
Peter Edberg 63c9435e87 ICU-22325 CLDR release-44-alpha3 to main part 1 (binaries, binary-like source) 2023-09-15 14:02:20 -07:00
Frank Tang 84ae742ea0 ICU-22479 Add fuzzer for Calendar API 2023-09-15 11:02:55 -07:00
Frank Tang 386e9a10db ICU-22504 Fix buffer overflow write error 2023-09-15 11:01:37 -07:00
Elango Cheran 832997c57e ICU-22325 Disable tests as workaround for failures following CI changes
See #2601
2023-09-15 09:46:23 -07:00
Frank Tang 9e9bc3695f ICU-22489 Clarify the default setting of Collator
See #2595
2023-09-14 10:05:36 -07:00
Frank Tang 9fb9bd4950 ICU-22342 Rename fillBreak to fillBreaks 2023-09-14 10:04:57 -07:00
DraganBesevic bb7352990e ICU-22325 CLDR 44 alpha2 integration to ICU part three, source files changes 2023-09-13 11:06:53 -07:00
DraganBesevic 6b08bb601c ICU-22325 CLDR 44 alpha2 integration to ICU part two, source files generated or copied from CLDR 2023-09-13 11:06:53 -07:00
DraganBesevic a5589e9210 ICU-22325 CLDR 44 alpha2 integration to ICU part one, binary and binary source files 2023-09-13 11:06:53 -07:00
Craig 6d178fd002 ICU-22325 Update ICU4C API Change Reports - frontload
Change version on uspoof.h from "74.0" to "74"
2023-09-12 16:15:11 -07:00
Frank Tang 68a61daa95 ICU-22497 Fix buffer-overflow READ for toLanguateTag 2023-09-12 15:21:26 -07:00
Frank Tang 35645abdcb ICU-22494 Avoid adding empty or duplicate variants during locale canoncalization.
It change the failure case (see the bug) from 35s to 0.126s on a very
fast developement machine.
2023-09-11 15:25:37 -07:00
Rich Gillam 687feb1eaa ICU-22478 Fix log spew in PersonNameConsistencyTest. 2023-09-11 13:34:31 -07:00
Rich Gillam 916452befc ICU-22169 Fixed ures_getFunctionalEquivalent() to check the resource bundles' %%Parent resources when ascending
the parent tree.
2023-09-11 12:58:41 -07:00
Peter Edberg 612cfbbfe4 ICU-22325 BRS 74rc update rename.h #1 2023-09-07 22:21:55 -07:00
Silas S. Brown 7ae7b15698 ICU-22323 update comment: it is now only two word lists, not three 2023-09-07 21:34:25 -04:00
Rich Gillam 8c7a78f663 ICU-22471 Made PersonName.FieldModifier.RETAIN @internal, at least until we find we need it in the API. 2023-09-06 14:32:14 -07:00
Rich Gillam b6a4eb8a65 ICU-22325 Promoted all @draft ICU 72 APIs to @stable ICU 72. 2023-09-06 14:03:05 -07:00
Frank Tang c294c3272c ICU-22365 Add adoptULocale and buildULocale to ULocaleBuilder
Add two methods related to ULocale to ULocaleBuilder API

void ulocbld_adoptULocale(ULocaleBuilder* builder, ULocale* locale);
ULocale* ulocbld_buildULocale(ULocaleBuilder* builder, UErrorCode* err);

ICU TC approved this in 2023-08-31
2023-09-05 16:37:39 -07:00
Frank Tang fab5faa3aa ICU-22479 Limit the collator_compare_fuzzer
Test only first 4K bytes of data, which means compare two
UnicodeString each with 1024 Unicodes at most.

Avoid finding timeout issue due to large amount of data.
2023-09-05 14:10:33 -07:00
Rich Gillam 21f74b3698 ICU-22455 Implemented algorithm in CLDR-16981 to preserve regional unit overrides when they don't conflict
with the ms subtag.
2023-09-05 16:52:18 -04:00
Frank Tang aa70ba6746 ICU-22479 Add a new fuzzer to test more Locale methods
See #2576
2023-09-05 12:08:39 -07:00
Mihai Nita 5fb2a6ad06 ICU-22324 Mavenization, updating the cldr-to-icu scripts and instructions 2023-09-05 10:24:23 -07:00
Frank Tang 869713b65f ICU-22479 Improve collator_compare_fuzzer
See #2574
2023-09-01 17:57:30 -07:00
Mihai Nita d501225db2 ICU-22477 Fix the performance tests after the maven folder changes 2023-08-31 19:38:20 -07:00
Elango Cheran af8dc57a1d ICU-22423 Use hashes instead of version tags for GH Actions 2023-08-31 08:13:43 -07:00
Mihai Nita 6afef81b5e ICU-22324 Fix copyright check
Unrelated but blocking the main PR, Mavenization step 2
2023-08-30 15:25:01 -07:00
Mihai Nita b3d542392c ICU-22324 Mavenization, step 2, change github / azure workflows 2023-08-30 15:25:01 -07:00
Mihai Nita c7f227b37f ICU-22324 Mavenization, step 2, reorg folders to maven structure 2023-08-30 15:25:01 -07:00
Pedro Kaj Kjellerup Nacht 95f25839f4 ICU-22423 Add scorecard.yml
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-08-30 15:11:50 -07:00
Frank Tang 35bae683a5 ICU-22475 Fix double free in Locale under OOM
See #2567
2023-08-30 12:35:15 -07:00
Frank Tang 02d5e71903 ICU-22342 Implement ExternalBreakEngineAPI
ICU-22342 Fix comments
2023-08-30 11:43:16 -07:00
Mihai Nita 2207e2c3df ICU-22324 Exclude tools/build from jdk > 8 2023-08-29 14:35:47 -07:00
Rich Gillam 0cc2d9ed4c ICU-22471 Bring ICU4J PersonNameFormatter up to date
- Bring in the latest version of the CLDR PersonNameFormatter test data.
- Fix PersonNameConsistencyTest to recognize the new “givenFirst” and “surnameFirst” keywords used in the test data files.
- Fix tokenization code in InitialModifier to use a BreakIterator.  Add unit test.
- Add support for the “retain” modifier.  Add unit test.
- Remove the “log known failure” logic for all of the PersonNameConsistencyTest data files that pass now.
2023-08-29 12:54:56 -04:00
Frank Tang 29a6ffc350 ICU-22365 call u_terminateChars in ULocale(Builder)? 2023-08-28 15:35:36 -07:00
Rich Gillam 8817c25c1e ICU-22449 Fixed SimpleDateFormat (in C++ and Java) to correctly honor the rg and hc subtags in the locale when choosing the hour cycle. 2023-08-28 13:30:45 -04:00
Frank Tang ea0dbd4c41 ICU-22462 Rename to PersonNameConsistencyTest
Rename ExhaustivePersonNameFormatterTest to PersonNameConsistencyTest
Always run. Paramaterize the test so each test file are run in their
own test case and report the failure/success separately
2023-08-24 11:45:27 -07:00
Frank Tang 706044b0a2 ICU-20777 Remove the generation of likelySubtags.res 2023-08-23 15:47:50 -07:00
Robin Leroy f79fe9347a ICU-22332 bidiSkeleton and LTR- and RTL-confusabilities 2023-08-23 15:56:02 +02:00
Mihai Nita fb0f36203a ICU-22324 Small fixes for script moving folders to maven structure
- Symlinks to LICENSE, so that it is included in the .jar files
- Fixed version in the jar manifests (s/73/74/)
- Added Main-Class, Export-Package, some *-Title and *-Description

At this point the .jar files (including manifests) produced by ant / maven
are byte to byte identical, except for some small differences that are
expected and can be explained (will cover them in the email to the team)
2023-08-22 16:19:43 -07:00
Peter Edberg 2270c174a5 ICU-22325 CLDR release-44-alpha1 to main:
- binaries, binary-as-source, CLDR data sources;
  - CLDR test data & dtd, ICU lib/tool/test source updates.
2023-08-22 14:40:51 -07:00
Frank Tang 5d6d197a03 ICU-22466 Fix incorrect memory read while the locale is bogus
ICU-22466 Fix illegal read

ICU-22466 Fix memory issue
2023-08-22 09:22:12 -07:00
Frank Tang 667ee72b7c ICU-22457 count() of getUnicodeKeywords is incorrect
The count() is incorrect if the Locale contains extension which is not -u-
for example -x-, -t-.

Currently, this PR only contains tests to show the problem.

ICU-22457 Fix the enum_count
2023-08-21 14:44:10 -07:00
Rich Gillam 52177cc8c7 ICU-22364 Modify ulocimp_getRegionForSupplementalData() to ignore the subdivision code, rather than requiring it to
be "zzzz".
2023-08-21 14:06:00 -04:00
Steven R. Loomis 248b1c2a13 ICU-22309 update to LICENSE v3, Readme.md, CONTRIBUTING.md
- LICENSE is now the v3 license with the correct year and title
- README.md now has the required features and drops Terms of Use
- CONTRIBUTING.md now matches the updated language
2023-08-21 11:48:04 -05:00
Fredrik Roubert 1fc560c07f ICU-22465 Change .s to .data() for replacing TinyString with CharString.
This was forgotten by ICU-7496 which replaced the local TinyString data
type with the shared CharString data type, but as it's in code heavily
nested in #ifdef's it hasn't been noticed until now.
2023-08-21 15:57:20 +02:00
Mihai Nita a7a2fdbcf2 ICU-22324 Script moving folders to maven structure 2023-08-18 20:58:16 -07:00
Frank Tang ffc449de62 ICU-20777 Merge the likelySubtags implemention
Change testdata/likelySubtags.txt to consider FAIL line

ICU-20777 Fix Java Tests

ICU-20777 Fix all issues

ICU-20777 Incase timeout

ICU-20777

ICU-20777 Skip Data Driven test
2023-08-18 09:35:54 -07:00
Frank Tang 27181e36a6 ICU-22435 Add C API for Locale
See #2531
2023-08-17 12:15:47 -07:00
Markus Scherer 81a6edb287 ICU-22404 Unicode 15.1 data 20230811 plus UTS46 fix 2023-08-16 14:25:22 -07:00
yumaoka 6338b704ff ICU-22452 API for resolving preferred IANA zone ID from a zone ID. 2023-08-11 17:00:05 -04:00
Rich Gillam d91859de21 ICU-22363 Add copyright notices to new QNX build files 2023-08-11 12:44:28 -07:00
James Choi b70b2d0433 ICU-22363 Add support for QNX 7.1
Signed-off-by: James Choi <chachoi@blackberry.com>
2023-08-10 17:46:01 -07:00
Rich Gillam ca3fd47f4c ICU-22402 Add options to PersonNameFormatter and update nativeSpaceReplacement logic 2023-08-10 15:15:49 -07:00
Peter Edberg cc2ddc0d11 ICU-22325 Convert cldr-icu-readme to md, update it, point to it from older docs 2023-08-10 14:03:06 -07:00
Robin Leroy a6fc915e05 ICU-22404 Strip default ignorable code points in the skeleton for confusable detection 2023-08-10 17:55:14 +02:00
Robin Leroy 86193b1b98 ICU-22404 Improve documentation of segmentation rules 2023-08-10 03:01:20 +02:00
Frank Tang ca1435c3ea ICU-22453 Fix non null terminated buffer issue.
See #2543
2023-08-09 15:36:04 -07:00
Rich Gillam 56850c9a42 ICU-22402 Add support in ICU and in the CLDR-to-ICU tool for the new nativeSpaceReplacement and parameterDefault
resources for PersonNameFormatter in CLDR. Regenerated the ICU4J data resources as well as the ICU4C resources
to include the new resources.
2023-08-08 14:42:02 -07:00
Robin Leroy 47e47ec439 ICU-22433 uppercase decomposed greek to decomposed greek and precomposed greek to precomposed greek. 2023-08-08 22:20:20 +02:00
Rich Gillam 720e5741cc ICU-22362 Fix build error in exhaustive tests resulting from last PersonName change. 2023-08-04 18:44:00 -07:00
Rich Gillam 89b952dffd ICU-22362 Fix the name order derivation code in PersonNameFormatter to match the CLDR spec. 2023-08-04 12:34:20 -07:00
Frank Tang 6ba5a1a1b7 ICU-22365 C API for ULocaleBuilder
See #2520

ICU-22365 Fix comments
2023-08-03 14:11:12 -07:00
Frank Tang 9511fff62a ICU-22407 Suppress Calendar Consistency
Similar to changes to C++ in
https://github.com/unicode-org/icu/pull/2298
2023-07-31 20:57:01 -07:00
Frank Tang d511cad90d ICU-22407 Implement Java Temporal Calendar API
See #2526
2023-07-28 18:17:38 -07:00
DraganBesevic 1f07d2b29f ICU-22325 Integrate CLDR 44.1 to ICU, add personName testdata, fix RBBITestMonkey 2023-07-28 16:53:50 -07:00
Frank Tang 19bac42f98 ICU-22446 Fix incorrect Hebrew ORDINAL MONTH bug 2023-07-27 22:18:00 -07:00
Frank Tang 73b61ceece ICU-22444 Remove "unknown" from Calendar.getKeywordValuesForLocale
Remove CalType enum value UNKNOWN and use null for unknown CalType
This value is an internal enum and the only place use it is inside Calendar.java
Use null for that instead (same as C++)
2023-07-27 17:07:01 -07:00
Frank Tang 03e98c04f3 ICU-22442 Sync the spelling of NEHASSA to ICU4J NEHASSE
ICU4J has that as part of public API but ++ is private
so we should sync to the ICU4J one.
2023-07-27 09:56:31 -07:00
Shane F. Carr 2238f1c2c1 ICU-20297 Improve discoverability of currency formatting 2023-07-23 09:23:13 -07:00
Rich Gillam 85e75ecc13 ICU-22304 Miscellanous PersonNameFormatter fixes; made ExhaustivePersonNameFormatterTest into a real unit test. 2023-07-20 10:52:37 -07:00
Pedro Kaj Kjellerup Nacht 281a2a77ec ICU-22350 Give maven.yml packages:write
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-07-20 08:12:16 -07:00
Jiawen Geng c7e967c456 ICU-22401 fix build on MSVC with cpp20 2023-07-14 14:31:40 +02:00
2e45e6ec0e ICU-22404 Unicode 15.1 beta data files & API constants
See #2492

Co-authored-by: Andy Heninger <andy.heninger@gmail.com>
Co-authored-by: Robin Leroy <egg.robin.leroy@gmail.com>
2023-07-13 19:26:14 -07:00
Frank Tang 5826bf7ed7 ICU-22434 Not calling setFirstDayOfWeek(MONDAY) if the locale has fw
The Calendar constructor already take care of the fw override.
We should not set the first day of week for iso8601 to Monday if
we have a fw keyword/type in the locale.

ICU-22434 Fix incorrect calendar keyword extraction
2023-07-13 09:49:32 -07:00
Shane F. Carr 034a808604 ICU-20898 Improve number skeleton rounding increment docs
See #2475
2023-07-13 18:41:05 +02:00
Peter Edberg 70d308731a ICU-22325 BRS 74 front-load update version to 74.0.1 2023-07-10 16:45:41 -07:00
Jake Wharton cd6ff4a64d ICU-22425 Eliminate double map lookup for common case of present argument
In the uncommon case where the map lookup returns null, only then perform a second map lookup to determine whether it was an absent value or explicit null.
2023-07-06 17:17:49 +03:00
Frank Tang 1b15a4e9db ICU-22424 Fix Calendar::clear(UCAL_MONTH)
Make the calling of clear(UCAL_MONTH or UCAL_ORDINAL_MONTH) clear both fields.
2023-06-30 00:48:34 -07:00
Jake Wharton adbcfb1e07 ICU-22426 Do not create nested StringBuilder when appending 2023-06-29 15:01:24 -07:00
Frank Tang f1b13a850a ICU-22354 Revert benchmark-action changes
Revert the change of benchmark-action in
https://github.com/unicode-org/icu/pull/2428 which cause
post merge test brekage.

See https://github.com/unicode-org/icu/actions/runs/5393383252/jobs/9793048045
for the problem
2023-06-27 14:53:04 -07:00
Mohammed Keyvanzadeh b575f7c8f5 ICU-22354 Update actions and platforms in GitHub Actions workflows 2023-06-27 11:32:57 -07:00
Shane F. Carr 4a255c4301 ICU-21239 Improve docs for MeasureUnit default constructor 2023-06-27 11:27:25 -07:00
Victor Chang 83ee7e662f ICU-22390 Transliterator.<clinit> can be optimized - part 2
WIDTH_FIX instance could be lazily initialized, because it's used
only if transliterate() is called on the AnyTransliterator instance,
but apparently not used by other Transliterator instance.
2023-06-27 11:25:43 -07:00
Frank Tang a9f7570892 ICU-22412 Fix C API ucal_(g|s)etGregorianChange for iso8601 calendar
See #2510
2023-06-22 15:44:37 -07:00
Frank Tang 26bd70e301 ICU-22421 Remove two unused internal methods in gregorian cal
Remove pinDayOfMonth() and yearLength(int32_t year)
from GregorianCalendar.

These two methods are
1. Unused by any code inside ICU, not in source/{common,i18n,test}.
2. Marked as @internal in the header.
3. Wrap inside #ifndef U_HIDE_INTERNAL_API block in the header
4. In "protected:" section.
5. No ICU4J counterpart.

The yearLength(int32_t year) dup the functionality as
handleGetYearLength of the same class and that one is the correct one to
be keep and used..
There is another yearLength() w/o the year as parameter should NOT be
removed and still needed internally.
2023-06-22 15:44:05 -07:00
Frank Tang e83b0715a1 ICU-22368 Reduce ~200K langInfo.res size by encode LSR into 32bits int.
See #2458
2023-06-22 01:18:41 -07:00
Henri Sivonen 3fec4e718e ICU-22260 Allow relative datetime formatting without context adjustment with UCONFIG_NO_BREAK_ITERATION 2023-06-20 18:48:01 -07:00
Elango Cheran c94469b9a0 ICU-22323 Correct alt='ascii' paths, point Readme.txt to .md 2023-06-15 11:25:32 -07:00
Pedro Kaj Kjellerup NachtandMarkus Scherer 758099ab3b ICU-22410 Add security policy
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-06-14 13:54:42 -07:00
Frank Tang 9411a940ea ICU-22414 Fix bogus locale in collation res fallback 2023-06-14 11:30:00 -07:00
Fredrik Roubert e567b50df8 ICU-22389 Set STRIP_FROM_PATH to enable Doxygen out-of-source builds.
Without this flag, the full path to the source directory will be
included in the output generated by Doxygen.
2023-06-14 15:08:59 +02:00
Fredrik Roubert 53e0486855 ICU-22389 Add missing git lfs install to instructions. 2023-06-14 15:08:35 +02:00
Frank Tang f00ff4f5e3 ICU-22406 Add LIBRARY_DATA_DIR 2023-06-13 22:01:59 -07:00
Frank Tang ea7ed9a9db ICU-22406 passing -i to genrb
Passing -i to genrb to include ucadata.icu data in
--disable-shared build
2023-06-13 22:01:59 -07:00
Frank Tang e4eb997f41 ICU-22406 limit the configuration 2023-06-13 22:01:59 -07:00
Frank Tang ded6244035 ICU-22406 Fix test breakage w/ --disabled-shared 2023-06-13 22:01:59 -07:00
Pedro Kaj Kjellerup Nacht 7a101d68ea ICU-22350 Fix broken performance CI
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-06-13 16:41:39 -07:00
Elango Cheran bb758fd745 ICU-22323 Update cldr-to-icu converter readme for example with alts
See #2500
2023-06-13 11:29:52 -07:00
Shane F. Carr ceec2ee64b ICU-22405 Move coll_tree filter into data so it doesn't affect testdata 2023-06-12 17:41:06 -07:00
Peter Edberg 680f521746 ICU-22389 Cherry-pick CLDR 43.1 data from main to maint-73 (#2495) 2023-06-07 19:19:55 -07:00
Peter Edberg bc9909bacb ICU-22389 Cherry-pick from main to maint-73: CLDR release-43-1-beta2 to ICU main
(cherry picked from commit 388b768262)
2023-06-07 15:33:16 -07:00
Peter Edberg 22d4ba1037 ICU-22389 Cherry-pick from main to maint-73: CLDR release-43-1-beta1 to ICU main
(cherry picked from commit d205e03352)
2023-06-07 15:07:01 -07:00
Peter Edberg 388b768262 ICU-22325 CLDR release-43-1-beta2 to ICU main 2023-06-07 10:17:18 -07:00
Frank Yung-Fong Tang 1cede3cb3f ICU-22409 Update README.md for Maven build
See #2489
2023-06-06 16:35:15 -07:00
Pedro Kaj Kjellerup Nacht 2e3e49fed5 ICU-22350 Add minimal tokens to GitHub workflows
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-06-06 10:32:26 -07:00
Frank Yung-Fong Tang e2fde33b4b ICU-22396 Fix tool until ICU4J add Temporal Calendar API
See #2488
2023-06-05 15:26:53 -07:00
Markus Scherer f4234577ad ICU-22404 initial changes.txt for Unicode 15.1
See #2490
- copy 15.0 change log to the top, unchanged
- adjust changes.txt for 15.1, incl. diffs from CLDR 43 root collation update
2023-06-04 20:16:39 -07:00
Mihai Nita 228f2f5c46 ICU-22378 Fix temperature format ignoring -u-mu-fahrenhe 2023-06-01 11:28:17 -07:00
Manish Goregaokar fe042bdc0d ICU-22403 Fix icuexportdata out-of-bounds during decomposition 2023-06-01 08:51:28 -07:00
Manish Goregaokar 7d0d24e7da ICU-22372 Fix headers in icuexportdata 2023-06-01 08:47:31 -07:00
yumaoka 1119ae4885 ICU-22333 Exclude EhaustivePersonNameFormatterTest also from releaseJarCheck target. 2023-06-01 11:39:40 -04:00
Victor Chang a18c8f83e3 ICU-22390 Speed-up ICU4J Transliterator.<clinit>
It reduces the method runtime by approx. 60%.
2023-06-01 05:32:56 -07:00
JALAJ HARKAWAT 90d7ea8196 ICU-22389 BRS73: Update version number to 73.2 2023-06-01 14:52:29 +05:30
Elango Cheran 5435007e6a ICU-21697 Convert ICU Site pages to markdown for Github Pages
See #1785
2023-05-30 16:18:32 -07:00
Shane F. Carr de26ea8c6a ICU-22322 Revert extra parallelism for data-filter test in .azure-pipelines.yml
See #2471
2023-05-26 13:39:11 -07:00
Manish Goregaokar 8bbb8f506e ICU-22403 Fix icuexportdata out-of-bounds during decomposition 2023-05-26 13:27:55 -07:00
Peter Edberg 130bdd4748 ICU-22357 Update gb18030 mappings for the -2022 version
(cherry picked from commit 7f5d679a98)
2023-05-26 12:34:06 -07:00
Nicholas Vinson 0fb1b5588e ICU-22377 Fix va_end errors found by gcc -fanalyzer
Fixes missing call to ‘va_end’ errors.

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
2023-05-26 15:50:21 +02:00
Rich Gillam b5f8aaf010 ICU-22379 Update ICU PersonNameFormatter to match the spec change requested by CLDR-16623
(cherry picked from commit 11f85eb4c219aa9138abd408077f00664e8496e5)
2023-05-25 17:44:10 -07:00
Rich Gillam 5ef4fa2989 ICU-22379 Update ICU PersonNameFormatter to match the spec change requested by CLDR-16623 2023-05-25 16:43:33 -07:00
Manish Goregaokar 43cd3ce647 ICU-22372 Fix headers in icuexportdata 2023-05-25 10:09:07 -07:00
Peter Edberg 8d2c78d160 ICU-22357 Rename gb18030.ucm to add -2022, follow-on to PR #2430 2023-05-25 09:25:35 -07:00
Fredrik Roubert 18182903cd ICU-22356 Use ConstChar16Ptr to safely cast from UChar* to char16_t*.
This is necessary for this header file to be usable by clients that
define UCHAR_TYPE as a type not compatible with char16_t, eg. uint16_t.
2023-05-18 10:47:55 -07:00
Peter Edberg 7f5d679a98 ICU-22357 Update gb18030 mappings for the -2022 version
See #2430
2023-05-18 08:51:47 -07:00
Peter Edberg 6e72d90866 ICU-22360 revert portions of #2159 which included @ in ALetter for wordbreak, update tests
(cherry picked from commit 5618203821)
2023-05-12 13:04:33 -07:00
Norbert Runge ba1c7006b7 ICU-22384 Limit execution of performance tests
Run the tests only on the main branch of the unicode-org/icu repository. This avoids diluting the performance charts with performance results from the maintenance branches. Also, the performance tests won't execute on forked directories anymore, on which they fail after execution anyway, thus using GitHub resources without purpose.
2023-05-11 23:02:31 -07:00
Peter Edberg d205e03352 ICU-22325 CLDR release-43-1-beta1 to ICU main 2023-05-10 18:08:25 -07:00
Fredrik Roubert e1e1c5feaf ICU-22349 Use -l with make -j to limit jobs based on load average.
It has been proposed that make running too many parallel jobs recently
has led to resource exhaustion in our CI, so that some kind of limit
would be helpful to set.

The load average 2.5 limit choosen here is simply the limit used as an
example in the make documentation, as we don't really have any way of
picking an initial value that's certain to be better.

https://www.gnu.org/software/make/manual/html_node/Parallel.html

See #2421
See #2422
2023-05-11 00:50:59 +02:00
Peter Edberg 5618203821 ICU-22360 revert portions of #2159 which included @ in ALetter for wordbreak, update tests 2023-05-06 21:36:46 -07:00
Victor Chang 530ca98176 ICU-22371 Fix ULocale.getISOLanguages() API docs 2023-05-03 11:13:32 -07:00
Mihai Nita 00bb6789b3 ICU-22323 Remove broken link from the Chinese Calendar documentation 2023-05-03 10:51:22 -07:00
Mihai Nita 0e4b10b112 ICU-22378 Fix temperature format ignoring -u-mu-fahrenhe 2023-05-03 09:24:53 -07:00
Robert Bastian 6342f9140a ICU-22373 Export segmentation dictionaries
(cherry picked from commit 6c05042cbc)
2023-05-02 10:45:59 -07:00
Robert Bastian 6c05042cbc ICU-22373 Export segmentation dictionaries 2023-05-02 07:29:27 -07:00
Shane F. Carr 62f493827f ICU-22369 Merge maint/maint-73 into main (#2437) 2023-04-27 16:19:55 -07:00
Fredrik Roubert 4fd9d6ce9a ICU-22356 Use ConstChar16Ptr to safely cast from UChar* to char16_t*.
This is necessary for this header file to be usable by clients that
define UCHAR_TYPE as a type not compatible with char16_t, eg. uint16_t.
2023-04-24 23:56:49 +02:00
Steven R. Loomis ec3aef8fec ICU-22309 update CONTRIBUTING.md for new process
- see https://github.com/unicode-org/.github/blob/main/.github/CONTRIBUTING.md
2023-04-24 13:55:48 -05:00
Frank Tang 5be2ea84e5 ICU-22349 Bump the cygwin timeout to 50 minutes 2023-04-20 19:32:34 -07:00
Fredrik Roubert 09f4459a77 ICU-22221 Add the -R flag to less to display ANSI colors.
Without this flag, any ANSI color escape sequences in the Maven error
log will be displayed in their escaped form, which isn't very readable.
2023-04-20 17:57:22 +02:00
yumaoka 295f0f2a43 ICU-22333 Exclude EhaustivePersonNameFormatterTest also from releaseJarCheck target. 2023-04-20 11:40:17 -04:00
Frank Tang 85fd7389e0 ICU-22349 Speed up pre-merge CI
See #2420
2023-04-19 08:06:59 +05:30
Shane F. Carr 2a2995951b ICU-20926 Add tests for identity behavior in DateIntervalFormat
See #2245
2023-04-17 14:57:50 -07:00
Steven R. Loomis 1e60df0f82 ICU-22341 commit checker: umbrella, explanations
- support Umbrella ticket type (no commits)
- explain why commit policy was applied
2023-04-13 12:20:12 -05:00
Frank Tang 4b515504fd ICU-22349 Build cygwin with -j to run multiple cores
See #2421
2023-04-13 11:48:01 +05:30
rp9-next 12c5fe04c0 ICU-22351 Update PGP key information for release signing 2023-04-13 08:17:47 +05:30
Frank Tang cbb25bb186 ICU-22349 Change to use just -j value in make to "not limit the number of jobs that can run simultaneously"
See #2422
2023-04-12 15:47:06 -07:00
Steven R. Loomis 312bae8660 ICU-21964 use a single LICENSE file
- make the icu4c and icu4j LICENSE files symlinks
- fix paths
2023-04-12 14:36:09 -05:00
Peter Edberg 5861e1fd52 ICU-22221 update cldr-icu instructions, and ICU tag for integration 2023-04-11 11:38:40 -07:00
Rahul Pandey 69e1d707f8 ICU-22221 BRS73GA: Update version number to 73.1 2023-04-11 15:46:18 +05:30
Markus Scherer 0d2a03dbba ICU-22338 getProperty(Value)Name accepts nameChoice above 1 2023-04-10 17:50:12 -07:00
Steven R. LoomisandMarkus Scherer 58c674a72e ICU-22309 update CONTRIBUTING.md
- fix broken links
- move all content into CONTRIBUTING.md from https://icu.unicode.org/processes/contribute
- no process change

Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-04-10 12:23:25 -05:00
Peter Edberg 80f94a636e ICU-22221 CLDR release-43-beta5 to ICU maint/maint-73 2023-04-07 11:15:47 -07:00
Rich Gillam 7d4e57dff1 ICU-22340 Fix it so that UNUM_NUMBERING_SYSTEM again always returns a RuleBasedNumberFormat.
(cherry picked from commit c702950294)
2023-04-07 10:13:51 -07:00
Markus Scherer f4687fc25a ICU-22221 update root collation again from CLDR 43 2023-04-06 08:20:03 -07:00
Frank Tang 981c182a7f ICU-22297 Speed up valgrind tests
Remove the valgrind build in azure pipeline which is slow (about 50-75
mins to run) and replace with a set in github action that run 17
testing jobs in parallel to speed it up to about 25 mins the longest.
2023-04-05 16:42:32 -07:00
Peter Edberg 2c584abf7e ICU-22221 rebase CLDR 43-beta4 import onto latest maint/maint-73 (new zoneinfo64) 2023-03-30 15:43:22 -07:00
Peter Edberg c125cf67f0 ICU-22337 restore strict parsing length tolerance for non-abutting numeric date fields 2023-03-30 13:52:40 -07:00
Fredrik Roubert 95d905a9e9 ICU-22190 Add information about the KEYS file to the Publish document. 2023-03-30 14:06:15 +02:00
Rich Gillam c702950294 ICU-22340 Fix it so that UNUM_NUMBERING_SYSTEM again always returns a RuleBasedNumberFormat. 2023-03-29 16:31:55 -07:00
yumaoka 9f774e2b8c ICU-22339 Update ICU tzdata to 2023c for ICU 73.1 release 2023-03-29 17:31:51 -04:00
Craig Cornelius dfdf9141e5 ICU-22220 Add step for updating API Doc table
See #2400
2023-03-29 11:25:39 -07:00
Markus Scherer 22bbc7e12e ICU-22308 add alignas(16) to the data entry point definition
not just to its struct declaration.
2023-03-28 14:20:21 -07:00
Elango Cheran 3867acf109 ICU-22330 build and test ICU4J with Java 17 2023-03-24 14:00:02 -07:00
yumaoka a6e9f51859 ICU-22334 Update ICU tzdata to 2023b for ICU 73.1 release 2023-03-24 16:23:50 -04:00
Ho Cheung 84e4762069 ICU-22295 Remove deprecated RBBI LBCMNoChain option
ICU-22295 Remove deprecated RBBI LBCMNoChain option

ICU-22295 Remove deprecated RBBI LBCMNoChain option
2023-03-24 12:59:44 -07:00
yumaoka b31579920e ICU-22327 Update tzdata to 2023a 2023-03-23 13:56:40 -04:00
Steven R. Loomis 4b5a6edc95 ICU-21755 commit-checker: update Tip
- improve recommendation on no-commit-found case for ICU and CLDR
- for CLDR-15423
2023-03-23 11:16:25 -05:00
Elango Cheran cb65f75739 ICU-22220 BRS 73rc ICU4J Serialization test data for ICU 73.1 2023-03-23 08:45:38 -07:00
Elango Cheran 4a30076686 ICU-22220 BRS 73rc ICU4J API signature data file 2023-03-23 08:45:26 -07:00
Elango Cheran bfa5f4e6ae ICU-22270 Fix hex number formatting in icuexportdata 2023-03-22 20:02:57 -04:00
Yoshito Umaoka 6ddf63ed92 ICU-22220 BRS73 Fix API doc tagging problems 2023-03-22 19:41:42 -04:00
Rahul Pandey 68f5ef835b ICU-22220 BRS73RC Regenerate configure files and fix broken links in comments 2023-03-22 12:38:41 +05:30
Yoshito Umaoka 49e8b99296 ICU-22220 BRS73 Clean up Java import statements 2023-03-21 15:35:52 -04:00
Shane F. Carr fa5a6c1519 ICU-22288 Remove unnecessary assertion in ICU4J NumberRangeFormatter
See #2377
2023-03-21 12:34:34 -05:00
Peter Edberg e612a4f2ab ICU-22220 BRS 73rc update urename.h pass 2 2023-03-20 13:32:31 -07:00
Craig a518312ce2 ICU-22220 Add usimplenumberformatter and SimpleNumberFormatter to docmain.h 2023-03-17 21:03:29 -07:00
Craig 21581f4ec5 ICU-22220 ICU 73 API Changes 4J & 4C 2023-03-17 11:56:41 -07:00
Kirill A. Korinsky f2459c16dc ICU-22211 macOS PPC should use .p2align 4 instead .balign 16
An attempt to build ICU on old macOS with PowerPC leads to an issue:
```
./out/tmp/icudt72b_dat.S:7:Unknown pseudo-op: .balign
./out/tmp/icudt72b_dat.S:7:Rest of line ignored. 1st junk character valued 49 (1).
```

Why? Because `as` is too old.

Anyway, switch back to `.p2align` fix a build and allows to pass all tests.

See: https://trac.macports.org/ticket/66258

Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
2023-03-17 09:10:21 -07:00
Rahul Pandey 3076874c32 ICU-22301 Add azure CI tests to be run post merge
See #2363
2023-03-17 08:57:01 -07:00
Peter Edberg 70ed5b4702 ICU-21940 DateFormatSymbols::assignArray should handle null srcArray 2023-03-17 08:52:19 -07:00
Markus Scherer 74641a344e ICU-12725 adjust API docs for new impl != JDK 2023-03-17 08:48:42 -07:00
Peter Edberg dd1d4de29b ICU-21653 utext_current32 should handle access callback that changes chunk size 2023-03-17 08:45:00 -07:00
Markus Scherer 34eaffc668 ICU-22308 stubdata empty pointerTOC alignas(16) 2023-03-17 08:11:26 -07:00
Rahul Pandey 7a670998b0 ICU-22220 BRS73RC Update version number and regenerate configure v73.1
See #2375
2023-03-17 09:48:06 +05:30
Frank Tang 3d31e72633 ICU-22307 Fix crash inside TimeZone
Return while the status fail without checking and cause crash
2023-03-16 17:05:02 -07:00
Peter Edberg cdeae44c6b ICU-10297 Add tests showing that display name bug in ticket no longer exists 2023-03-16 15:31:12 -07:00
Peter Edberg d73b4417e1 ICU-22186 Add unit tests for Croatia currency change from HRK to EUR 2023-03-16 14:49:42 -07:00
Markus Scherer 0684f8644c ICU-22285 how to include gb2312 & big5han collation tailorings 2023-03-16 14:14:38 -07:00
Craig Cornelius 3b030512ff ICU-22220 Update ICU4J samples instructions
See #2360
2023-03-16 08:39:14 -07:00
Peter Edberg 3db74e8ae7 ICU-22220 CLDR release-43-beta2 to ICU main 2023-03-15 20:52:34 -07:00
Elango Cheran 06506023c5 ICU-22194 Add CI job to generate Github Pages using Github Actions 2023-03-15 20:00:06 -04:00
L. E. Segovia 62375dca3a ICU-22205 toolutil: Fix MASM generation for x86-64 and ARM64 2023-03-15 16:48:54 -07:00
L. E. Segovia 167f8855a2 ICU-22210 toolutil: Add NASM generator 2023-03-15 16:42:09 -07:00
Ivan Tymoshenko 2c46fb7f61 ICU-22286 Speed up substring equality comparison 2023-03-15 11:10:48 -07:00
Alan Zhao 7ed7d42f58 ICU-22298 Include <utility> in measunit.h
measunit.h uses std::pair, std::make_pair, and std::move, all of which
are declared in the <utility> header. This still compiles because many
implementations of the C++ standard library have <utility> as a
transitive dependency of other C++ standard library headers; however,
these transitive includes are not guaranteed to exist and will not exist
in some contexts (e.g. building against LLVM's libc++ with -fmodules).
2023-03-14 17:08:53 -07:00
Markus Scherer 2d9fa3fa99 ICU-22285 omit the gb2312 & big5han collation tailorings by default 2023-03-14 15:20:03 -07:00
Mihai Nita 97510de5d4 ICU-22280 Replace markdown in javadoc with proper tags 2023-03-14 12:48:58 -07:00
Mihai Nita b399c67d5a ICU-12811 Fix cldrUtils (add ElapsedTime and UnicodeMap*) 2023-03-14 12:39:13 -07:00
Peter Edberg 2c20fa45fb ICU-22220 CLDR release-43-beta0 to ICU main 2023-03-14 09:53:14 -07:00
Shane F. Carr 2a9d0ccdb2 ICU-22283 Add additional ERoundingMode variants
See #2329
2023-03-14 00:51:42 -07:00
Elango CheranandMarkus Scherer 64b4cde663 ICU-22256 Add helper code to dump Bidi_Mirroring_Glyph data to file
Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-03-13 18:59:19 -04:00
shenleban tongying ed011f2e31 ICU-22247 remove historical mention of old versions 2023-03-13 14:05:21 -07:00
Mihai Nita a36619060c ICU-22279 Fix invalid new Locale in testing 2023-03-09 22:19:44 -08:00
Markus Scherer 57e4b0cd17 ICU-22299 deprecate redundant UnicodeSet.CASE 2023-03-09 08:40:08 -08:00
Rich Gillam e5854c84a1 ICU-22265 Update PersonNameFormatter and its associated classes so that the behavior matches that of the
PersonNameFormatter in CLDR.  Added a new test that tests the ICU PersonNameFormatter against a comprehensive
set of test results from the CLDR PersonNameFormatter.
2023-03-08 13:56:17 -08:00
Yoshito Umaoka 9e16711b54 ICU-22220 BRS73 Updating the Unicode data files and software license 2023-03-06 22:31:39 -05:00
Manish Goregaokar be6428690d ICU-22270 expose uproperty values in icuexportdata 2023-03-06 20:13:55 -05:00
Craig Cornelius 2b714406eb ICU-22220 Add a step to instructions and fix an obsolete path.
See #2348
2023-03-06 19:29:02 +00:00
Peter Edberg 3748ef8f8a ICU-22220 adjust #ifndef U_HIDE_DRAFT_API for virtual methods, fix conditionalized enums 2023-03-06 11:01:50 -08:00
Craig bca85d4641 ICU-22220 Update ICU4J API status 2023-03-04 02:18:24 +00:00
Craig Cornelius 5c07ee700b ICU-22220 ICU4C APIChangeReport for ICU73
See #2347
2023-03-04 02:17:48 +00:00
Craig 461ec392a5 ICU-22220 ICU4J API change report 2023-03-03 19:47:31 +00:00
Rich Gillam 797a01ee2b ICU-22287 Move PersonName/PersonNameFormatter API from Tech Preview to @draft 2023-03-02 11:22:09 -08:00
Markus Scherer b6dcc95d3c ICU-21833 remove redundant void parameter lists
See #2351
2023-03-02 09:31:57 -08:00
Markus Scherer 79ab90b5f9 ICU-6065 UnicodeSet::closeOver(simple case folding)
See #2322
2023-03-02 08:12:57 -08:00
Markus Scherer 2864379937 ICU-21833 replace U_NOEXCEPT with C++11 standard noexcept 2023-03-01 15:24:34 -08:00
Markus Scherer d8e80fea88 ICU-21833 remove pre-C++11 code; U_SIZEOF_UCHAR=2 2023-03-01 15:23:34 -08:00
Frank Yung-Fong Tang 80414a247b ICU-22224 Enable UBSAN and fix breakage
See #2324
2023-02-27 17:31:49 -08:00
Peter Edberg 18f6a3a6e2 ICU-22220 CLDR release-43-alpha2 to ICU main 2023-02-27 11:09:02 -08:00
Rob De Reycke e8bc04d5df ICU-21386 uprv_tzname() should find the correct Olson ID when /etc/localtime is a "double" link
See #2323
2023-02-25 16:48:43 -05:00
Manish Goregaokar d3c94cc062 ICU-22270 Use hex for mask properties 2023-02-24 14:06:31 -08:00
Manish Goregaokar 0f4e084208 ICU-22270 Add support for General_Category_Mask in icuexport 2023-02-24 11:42:13 -08:00
Markus Scherer d86b1cebe1 ICU-22220 update root collation from CLDR 43 2023-02-22 17:13:13 -08:00
Fredrik Roubert ea2cb8549e ICU-21833 Replace U_FINAL with final everywhere. 2023-02-22 22:39:41 +01:00
Frank Yung-Fong Tang c3b8ffa11e ICU-22291 doc automate "Test samples (C) on Linux"
Just realize the task is already automated in 
.github/workflows/icu_ci.yml
as "icu4c-test-samples:" but we should document that.
2023-02-22 11:41:18 -08:00
Peter Edberg f924741bf2 ICU-22220 BRS 73rc update urename.h pass 1 2023-02-22 10:30:25 -08:00
Fredrik Roubert a3cbe80909 ICU-21833 Replace U_OVERRIDE with override everywhere. 2023-02-22 18:28:07 +01:00
Mihai Nita 015222105a ICU-12811 Refactor test-framework to not depend on core
Fixing the maven-build projects
2023-02-21 14:16:19 -08:00
Peter Edberg d469e628f3 ICU-22220 CLDR release-43-alpha1 to ICU main 2023-02-21 11:39:48 -08:00
Elango Cheran bd065d4704 ICU-22220 Automate BRS tasks
See #2318
2023-02-15 21:18:58 -05:00
Frank Yung-Fong Tang a4c6b2a359 ICU-22262 Document environment test automation 2023-02-15 16:53:02 -08:00
Frank TangandMarkus Scherer cb87c0893b ICU-22269 Parallelize uconfig* tests
1. Shorten job name uconfig_variation-check-unit-tests to uconfig-unit-tests
2. Shorten job name uconfig_variation-check-all-header-tests to uconfig-header-tests
3. use 11 jobs to run each of them in parallel to reduce the ~1hrs run to about 6-8 mins

Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-02-15 16:52:14 -08:00
Frank Yung-Fong Tang 331172f0a3 ICU-22262 Automate environment test
See #2309
2023-02-15 15:24:19 -08:00
Markus Scherer c91c2fbdc5 ICU-22257 BRS doc: J with little-endian data automatic since ICU 70 2023-02-13 17:12:04 -08:00
Mihai Nita 461bcef128 ICU-22194 Fix javadoc error (self-closing element not allowed) 2023-02-13 16:30:28 -08:00
Frank Yung-Fong Tang 47b321f1fa ICU-22277 correct collation error return of uninitialized length value while previous code return error
See #2320
2023-02-13 14:24:33 -08:00
Frank Tang 32bc47eefe ICU-22257 Revert PR 2302
Since the same work has been done in PR 1884 before.
2023-02-13 12:37:11 -08:00
Elango Cheran b20c97009c ICU-22194 Add User Guide doc for MessageFormat 2.0 tech preview impl
See #2313
2023-02-10 21:17:59 -05:00
Rich Gillam 288c4c7555 ICU-22220 ICU 73 API promotions (promoting ICU 71 and earlier) 2023-02-09 16:44:56 -08:00
Manish Goregaokar 9f108554af ICU-22270 icuexportdata: Add property and property value names/aliases 2023-02-09 15:44:48 -08:00
Elango Cheran f1e02f149f ICU-22194 Update DateTime skeleton docs with link to symbols table 2023-02-09 11:34:53 -05:00
Frank Tang 3f093b602a ICU-22266 update OS version to 22.04 from 18.04
Update configuration in main/.ci-builds from the deprecated 18.04
to the newest 22.04

Since vangrind has issue under 22.04 use 20.04 for vangrind for now.

Also use apt-get instead of apt since apt does not have a stable
commandline interface.
2023-02-08 13:43:14 -08:00
Markus Scherer 39dfee39b8 ICU-22257 BRS doc: J with little-endian data automatic 2023-02-06 17:52:40 -08:00
Frank Tang 638acd0c38 ICU-21374 Add a CFI build bot for ICU4C
Add the github action bot to build with cfi
Also fix all the known issues which require the change from C style cast to
static_cast inside the i18n and common directory while we are sure about
the object. and use
C++ style dynamic_cast for base-to-derive cast in other code inside i18n
and common and in test code or tool.
Change to use const_cast for casting between const / non-const
2023-02-06 15:47:14 -08:00
Peter Edberg 87fc840bf7 ICU-22220 CLDR release-43-alpha0 (with SurveyTool data) to ICU main 2023-02-06 14:46:14 -08:00
Frank TangandMarkus Scherer 0264f411b8 ICU-22257 Add "Test ICU4J with only little-endian ICU4C data"
Automate "Test ICU4J with only little-endian ICU4C data" as stated in
https://unicode-org.github.io/icu/processes/release/tasks/integration.html#test-icu4j-with-only-little-endian-icu4c-data

Update .ci-builds/.azure-exhaustive-tests.yml

Co-authored-by: Markus Scherer <markus.icu@gmail.com>
2023-02-06 14:32:33 -08:00
Fredrik Roubert 9fd2742dfa ICU-21833 Replace UChar with char16_t in C++ code. 2023-02-06 21:53:20 +01:00
Fredrik Roubert 2de88f9d9c ICU-21833 Replace UChar with char16_t in all C++ code. 2023-02-06 19:27:44 +01:00
Rich Gillam 08f14db4c4 ICU-22249 Fixed endless loop in ICUResourceBundle when you ask for a locale with a nonstandard parent and that locale
is also the system default locale.
2023-02-03 16:49:24 -08:00
allenwtsu 3f05361b41 ICU-22100 Modify ML model to improve Japanese phrase breaking performance 2023-02-03 13:07:53 -08:00
Fredrik Roubert 5560ee8870 ICU-21833 Replace nullptr with 0 when assigning to UChar.
This bug was originally introduced by ICU-4844 which erroneously
assigned NULL to UChar (which happens to work, even though it's
conceptually wrong).
2023-02-03 22:04:36 +01:00
HanatoK fcd6e384bd ICU-22194 Change CharacterIterator.DONE to CharacterIterator::DONE in
doc

In C++, the enum inside a class should be accessed by "::" instead of
".".
2023-02-03 12:01:51 -08:00
Fredrik Roubert 2e0d30cfcf ICU-21833 Replace NULL with nullptr in all C++ code. 2023-02-03 20:20:38 +01:00
Frank Tang a47717934a ICU-22252 Suppress Calendar Consistency
See #2298
2023-02-03 16:38:50 +01:00
allenwtsu 0b3b83a809 ICU-22100 Improve Japanese phrase breaking performance
See #2287
2023-01-31 00:29:41 -08:00
Mihai Nita 76df897b77 ICU-22226 Fix Calendar.getFirstDayOfWeek to honor -u-fw 2023-01-31 00:26:30 -08:00
Frank Tang de0a28644b ICU-22251 Move sprintf to snprintf.
See #2291
2023-01-25 23:23:29 -08:00
Frank Tang de9cb9a133 ICU-12725 Update u_isIDStart and u_isIDPart to TR31
ICU-12725 move to uprops.cpp

ICU-12725 change dependency

ICU-12725 Fix Java implementation
2023-01-25 12:02:53 -08:00
Frank Tang bb0e745e25 ICU-22058 make pointer argument in floorDivide optional
Check the third argument and not set if it is a nullptr
2023-01-18 20:24:48 -08:00
Frank Yung-Fong Tang da5b047dbe ICU-22242 Test to show incorrect calculation of 1890
See #2270
2023-01-18 12:05:34 -08:00
Frank Tang cd1b772cbf ICU-22027 Add C++ Calendar API for Temporal
API proposal
https://docs.google.com/document/d/1UYriEzzExiLhi2RD3zjTsI5UQHv1dXaFqrct7yXNdCA/edit#heading=h.x9obor85vpx9

Design Doc
https://docs.google.com/document/d/15ViyC9s0k3VEDwBmAkKxxz4IadZ6QrAIoETkdkF0cVA/

ICU-22027 Adjust API to remove the mention of M00L for now.
2023-01-17 15:08:08 -08:00
Elango Cheran a7f4531bfa ICU-12811 Fix localespi tests when run by Maven on Java 8
See #2283
2023-01-17 13:17:29 -08:00
Elango Cheran d4ac09edbd ICU-12811 Replace local-maven-repo with data jar contents
See #2275
2023-01-17 11:09:29 -08:00
Elango Cheran 1b292fa924 ICU-22233 Fix CI cache name for Bazel build 2023-01-17 10:50:47 -08:00
Elango Cheran e7530bd9ff ICU-12811 Fix CI cache retain workflow's cron schedule string 2023-01-13 14:57:51 -08:00
Elango Cheran 2007e135f1 ICU-12811 Add CI workflow to retain caches that are flaky/costly to init
See #2281
2023-01-13 12:36:48 -08:00
Shane F. Carr 89c1700424 ICU-22093 Polish for SimpleNumberFormatter
See #2277
2023-01-12 11:38:27 -06:00
Peter Edberg ad82a6693a ICU-22220 integrate root exemplarCities chnages for CLDR release-43-m0 to ICU main 2023-01-12 08:57:35 -08:00
Peter Edberg 8d411e9b6a ICU-22220 integrate CLDR release-43-m0 to ICU main for 73, update maven-build files 2023-01-10 11:32:24 -08:00
allenwtsu 80fb309c8a ICU-22100 Remove unicode blocks from Japanese ML phrase breaking
See #2278
2023-01-09 17:38:51 -08:00
Thomas Köppe 0c6d7fc98d ICU-22222 Add explicit instantiation declarations
We exclude these declarations from MSVC, where they don't work because
the don't interact well with the U_I18N_API import/export macros
2023-01-07 00:03:38 +00:00
Fredrik Roubert dcac8ac4c1 ICU-22233 Use separate Bazel cache keys per OS. 2022-12-22 14:43:22 +09:00
allenwtsu 90caafbcd4 ICU-22100 Incorporate BudouX into ICU (Java)
See #2214
2022-12-20 14:27:04 -08:00
dependabot[bot] 44480c4ba4 ICU-22193 Bump junit from 4.12 to 4.13.1 in /icu4j/maven-build
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

---
updated-dependencies:
- dependency-name: junit:junit
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 10:48:04 -08:00
Fredrik Roubert 82115c060f ICU-22193 Make clang-release-build-and-test work with ubuntu-latest.
Contemporary implementations of the C++ standard library also use the
@deprecated annotation in its header files and these then get included
by the preprocessor when preprocessing the ICU header files, like this:

  /// @deprecated Non-standard. Use `is_null_pointer` instead.

In order to work as expected, testtagsguards.sh must therefore be
updated to ignore @deprecated annotations unless they're for ICU.
2022-12-19 10:56:01 +09:00
Elango Cheran f6353aeedc ICU-12811 Make CI jobs for Maven run serially to avoid CI cache race condition 2022-12-17 12:59:35 -05:00
Fredrik Roubert 2a6f06cb4c ICU-22193 Make run-with-stubdata work with ubuntu-latest.
It remains unknown when and why this changed, but nowadays the required
data files are to be found in a subdirectory named "build".
2022-12-16 10:06:32 +09:00
Elango Cheran 45e98d4f67 ICU-12811 Build ICU4J using Maven
See #2251
2022-12-15 00:48:31 +00:00
Elango Cheran 57c9313eb7 ICU-22193 Use Ubuntu 20.04 for jobs failing in migration to 22.04 2022-12-14 20:04:45 +00:00
Markus Scherer 0cbf969cf7 ICU-22193 fix some CI test failures 2022-12-13 11:18:44 -08:00
Peter Edberg 7e083e34fb ICU-22220 BRS73RC Update version number to 73.0.1 2022-12-04 21:14:41 -08:00
L. E. Segovia ba8e4087ca ICU-22203 Windows: enable C-code generation with overridden entry point 2022-12-02 11:45:09 -08:00
L. E. Segovia e7aad77f31 ICU-22204 toolutil: Fix crash when trying to generate MinGW assembly 2022-12-02 10:42:24 -08:00
Shuhei Iitsuka b6b7b045e9 ICU-22100 Incorporate BudouX into ICU (C++) 2022-12-02 10:11:06 -08:00
Manish Goregaokar d02b30fc3f ICU-20115 ICU4C: Move SimpleDateFormat over to SimpleNumberFormatter 2022-12-01 09:40:55 -08:00
yumaoka cecd19e9ba ICU-22217 TZ Database 2022g updates 2022-11-30 22:08:08 -05:00
Shane F. Carr a2854b615a ICU-22093 ICU4C: Add SimpleNumber and SimpleNumberFormatter
See #2241
2022-11-28 20:28:50 -08:00
Victor Chang 194236a1b4 ICU-22214 Fix set pointer to false in sprpdata.c 2022-11-28 14:48:18 -08:00
Frank Tang 3654e945b6 ICU-22201 Add test to verify ICU-22043 on Java 2022-11-21 17:42:16 -08:00
Frank Tang da5d3e0c5b ICU-22206 Fix unsafe mix of UBool
Fix "unsafe mix of type 'UBool' and type 'bool' in operation:
2022-11-18 10:36:55 -08:00
Eli Kobrin 8b7ef3d908 ICU-22198 Fix stack buffer overflow. 2022-11-16 11:29:32 -08:00
Frank Tang 9c1fb785b3 ICU-22164 Replace switch+getType with subclass
See #2215

fix
2022-11-11 14:49:16 -08:00
Frank Tang b0ab1171ad ICU-10752 Spread (s|g)etRelativeYear to subclass
Remove the switch statment implementaiton in
Calendar::(g|s)etRelatedYear
and move the code into each subclass as proper OOP style.
2022-11-09 13:18:24 -08:00
Markus Scherer b00562e989 ICU-22191 writesrc.cpp: enable PRI formatting constants on all compilers 2022-11-09 04:38:00 +00:00
Jungshik Shin 05dc2ac924 ICU-22119 Add lw=phrase for Korean using line_*_phrase_cj
brkitr/ko.txt is created to use line_*_.cj.txt for both
lw=phrase and lw != phrase cases for Korean. This is the simplest
way to fix ICU-22119 taking advantage of the fact that ICU
does not have a Korean dictionary so we don't have to worry about
adding the list of Korean particles to keep them attached to the
preceeding word.

The downside is that it only works when the locale is ko or ja while
it should work in any locale. Another is it makes ICU deviate from
CSS3 by using the same CJ (conditonal Japanese) rules for Korean as
well. However, CSS3 spec is wrong on that point and should be changed.
See https://unicode-org.atlassian.net/browse/CLDR-4931 .
2022-11-07 22:30:49 +00:00
Andy Heninger 67a7e2caf0 ICU-21180 RuleBasedBreakIterator, refactor init.
In class RuleBasedBreakIterator, refactor how object initialization is handled
by the various constructors, taking advantage of C++11's ability to directly
initialize data members in the class declaration.

This will simplify ongoing maintenance of the code by eliminating the need
to keep initialization lists synchronized with the class data members.
This is being done now in preparation for additional changes to fix problems
with the handling of memory allocation failures.
2022-11-02 16:25:41 -07:00
yumaoka 2d19377a8d ICU-22196 TZ Database 2022f updates 2022-11-01 20:21:18 -04:00
Markus Scherer 436f5a7df5 ICU-22194 runConfigureICU computer->compiler
@josephshen found that the help text here has the wrong word, and I dropped the ball on his PR #2217 :-(
2022-10-31 16:18:18 -07:00
Frank Tang 294b26eb7a ICU-22159 Merge inDaylightTime to Calendar
All the subclass implementation of inDaylightTime are the same
so just move to a base class implementation.
2022-10-31 08:42:51 -07:00
Frank Tang 9f3feed545 ICU-22160 clean up Calendar code
Remove unnecessary BuddhistCalendar::handleComputeMonthStart
Remove unnecessary include
2022-10-31 08:41:54 -07:00
Elango Cheran e0f2d491aa ICU-22194 Fix typo in doc for BreakIterator rules update 2022-10-28 14:37:49 -07:00
Sergey Fedorov 2b77e39fbb ICU-22191 writesrc.cpp: fix cinttypes header and place after C headers 2022-10-28 08:41:22 -07:00
Andy Heninger 866254ef12 ICU-21180 BreakIterator, change all NULL to nulptr
In the C++ break iterator code, change all use of NULL to nullptr.
This is in preparation for follow-on PRs to improve out-of-memory error handling
in Break Iterators, keeping use of nullptr consistent between old and new
or updated code.
2022-10-26 18:55:48 -07:00
Fredrik Roubert fbb4a5a167 ICU-22190 Update KEYS with additional signature data. 2022-10-24 12:39:23 -07:00
Fredrik Roubert d453c12bfa ICU-22190 Update KEYS with additional public key
See #2237
2022-10-21 02:13:32 +02:00
rp9-next 511b4111f2 ICU-22190 Add public PGP Key
See #2236
2022-10-20 23:29:13 +02:00
Shane F. Carr 649c5f0176 ICU-22189 Merge maint/maint-72 to main (#2235) 2022-10-20 13:53:44 -07:00
Peter Edberg ff3514f257 ICU-21958 integrate CLDR release-42-beta5 to ICU main for 72 2022-10-13 16:23:11 -07:00
gnrunge f949713ce8 ICU-22177 Replace angular brackets in include with double quotes. 2022-10-13 13:51:05 -07:00
Steven R. Loomis 954d999126 ICU-21755 commit checker: skip No Time To Do This
- also, verify that ALL resolutions are accounted for.
2022-10-13 12:05:17 -05:00
Steven R. Loomis 3650236abb ICU-21755 commit checker: section rewrite, summary count
- rewrite to semi modular code
- run the sections first, then get counts
- section counts in ToC, skip if empty
- many link improvements: linkify bugs and commits rather than separate lines
2022-10-13 12:05:17 -05:00
Steven R. Loomis 8ca2e06b72 ICU-21755 commit checker: add support for COMMIT_METADATA.md file
- new option, --commit-metadata= with path to metadata file
- new option, --fix-version=41 (used for SKIP sections)
- scaffolding for 'bad commits' list
- new module CommitMetadata with unit tests
- sample file format TEST_COMMIT_METADATA.md
- such commits are skipped
- refactored the commit skipping part (formerly used for cherry pick skips)
- add a report section for skipped commits
- add a cache for JIRA queries (for dev use): --cache-for-dev "/tmp/cldr-commit-cache" - optional
- add an 'excluded commits' section at the bottom
- make sure commit metadata is used to update ticket IDs and messages.
2022-10-13 12:05:17 -05:00
yumaoka 00a4cdbd5b ICU-22178 Update ICU tzdata to 2022e 2022-10-12 21:07:34 -04:00
yumaoka a620057d76 ICU-21958 BRS72 Updated ISO currency data URLs 2022-10-12 12:37:52 -04:00
Peter Edberg c6c01f4b79 ICU-21958 integrate CLDR release-42-beta4 to ICU main for 72 2022-10-11 19:44:30 -07:00
JALAJ HARKAWAT ea4fca604f ICU-21958 BRS72GA Update version number 2022-10-11 22:19:20 +05:30
Craig Cornelius c203003b17 ICU-21958 Revise C++ API Change reports
After updating icu4c displayoptions.h
2022-10-07 09:57:56 -07:00
Felipe Gasper ff4ecd9f50 ICU-22170 Fix typo in resource bundle documentation.
https://unicode-org.atlassian.net/browse/ICU-22170
2022-10-06 13:00:31 -07:00
Craig Cornelius be9a07907c ICU-21958 Fix typo in displayoptions.h documentation 2022-10-06 11:21:21 -07:00
Craig Cornelius 599ecdc4a1 ICU-21958 Improved process for Releasing ICU API Docs 2022-10-06 09:07:55 -07:00
Peter Edberg fe17bab2bb ICU-21958 integrate CLDR release-42-beta3 to ICU main for 72 2022-10-06 08:40:32 -07:00
yumaoka 702e529d31 ICU-22165 Update ICU tzdata to 2022d 2022-09-30 15:56:00 -04:00
Peter Edberg 49b08b414d ICU-21958 integrate CLDR release-42-beta2 to ICU main for 72 2022-09-29 10:12:36 -07:00
Markus Scherer e72233f8b7 ICU-21959 fix file-level doxygen issues 2022-09-27 15:58:43 -07:00
Rich Gillam e5980f1dcb ICU-22081 Fix table in PersonNameFormatter Javadoc. 2022-09-26 16:17:17 -07:00
Rich Gillam 2f07ce2c6c ICU-22158 Make TestAlgorithmicParentFallback() test more robust to different default locales. 2022-09-23 13:37:42 -07:00
Mihai Nita 123e5c1cd6 ICU-21957 Change the internal/deprecated javadoc tags 2022-09-22 16:31:38 -07:00
Peter Edberg 8f5529f30d ICU-20894 Add UserGuide info on date pattern chars B, b 2022-09-22 16:14:44 -07:00
Craig Cornelius 7c1f8d675b ICU-21957 update API Changes in ICU4C 72 2022-09-22 14:55:24 -07:00
Peter Edberg cd12cebb87 ICU-21879 Fix UserGuide link to info in Korean transliteration 2022-09-22 13:54:40 -07:00
Yoshito Umaoka ef706cddf1 ICU-21957 BRS72 ICU4J serialization test data 2022-09-22 16:49:16 -04:00
Yoshito Umaoka 306be3ddf6 ICU-21957 BRS72 J API signature file 2022-09-22 16:39:47 -04:00
Yoshito Umaoka b5acb0ffc2 ICU-21957 Fixed java compiler warnings 2022-09-22 16:37:56 -04:00
Peter Edberg 0c9d6f6b85 ICU-21957 Fix status tags for U_HIDDEN, unum_hasAttribute 2022-09-22 10:50:22 -07:00
yumaoka 329c95e3b9 ICU-21957 BRS72 Cleanup import statements 2022-09-22 08:07:12 -04:00
Craig Cornelius 4f707beade ICU-21957 Update ICU4J & ICU4C Change Reports BRS#19 and BRS#20
See #2193
2022-09-21 16:16:28 -07:00
Mihai Nita b23d6c1afe ICU-22124 Tag the default constructor of OrderedMap as internal/deprecated
ICU-22124 Tag the default constructor of OrderedMap as internal/deprecated

Fix for apireport, see #2193
2022-09-21 11:50:09 -07:00
Rahul Pandey b08e51fa91 ICU-21957 BRS72RC Update version number and regenerate configure 2022-09-21 12:06:18 +05:30
Younies Mahmoud dbfe830108 ICU-22122 Support Locale Tags (ms, mu and rg)
See #2182
2022-09-20 16:51:24 -07:00
Mihai Nita f5367befba ICU-22124 Update the MessageFormat v2 links to the main branch 2022-09-20 16:47:38 -07:00
Peter Edberg b403a10e51 ICU-21957 integrate CLDR release-42-beta1b to ICU main for 72 2022-09-19 14:43:59 -07:00
Peter Edberg e646ea23e9 ICU-20512 ICU4J: just add test of parse with empty curr symbol, code already works 2022-09-16 19:01:06 -07:00
yumaoka 17435c4533 ICU-22151 Update timezone-region supplementation mapping data for Jan Mayen and some others 2022-09-16 16:49:42 -07:00
Rich Gillam 498abf6961 ICU-21125 Improvements to resource fallback:
- Added code to use the parentLocales data in supplementalData.xml to determine the "parent locale ID" to use when
  the requested resource bundle is not present (ICU-21126).
- Added code to change the parent-chain search path to handle the script better (ICU-21125; algorithm was described
  in CLDR-15265):
  - The base search patch is now ll_Ssss_RR -> ll_RR -> ll_Ssss -> ll -> root
  - If the requested script is not the default script for the requested language and region, we automatically
    avoid fallbacks that will implicitly change the script.
- Added new code to the CLDR-to-ICU data generation tool to generate source code, and used it to generate the lookup
  tables for the new resource-fallback logic (we can't use the existing resource files for this, since that would
  involve opening a resource bundle while trying to open another resource bundle).  The data-generation stuff is
  intended to be generic enough to allow for us to generate more static data tables in the future.
- Commented out a few collator tests, and changed one resource bundle test, because they're incompatible with the
  new fallback logic (specifically, the default-script logic).
2022-09-16 14:26:50 -07:00
Shane F. Carr 9dc1c020a1 ICU-20512 Add extra matchers to handle empty currency symbols 2022-09-16 09:00:50 -07:00
Peter Edberg b734048799 ICU-21957 fix NumberFormatterSettings::unitDisplayCase status, remove FormattedNumber:getGender 2022-09-16 08:34:28 -07:00
Mihai Nita db59034793 ICU-22124 Adding a tech preview implementation of MessageFormat v2
See #2170
2022-09-15 10:32:13 -07:00
Peter Edberg 06259cc6c3 ICU-21957 integrate CLDR release-42-beta1 to ICU main for 72 2022-09-13 11:18:37 -07:00
Peter Edberg cfd99f3f3f ICU-22143 Increase COMPACT_MAX_DIGITS from 15 to 20, needed for new ja data 2022-09-12 17:17:19 -07:00
Markus Scherer 99dee47fb7 ICU-21959 add the uemoji feature to ICU Data Build Tool chapter 2022-09-12 08:57:06 -07:00
Kirill Müller a48ae42864 ICU-22117 Replace uprv_strncpy() by uprv_memcpy()
This fixes a warning on gcc 9.4.0, which is triggered because the third argument to strncpy() depends on the length of the second argument (but should actually indicate the buffer size). Replacing by memcpy() seems harmless because a null terminator is appended further below, and the buffer is sized to be "large enough" elsewhere.

See https://github.com/duckdb/duckdb/issues/4391 for details.

Fixing the warning is important for us, because the checks in the duckdb repository treat all warnings as errors.
2022-09-09 17:07:53 -07:00
Shane Carr e4df304367 ICU-21957 Update double-conversion to 256ac809561b756645e73ab7127c2aaaeabaa427
See #2179
2022-09-09 15:47:12 -07:00
Frank Tang b9fdd2a7cf ICU-22025 Rename the enum type for Hebrew calendar to Month 2022-09-09 01:29:06 -07:00
Peter Edberg baee21aa7a ICU-22125 Add note about future deprecation to MeasureUnit createMetricTon/getMetricTon/METRIC_TON 2022-09-08 20:59:07 -07:00
floratmin 1dfe456fe8 ICU-21983 Fix fraction precision skeleton
See #2058
2022-09-08 20:17:48 -07:00
Markus Scherer 5de6ee0c61 ICU-21959 fix DateIntervalFormat general usage example 2022-09-08 18:59:19 -07:00
Peter Edberg d3a753a0d4 ICU-21957 BRS 72rc, update urename.h 2022-09-08 18:19:30 -07:00
Peter Edberg 1de1e36d6f ICU-21957 integrate CLDR release-42-alpha3 to ICU main for 72 2022-09-08 18:19:10 -07:00
Cyndy Ishida 48124d1706 ICU-22072 Update Darwin Specific Macros
* Update `U_PF_IPHONE` to be 0 when building for macOS/macCatalyst.
* add macro definition for `attribute((visibility("hidden")))` for cases
  where internal structs exist within exposed classes.
2022-09-08 09:08:57 -07:00
rp9-next bebcd6b8bb ICU-22114 Update pipeline workflows to use macOS-latest 2022-09-08 09:02:31 -07:00
Cyndy Ishida 03b94e9cb3 ICU-22068 Cleanup inconsistent annotations between declarations and definitions
This cleans up inconsistent annotations between declared APIs in headers
vs defined implementations in cpp's. This better ensures the API's
referenceable in headers represent what is exposed and defined in the
ultimate binary library's symbol table.
2022-09-08 08:34:56 -07:00
Fredrik Roubert 030fa1a479 ICU-21148 Consistently use standard lowercase true/false everywhere.
This is the normal standard way in C, C++ as well as Java and there's no
longer any reason for ICU to be different. The various internal macros
providing custom boolean constants can all be deleted and code as well
as documentation can be updated to use lowercase true/false everywhere.
2022-09-07 20:56:33 +02:00
gnrunge 00003dcbf2 ICU-21957 Update TODO ticket reference: CLDR-13044 (done) ---> ICU-21420 (open). 2022-09-06 09:14:07 -07:00
Elango Cheran 6e3a923056 ICU-22116 Update CI job for ICU4J to use Java 8 instead of Java 7
See #2173
2022-09-06 09:09:22 -07:00
gnrunge baa104b50b ICU-21957 Clean-up of TODO and logKnownIssue entries (BRS task):
Removed logKnownIssue(ICU-21322) in plurults.cpp, ICU-21322 is done and the
entire if-statement was commented out.

Replaced CLDR-13700 with CLDR-13701 in several TODOs. 13700 is a duplicate of
13701.

Likewise for CLDR-14502 --> CLDR-14582.

PR#1999 from ICU 71 release missed some of the cases.
2022-09-02 09:54:57 -07:00
Rich Gillam 4ab713b1c6 ICU-22081 Added missing copyright notice to PersonName.java. 2022-09-01 13:36:05 -07:00
Rich Gillam 69dcdde885 ICU-22081 More API-review fixes: Hoisted the PersonName object to the top level (in its own source file) and moved
NameField and FieldModifier there, plus a number of smaller changes.
2022-09-01 13:36:05 -07:00
Rich Gillam df93dd00bf ICU-22081 Addressed review comments:
- Changed all public Javadoc to use the proper verbiage for identifying this code as
  a tech preview.
- Changed all references to ULocale in the API to use Locale instead.
- Changed PersonNameFormatter and SimplePersonName so that they're constructed by way
  of separate builder objects.
- Added an internal constructor for PersonNameFormatter just for the use of the unit tests,
  and added some unit tests that take advantage of the new constructor to test the internals
  more thoroughly.
- Renamed format() to formatToString(), to make room to add a format() method later that
  returns a FormattedPersonName.
- Added logic to guess the locale of a name object when the name object doesn't supply
  a locale.
- Moved the function that constructs a SimplePersonName from a single string containing
  key-value pairs out of the API and into the unit tests.
- Various smaller changes in response to API- and code-review comments.
2022-09-01 13:36:05 -07:00
Rich Gillam 53775accd5 ICU-22081 PersonNameFormatter tech preview 2022-09-01 13:36:05 -07:00
Yoshito Umaoka 9acba58c49 ICU-22116 Updating minimum Java runtime support to Java 8 2022-09-01 13:02:27 -04:00
Markus Scherer 8050af5484 ICU-21980 Unicode 15 update 2022aug30 2022-08-31 16:15:42 -07:00
Rich Gillam 5334e2819d ICU-21958 ICU 70 API Promotions 2022-08-31 15:38:22 -07:00
yumaoka 3d935f2d49 ICU-21957 BRS72 Updating currency numeric code data. 2022-08-30 19:34:49 -04:00
Yoshito Umaoka 3e6219ba4d ICU-21957 BRS72 organize import statements 2022-08-30 19:34:01 -04:00
Craig Cornelius 37e2956271 ICU-21957 ICU4J API status and change report 2022-08-26 11:33:50 -07:00
Peter Edberg 49d192fefe ICU-22112 word break updates for @,colon; colon tailorings for fi,sv
See #2159
2022-08-23 12:45:55 -07:00
allenwtsu 8c669a7c2e ICU-22012 Add more Japanese words into the dictionary 2022-08-23 10:18:45 -07:00
Peter Edberg ca9bdb9780 ICU-21957 integrate CLDR release-42-alpha2 to ICU main for 72 2022-08-22 13:07:59 -07:00
Richard Purdie 4ac7cd1393 ICU-22109 icu-config hardcodes build paths unnecessarily
The makefile hardcodes paths to the build directory into icu-config. It doesn’t
need to do this and it unnecessarily breaks build reproducibility. This patch
makes a simple change to avoid this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-22 15:02:39 -05:00
Andy Heninger b95c6b1f3e ICU-21946 RBBI Break Cache Optimizations
Adjust RuleBasedBreakIterator::BreakCache::populateNear() to retain the cache
the cache contents in additional cases where are still useful, resulting in
improved performance.

This change is related to PR #2039, which addressed the same problem. This one
retains the cache contents in more situations.
2022-08-20 16:16:30 -07:00
yumaoka 2673378260 ICU-22118 tzdata2022b updates in icu code
See #2157
2022-08-18 19:12:31 -04:00
Henri Sivonen 59615c93f6 ICU-22115 Merge passthrough and canonical combining class data into the NFD trie for ICU4X 2022-08-16 15:53:56 -07:00
Rich Gillam 8492a82916 ICU-22105 Fixed the unit-conversion logic to work correctly with negative temperature values. 2022-08-16 10:18:24 -07:00
Elango Cheran 3ef03a4087 ICU-21947 Replace FixedDecimal with DecimalQuantity in PluralRule sample parsing
See #2007
2022-08-11 15:10:37 -07:00
Mihai Nita 0eecb25011 ICU-22101 Error prone reports "StringSplitter" error in PluralRules.java
String.split(String) and Pattern.split(CharSequence) have surprising behaviour.
"a:🅱️".split(":") produces ["a", "b"], when one would expect ["a", "", "b", ""]

The recommended fix is to use the Guava Splitter, or setting an explicit limit:
String.split(String,int limit) and Pattern.split(CharSequence,int limit)
2022-08-11 08:27:19 -07:00
Peter Edberg d99abb6d65 ICU-21957 integrate CLDR release-42-alpha1b to ICU main for 72 2022-08-09 16:05:20 -07:00
Peter Edberg 0266970e97 ICU-21957 integrate CLDR release-42-alpha1 to ICU main for 72 2022-08-05 09:39:58 -07:00
rp9-next 4cf4116dad ICU-22074 Increase the valgrind CI timeout 2022-08-01 12:51:55 +05:30
Peter Edberg dcd19ae9bc ICU-21957 integrate CLDR release-42-alpha0 (first with Survey Tool data) to ICU main for 72 (#2142) 2022-07-29 15:32:45 -07:00
Rich Gillam 58a51495dd ICU-22088 Various fixes to make dealing with NUMBERING_SYSTEM formatters easier. 2022-07-28 16:18:01 -07:00
Henri Sivonen c258f3d6f8 ICU-22095 Export ICU4X normalization data with tries only without Unicode sets 2022-07-25 15:54:29 -07:00
gnrunge 86166e0a2d ICU-22075 Adds a random waiting period (0 - 179 secs) to each test that runs as
part of a high concurrency performance test setup. This will disperse commits
of performance test results into the data branch over a wider time frame and
drastically reduces the chance of data uploads failing after ten unsuccesful
commit attempts.

Test runs showed a huge drop in failed commits/retry, from a high of 113
without wait down to only 4 with the extra wait.

ICU-22075 Add comment explaining the rationale of the random
sleep period prior to test execution.
2022-07-22 08:14:58 -07:00
Rich Gillam 9d230f923c ICU-21939 Fix bogus "conflicting fields" error in DateIntervalFormat. 2022-07-18 15:16:40 -07:00
Henri Sivonen 9c72bf9758 ICU-22087 Export a non-recursive canonical decomposition supplement for ICU4X 2022-07-18 10:05:10 -07:00
Rich Gillam a8594a401f ICU-22056 Add a new unum_hasAttribute() method. 2022-07-15 16:03:56 -07:00
Peter Edberg 6394a48d06 ICU-21957 integrate CLDR release-42-m2 (mid milestone) to ICU main for 72 2022-07-14 10:56:39 -07:00
William Marlow 9a7b0e08d0 ICU-22086 Add ibm-clang_r/ibm-clang++_r to runConfigureICU 2022-07-14 17:38:59 +00:00
Rich Gillam 4f6f087f2e ICU-22085 Fix old typo on calculating path size in loadTestData() and add a few small changes to support running ICU unit tests in Xcode. 2022-07-14 08:53:16 -07:00
Rich Gillam 721d41153e ICU-22071 Fixed DateTimePatternGenerator to respect the locale's "rg" subtag (when it has one) when determining the hour cycle. 2022-07-12 10:55:03 -07:00
Daniel Schürmann 9f358ccb24 ICU-22010 Add early check for AX_CHECK_COMPILE_FLAG
This helps to avoid missleading error message:

```
./source/configure: line 7981: syntax error near unexpected token 'newline'
./source/configure: line 7981: 'AX_CHECK_COMPILE_FLAG('
```
2022-07-12 13:30:01 +05:30
Cyndy Ishida e2ae4f5324 ICU-22054 Remove declarations for unimplemented APIs
This patch also includes marking `=delete` on specific `normal` member functions, as opposed to compiler generated functions,
based on the description of such functions' surrounding comments.
2022-07-01 08:57:10 -07:00
Robert Bastian 783b4f7b6a ICU-22061 rename 2022-06-29 13:16:26 -07:00
gnrunge 58060eafdc ICU-22036 Adds ICU4J date formatting performance test, which is last of the
ICU4J performance tests.
2022-06-29 12:02:29 -07:00
Henri Sivonen 3cefbd55c7 ICU-22028 Export collation and normalization data for ICU4X 2022-06-28 08:37:32 -07:00
Shane F. Carr d7c424b00f ICU-22073 Do not throw away CompactDecimalFormat's affixes 2022-06-27 12:53:22 -07:00
allenwtsu 929cf40ecb ICU-22059 Add one Thai word into the Thai dictionary
See #2112
2022-06-27 09:27:56 -07:00
gnrunge 6df8bb7307 ICU-22036 Adds ICU4J performance tests to post-merge continuous integration
workflow. Also fixes a tiny oversight in the ICU4J performance framework.
2022-06-27 08:47:48 -07:00
Frank Tang 43f2ae75ca ICU-22004 Avoid UBSan bug by casting only when success 2022-06-24 18:00:03 -07:00
Paul Harris 86cc2b98cb ICU-22002 Don't undef __STRICT_ANSI__ 2022-06-23 11:55:06 -07:00
Frank Tang 2f6cc2f7e7 ICU-22070 Return if UErrorCode is error in calendar.cpp 2022-06-23 09:26:41 -07:00
gnrunge 5a77fd9d11 ICU-21997 Fixes currency code retrieval for locale: instead of selecting the
first currency in the list now select the first legal tender currency in the
list. Or the first currency if the list has no legal tender currencies (which
is the previous behaviour).

ICU-21997 Removed an overlooked earlier unit test attempt.

ICU-21997 Shields C++ unit test from compilation when configuration flag
UCONFIG_NO_FORMATTING is set.
2022-06-16 13:49:15 -07:00
Shane Carr c5872e7f67 ICU-22017 Fix numbering system resolution in NumberRangeFormatter
See #2085
2022-06-15 13:08:46 -07:00
gnrunge df8fbc22e8 ICU-22036 Modify ICU4J performance test framework to work when executed by
GitHub Action. This includes introducing a new flag (-a) to indicate
invocation from command line/GHA shell, moving elements of the workflow
from Perl into the Java framework (calculation of iteration numbers), and
generating NDJSON output for GitHub Benchmark processing.
Backward compatibility with the Perl script invocation has been preserved.

ICU-22036 Adds a comment clarifying the reason why NDJSON output is generated.
2022-06-09 14:57:21 -07:00
Cyndy Ishida 1eb6f38b96 ICU-22053 Clean up usages of Macro Header Guards 2022-06-09 10:18:28 -07:00
Cyndy Ishida 0dcb1cb065 ICU-22035 Remove instances of pre c++11 default constructor prevention pattern 2022-06-08 16:28:02 -07:00
agrieve 18dd0e4c22 ICU-21960 Add missing "const" to kAttributeKey
This variable was flagged by a chromium check that looks for variables named like constants that end up in the `.data` ELF section (rather than in `.rodata`).
2022-06-08 16:56:24 +00:00
Peter Edberg 33af80e980 ICU-21957 improve logKnownIssue skip for FormattedStringBuilderTest::testInsertOverflow crash 2022-06-03 09:02:31 -07:00
Markus Scherer c5d0fff5a0 ICU-21980 parse multiple @missing lines 2022-06-02 21:29:24 +00:00
Younies Mahmoud d6fc9b828c ICU-21935 Add DisplayOptions to NumberFormatterSettings
See #2099
2022-05-31 13:02:01 -07:00
Peter Edberg 64b3548126 ICU-21957 integrate CLDR release-42-m1 (early milestone) to ICU main for 72 (rebased on main) +
FormattedStringBuilderTest::testInsertOverflow infolns,logKnownIssue skip for CI exhaustive crash
2022-05-27 13:50:43 -07:00
Frank Tang fc64f8db3f ICU-22041 Fix "Africa/Casablanca" show strange LONG displayName
See #2096
2022-05-26 14:59:10 -07:00
Markus Scherer 8d5a97ae0f ICU-21935 DisplayOptions cleanup 2022-05-26 18:30:07 +00:00
Markus Scherer e17219582e ICU-21980 add missing comments, finish change log 2022-05-25 18:23:11 +00:00
Markus Scherer 98c5793ffd ICU-21980 update ICU4J data & test files
and adjust a default Bidi_Class range in UCharacterTest.java just like in cucdtst.c before.
2022-05-25 18:23:11 +00:00
Markus Scherer 3859735e3b ICU-21980 Unicode 15 collation data 2022-05-25 18:23:11 +00:00
Markus Scherer 1276b0a4f7 ICU-21980 generated data files 2022-05-25 18:23:11 +00:00
Markus Scherer e1be738ccb ICU-21980 Unicode 15 pre-beta data files, new prop values 2022-05-25 18:23:11 +00:00
Markus Scherer 3ba6f2b32c ICU-21980 update Unicode version numbers 2022-05-25 18:23:11 +00:00
Markus Scherer 6b2b783a20 ICU-21980 copy the Unicode 14 changes.txt log 2022-05-25 18:23:11 +00:00
Frank Tang f5f4813d16 ICU-22043 Change minimum ZONE_OFFSET value from -12h to -16h
See #2100
2022-05-24 16:11:39 -07:00
Fredrik Roubert 74a723f22f ICU-21959 Fix the URL to the icu-le-hb repository.
https://sourceforge.net/p/icu/mailman/message/37657918/
2022-05-24 20:55:00 +02:00
Younies Mahmoud fcc981a5b7 ICU-21935 Add DisplayOptions
See #2061
2022-05-21 03:20:37 +02:00
gnrunge 8fcb22f88e ICU-22037 Adds performance tests for ICU forward and backward
string search.

ICU-22037 Removes a left-over escaped doublequote; removes a
test print-out.
2022-05-20 11:56:11 -07:00
Jeff Genovy f6300c97cd ICU-22040 Update clang-13 build bots to clang-14. Add libc++ build bot. 2022-05-19 14:05:14 -07:00
Frank Yung-Fong Tang 3d89af0f72 ICU-22023 Fix Calendar::get() return out of bound value and SimpleDateTime::format assert while TimeZone is "UTC" and value is -1e-9
See #2086
2022-05-19 13:45:59 -07:00
Andy Heninger 85705f04e0 ICU-21960 C++20 Warnings from ATOMIC_VAR_INIT
Remove the ICU macros ATOMIC_INT32_T_INITIALIZER and U_INITONCE_INITIALIZER,
which made use of C++ ATOMIC_VAR_INIT, which has been removed from C++20.

With modern C++ features being available, these macros no longer served
any real need.
2022-05-17 15:45:06 -07:00
gnrunge f8a0810a5a ICU-22030 Modifies GHA CI performance testing so that existing files in the
performance results publishing repository are no longer deleted when the test
results are forwarded. This concretely affects the README file in the icu-perf
repository, which got deleted with the first data transfer.

Restoring the README file in icu-perf will be a complementary PR.
2022-05-13 17:00:05 -07:00
allenwtsu bdcec144b9 ICU-22012 Add four Japanese word into the dictionary
See #2072
2022-05-11 08:19:53 -07:00
Chetan Laddha 5961aacd3c ICU-21945 Add support for Visual Studio 2022
See #2059
2022-05-10 22:57:18 +05:30
Markus Scherer fda4a82bba ICU-21960 fix clang 13 C++20 warnings 2022-05-07 15:21:08 +00:00
Markus Scherer eea7985e5a ICU-22016 utrie2.h need not include mutex.h 2022-05-06 20:50:58 +00:00
Frank Tang e96e9410bd ICU-22005 Fix int32 overflow in FormattedStringBuilder
See #2070
2022-04-29 18:25:01 -07:00
Markus Scherer 07a50207b7 ICU-21679 avoid escape of U+FFFF in a character literal 2022-04-29 20:43:53 +00:00
Markus Scherer 505535813f ICU-22007 remove outdated terms of use from Unicode conversion files 2022-04-29 19:51:01 +00:00
Markus Scherer 43d082665e ICU-22006 icupkg: %%ALIAS & %%Parent do not need truncation parent 2022-04-29 17:50:11 +00:00
Craig Cornelius cb6b778e1b ICU-21959 Online demos how to update
See #2069
2022-04-29 09:36:51 -07:00
Hugo van der Merwe 50e14fe15b ICU-21959 Update stale Jira tickets in ICU4J TODOs
See #2062
2022-04-27 23:31:46 +02:00
Frank Tang fca6b342c0 ICU-21994 Fix heap-buffer-overflow 2022-04-20 12:03:35 -07:00
Shane F. Carr 47824c5568 ICU-21956 Merge maint-71 to main 2022-04-14 17:45:38 -07:00
Shane F. Carr d16df5843e ICU-21956 Merge remote-tracking branch 'upstream/maint/maint-71' into ICU-21956-merge 2022-04-13 11:39:20 -07:00
Rich Gillam 87cee860e0 ICU-21984 Fix DateIntervalFormat.normalizeHourMetacharacters() so that it doesn't require the hour and day-period
fields to appear in any particular order or position in the skeleton string.
2022-04-11 14:37:15 -07:00
Frank Yung-Fong Tang 4747484273 ICU-21966 Cleanup -Wunused-but-set-variable
See #2055
2022-04-06 12:51:46 -07:00
Markus Scherer 4833cc89b2 ICU-20715 CollationDataBuilder reset outdated prefix+contraction values
See #2052
2022-04-04 16:10:13 +00:00
Daniel Ju f4f74c1f2e ICU-21957 BRS72RC Update version number to 72.0.1 2022-03-31 16:39:13 -07:00
Julien Brianceau a2c90781f1 ICU-21967 Remove obsolete references in makedata.vcxproj and makedata_uwp.vcxproj
These references should have been removed in ICU-20489 and ICU-21420.
Take the opportunity to update the doc as well.
2022-03-31 11:23:29 -07:00
Jeff Genovy 861e55c246 ICU-21972 Use a shared props file for the ICU Major Version number in the Windows Visual Studio project files. 2022-03-30 20:55:36 -07:00
yumaoka c205e7ee49 ICU-21971 Added a new numeric currecny code SLE/695 for Sierra Leone Leone. 2022-03-30 13:49:51 -07:00
Shane Carr b144aac447 ICU-21762 Export Script_Extensions with --all flag in icuexportdata
See #2054
2022-03-30 11:44:02 -07:00
Steven R. Loomis 2612b8b55a ICU-21965 fix utilities.jar module name
com.ibm.icu.utilities - otherwise the automatic module name is unusable
2022-03-30 11:09:53 -05:00
Markus Scherer ed1d9efc15 ICU-21954 LICENSE: add more license texts from icu4c files 2022-03-24 21:22:05 +00:00
Julien Brianceau 8230b85175 ICU-21814 Fix small typos in docs/userguide 2022-03-24 15:33:48 +00:00
Markus Scherer 2aa2a7221c ICU-21953 remove outdated ucdterms.txt
This is an old version of the Unicode license from 2004,
when the ICU license was different from the Unicode license.

We should have removed this file in 2016,
when the Unicode license was revised,
and when the ICU project became a project of the Unicode Consortium,
adopting the Unicode license for all of ICU.

Since 2016, the Unicode data files are covered by the same license as the
top license text in the ICU LICENSE file.
2022-03-24 00:14:02 +00:00
Peter Edberg 9b3c0c328c ICU-21901 integrate CLDR release-41-beta2 to ICU main for 71ga 2022-03-23 16:43:02 -07:00
Jeff Genovy 1d9cc717e2 ICU-21956 Merge maint-71 to main
Merging the maint/maint-71 branch into the main branch.
2022-03-23 12:50:13 -07:00
Daniel Ju 09331b75bf ICU-21901 BRS71GA Update version number 2022-03-21 15:01:26 -05:00
yumaoka ee6433c297 ICU-21949 tzdata2022a update in ICU 2022-03-17 13:56:20 -04:00
gnrunge 0f49e50868 ICU-21843 Increase performance alert threshold to 200% to avoid false alerts
from occasional spikes.
2022-03-17 09:31:53 -07:00
Yoshito Umaoka 89c5d03023 ICU-21900 BRS71 ICU4J API signature file 2022-03-16 12:36:40 -04:00
Peter Edberg 8575c0dace ICU-21900 check non-stable API macros, move class boilerplate out of conditionals 2022-03-16 09:03:05 -07:00
Peter Edberg 6330704974 ICU-21944 Sync recent uloc_getLanguage/Countries updates to ICU4J; add "mo" mapping for C 2022-03-16 09:01:59 -07:00
Shane F. Carr 33c9b61b26 ICU-21871 Make behavior consistent on list format of empty strings 2022-03-15 18:11:57 -07:00
Daniel Ju 741bbddcf9 ICU-21900 BRS71RC Update version number and regenerate configure 2022-03-15 18:26:10 -05:00
Younies f30956fc9c ICU-21840 Fix formatting Aliases
See #2016
2022-03-15 23:27:43 +01:00
shaobero b1269c9121 ICU-21823 Adding changes to fix charset detection incase of no match 2022-03-15 21:47:40 +00:00
Peter Edberg dbf7c20be6 ICU-21942 Fix Kosovo 3-letter code to be XKK for uloc_getISO3Country etc. 2022-03-15 10:59:13 -07:00
Yoshito Umaoka 811351f67c ICU-21900 BRS71 Updated serialization test data for 71.1 2022-03-15 09:47:57 -04:00
yumaoka 5b4559df24 ICU-21900 BRS71 Cleanup import statements in ICU4J 2022-03-15 09:47:25 -04:00
Markus Scherer bfca3ccaac ICU-21875 improve C API coverage 2022-03-15 05:07:59 +00:00
Markus Scherer 29111fd195 ICU-21824 make the Unicode license match exactly
The ICU copy of the Unicode license was missing some lines that are
considered part of the license text.

See https://github.com/unicode-org/template-repo/blob/main/LICENSE
and https://www.unicode.org/license.txt
2022-03-14 19:50:44 +00:00
Peter Edberg df6a8c877c ICU-13619 Now that UDATPG_NARROW is @stable, can reference it in header 2022-03-11 13:06:50 -08:00
Ng Zhi An e0bb2ccdeb ICU-21844 Fix variable shadowing 2022-03-11 19:10:53 +00:00
Peter Edberg b5f10c4a1c ICU-21332 Add tests from ICU4C TestDelimiters() into related ICU4J test 2022-03-10 21:20:11 -08:00
Craig Cornelius 19c13048d2 ICU-21900 Update ICU4J Change report (BRS#20)
Update to show only major release numbers.
2022-03-10 17:58:16 -08:00
Craig Cornelius 7fe330119e ICU-21900 ICU4C 71 change report
See #2024. Includes update to generator that removes the minor version indication from the reports.
2022-03-10 15:50:45 -08:00
Peter Edberg f374427f60 ICU-21900 integrate CLDR release-41-beta1 to ICU main for 71rc 2022-03-10 11:17:09 -08:00
Peter Edberg 996378821c ICU-21839 Add ICU4J test that ISO8601 inherits patterns/symbols grom Gregorian 2022-03-10 09:37:21 -08:00
Shane Carr 8a5f045992 ICU-21900 Fix issue filtering in commit checker 2022-03-09 19:20:02 -08:00
Michael Spector e730bce02f ICU-21815 Remove unused line 2022-03-10 01:00:26 +00:00
Peter Edberg 571d12abfb ICU-21409 add word for bell to laodict 2022-03-09 15:14:42 -08:00
Younies bb822ba38a ICU-21936 Make the internal units converters public
See #2021
2022-03-09 22:42:04 +01:00
gnrunge 77e0c9e371 ICU-21900 Adjusts performance alert threshold to 150%, i.e. the alert only is
triggered if the current measured execution time is 50% higher than the previous
time.
The current setting of 100% means that even a 1% increase from previous time
triggers the alert already.
2022-03-09 11:10:43 -08:00
Alexander Morozov 234cbe2c17 ICU-21805 Remove useless check 2022-03-09 03:37:37 +00:00
Daniel Bevenius 55a51fa9bd ICU-21784 suppress -Wunused-function warning in unistr.cpp
This commit adds an ignore of the unused function
uprv_UnicodeStringDummy.
2022-03-09 03:31:37 +00:00
Elango Cheran f79f03dad5 ICU-21322 Add parse and format methods for DecimalQuantity with exponent
See #2012
2022-03-08 15:56:50 -08:00
Shane F. Carr f57ef9ebf7 ICU-21527 Assert pattern equality instead of object equality 2022-03-08 15:31:52 -08:00
Shane F. Carr 31871cc14f ICU-21801 Fix array comparison warning in uspoof_impl.cpp
See #2015
2022-03-08 15:21:53 -08:00
Alexey Vetlov 1393face12 ICU-21768 Fixed (u_snprintf improperly counts the required buffer size). Modified TestSnprintf to test the null buffer case. 2022-03-08 23:09:54 +00:00
gnrunge 80ee559205 ICU-21843 Add ICU4C performance tests to continuous integration
See #1987
2022-03-07 12:53:44 -08:00
younies c86a2bd7d7 ICU-21379 Add getNounClass and enum NounClass
See #2002
2022-03-02 23:15:17 +01:00
Craig Cornelius 7f044eeb7a ICU-21900 ICU4J: Promote all '@draft ICU 69' to '@stable' 2022-03-02 10:47:00 -08:00
Peter Edberg 0ce0d1aa5d ICU-21900 check non-stable API macros, fix missing U_DEPRECATED 2022-03-02 10:34:16 -08:00
Craig Cornelius 87e31395da ICU-21816 Add ICU4C samples check to workflow for BRS "Test C Samples"
See #2010
2022-03-02 09:25:52 -08:00
gnrunge 512a679aba ICU-21900 Ticket ICU-8989 is fixed but CLDR-4375 remains open. Change the
TODO comment.
2022-02-28 12:55:21 -08:00
Rich Gillam 81ad37be05 ICU-21802 Fix error where strict date parsing could succeed on certain malformed input strings. 2022-02-28 12:01:44 -08:00
gnrunge a723bdf494 ICU-21900 Bookkeeping of CLDR tickets in TODO() comments: CLDR-14502 was closed
as duplicate of 14582 (open) and CLDR-13700 was closed as duplicate of
CLDR-13701 (open). Modify the TODOs accordingly.
2022-02-28 11:48:22 -08:00
Craig Cornelius bf6b3236a3 ICU-21900 Fix ICU4C sample dtitvfmtsample segfault and update healthy code doc 2022-02-25 15:28:03 -08:00
Rich Gillam 6bdcd6d30f ICU-21154 Fixed handling of hour characters in date-interval-format skeletons to match the way they're handled in
DateTimePatternGenerator skeletons.
2022-02-25 12:57:35 -08:00
Craig Cornelius 475703cd40 ICU-21900 Fix ICU4C sample build and execution
This fixes several of the sample C++ programs.
2022-02-25 11:08:16 -08:00
Andy Heninger f783a84d2f ICU-21592 Linebreak loose cj rules cleanup
This is a followup to PR #1991, Update cj normal/loose linebreak per CSS

The original change to the line_loose_cj rules involved splitting hyphens out
of the BA (Break After) class, allowing a break when they follow an ID. This
change simplifies the the rules for doing that.

It also fixes a problem with the original change that had altered the behavior
of BAX hyphens that followed Regional Indicators or Unattached Combining Marks.
2022-02-24 21:27:26 -08:00
Peter Edberg 16aae80199 ICU-21900 integrate CLDR release-41-alpha4 to ICU main for 71 front-load 2022-02-24 09:15:02 -08:00
Shane F. Carr 4059be5964 ICU-21908 Add incrementExact to ICU4C Precision
See #1979
2022-02-23 20:18:16 -07:00
Jeff Genovy fcca13200f ICU-21900 Fix issues found while running samples. 2022-02-23 14:58:07 -08:00
Shane F. Carr 3aa8f9fda1 ICU-21881 Fix TrailingZeroDisplay with RoundingMode
See #1977
2022-02-23 15:46:54 -07:00
Rich Gillam 81dfbdf3b6 ICU-21873 Corrected alias handling getAllItemsWithFallback() to go to the right place. 2022-02-23 13:45:47 -08:00
Shane F. Carr c626c6df5c ICU-21900 Update double-conversion to v3.2.0 2022-02-23 13:18:32 -08:00
yumaoka 9907ca8ea3 ICU-21900 BRS71 Updating currency numeric code data. 2022-02-23 13:18:06 -08:00
Rich Gillam 94197b84b8 ICU-21900 Promote all @draft ICU 69 APIs to @stable ICU 69 2022-02-23 12:04:59 -08:00
Elango Cheran 4962050f47 ICU-21919 Fix buffer overflow bug in Dutch accented IJ titlecase
See #1990
2022-02-23 12:00:36 -08:00
Yoshito Umaoka 5489287998 ICU-21900 BRS71 Update license files 2022-02-23 11:40:17 -08:00
Shane F. Carr 16b934636a ICU-21765 Add approximately sign field
See #1978
2022-02-23 10:38:42 -07:00
Peter Edberg e3ebc7aac5 ICU-21900 integrate CLDR release-41-alpha3 to ICU main for 71 front-load 2022-02-23 09:19:12 -08:00
gnrunge bac48c8f9d ICU-21900 With ICU-13353 being fixed, remove code that was added to work around
ICU-13353.
2022-02-23 08:29:07 -08:00
Shane F. Carr fc3ca702e9 ICU-21814 Fix broken links in icu_data/index.md
See #1921
2022-02-22 15:41:20 -07:00
Shane F. Carr 9bb82e60a4 ICU-21886 Make rounding priority consistent with ECMA-402
See #1989
2022-02-22 15:40:54 -07:00
Peter Edberg 4cfe96c508 ICU-21592 Update cj normal/loose linebreak per CSS 2022-02-22 13:16:09 -08:00
gnrunge 335c403618 ICU-21900 Remove 'logKnownIssue(...)' protection now that ICU-21714 is fixed. 2022-02-22 10:22:56 -08:00
Peter Edberg 9df5f09d8f ICU-21900 BRS 71rc, update urename.h 2022-02-21 19:09:44 -08:00
allenwtsu 7d825cb204 ICU-21699 Add some more particles 2022-02-21 08:54:54 -08:00
Erik Torres 53f4ddf278 ICU-21900 BRSRC 71.0.1 Version update and regenerate configure
See #1973
2022-02-17 14:00:19 -08:00
yumaoka 143dd6ad6f ICU-21918 Updated expected useDaylightTime() value for MIT (Asia/Apia). 2022-02-17 09:47:39 -05:00
Xiao Tianci 66c8326280 ICU-21849 Fix Broken Link from general Transforms 2022-02-16 11:01:12 -08:00
Elango 039ecd6fd0 ICU-21141 Fix titlecase of accented Dutch ij digraph
See #1869
2022-02-16 09:07:09 -08:00
Peter Edberg 398489b915 ICU-21900 integrate CLDR release-41-alpha2 to ICU main for 71 front-load 2022-02-15 21:51:09 -08:00
Andy Heninger 91732e7c55 ICU-21832 Remove unsafe double-checked lock in ICUNotifier
ICUNotifier::notifyChanged() was using the thread-unsafe double-checked lock
idiom. Replace it with use of the mutex only.
2022-02-15 09:11:50 -08:00
Peter Edberg 008fddfaac ICU-21900 integrate CLDR release-41-alpha1 to ICU main for 71 front-load 2022-02-14 12:09:15 -08:00
gnrunge e951f4aec4 ICU-21843 Modifies performance tests and test framework in preparation of
adding performance tests to ICU CI.
- test/perf/Makefile.in:
    adds strsrchperf to list of subdirs.
    changes target 'all' to compile everything in the standard way.
- test/perf/ustrperf/Makefile.in: changes target executable from stringperf to
  ustrperf (i.e. name of directory) to allow uniform handling with other
  perf tests in GHA CI rules.
- tools/ctestfw/uperf.cpp: changes output to ndjson format for processing with
  GHA Benchmark. Keep the previous output, which gets processed by the Perl
  scripts, when executed in 'verbose' mode. Backward compatibility,
  in case someone still wants to use the Perl scripts for the time being.
  May get cleaned up later.
Also remove a few non-essential output lines that would interfer with
GHA Benchmark.
processing
2022-02-11 11:29:19 -08:00
allenwtsu a7b2d9dae1 ICU-21699 Add Japanese particle 2022-02-10 18:50:41 -08:00
allenwtsu 2a7c465284 ICU-21699 Add breakpoint between Japanese and Alphabet 2022-02-09 21:12:49 -08:00
allenwtsu c882c94d83 ICU-21699 Revise rule file
1. \u30fc doesn't belong to Hira, Kana nor Han. Add it into CJK dictionary
2. Include fullwidth char into ALPlus
2022-02-09 09:53:00 -08:00
Peter Edberg 205144e391 ICU-21900 MeasureUnit update; just marks mg-ofGlucose-perDeciliter as stable 2022-02-08 11:45:33 -08:00
Peter Edberg 2f8749a026 ICU-21900 integrate CLDR release-41-alpha0 to ICU main for 71 front-load 2022-02-07 22:02:36 -08:00
Andy Heninger 2fef6b937f ICU-21763 UVector cleanup, remove old funcs.
Remove the functions UVector::addElementX() and UVector::ensureCapacityX() that
were temporarily added to aid in the cleaning up of UVector's out-of-memory
error handling.
2022-02-06 22:07:50 -08:00
dependabot[bot] fb31d9b54b ICU-21815 Bump xercesImpl from 2.12.0 to 2.12.2 in /tools/release/java
Bumps xercesImpl from 2.12.0 to 2.12.2.

---
updated-dependencies:
- dependency-name: xerces:xercesImpl
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 14:34:24 -08:00
Victor Chang 397cbb9530 ICU-21894 A modern version of ucol_safeClone and ucnv_safeClone API 2022-02-01 16:41:49 +00:00
allenwtsu a67bb90150 ICU-21699 Refactor codeunit handling
See #1965
2022-01-26 15:41:34 -08:00
Mojca Miklavec 32d279a437 ICU-21896 Use double base in pow()
gcc 5.5 on Solaris refuses to recognise pow(int, int32_t)
2022-01-26 11:26:11 -08:00
allenwtsu 8528bef596 ICU-21699 Phrase based breaking(Java)
See #1955
2022-01-21 13:11:59 -08:00
Mojca Miklavec 406d90000f ICU-13543 Do not remove -std=c++11 from compiler flags on Solaris 2022-01-21 10:54:05 -06:00
allensu05 c9fae4bda4 ICU-21699 Concatenate Katakana chars
See #1962
2022-01-19 23:07:22 -08:00
allenwtsu 470e44c551 ICU-21699 Separate lb and lw
See #1959
2022-01-19 22:46:18 -08:00
allenwtsu d0290c03db ICU-21699 Phrase based breaking(C++)
See #1936
2022-01-13 20:22:05 -08:00
Peter Edberg 23081486ff ICU-21353 Implement DateTimePatternGenerator use of correct datetime pattern;
includes new getter/setter API per TC discussion.
2022-01-13 19:16:37 -08:00
allenwtsu 06ef8867f3 ICU-21699 Fix CjkBreakEngine performance issue
1. vector.contains() uses sequential comparison, O(n).
   As the vector size is great, the performance will be impacted.
   Remove this unnecessary check, vector.contains(), in C++.

2. At Java's CjkBreakEngine, replace "vector.contains()" with "if(pos > previous)" to deal with duplicate breakpoint position.
   This way, C++ and Java implementation will be synchronous.
   Test: ant checkTest -Dtestclass='com.ibm.icu.dev.test.rbbi.RBBITest'
   (RBBTest#TestBreakAllChars() can generate duplicate position for word break. It could pass with this change)
2022-01-11 16:46:32 -08:00
Hugo van der Merwe 44c7137ae5 ICU-21862 icu4c unit conversions: support inverting 0 and Infinity (for vehicle-fuel)
See #1947
2022-01-09 04:04:06 -06:00
10418 changed files with 643160 additions and 689444 deletions
+1 -1
View File
@@ -6,4 +6,4 @@
# for running Bazel commands while ensuring, through configuration, that only a
# specific version of Bazel is executed.
USE_BAZEL_VERSION=4.1.0
USE_BAZEL_VERSION=6.0.0
+28
View File
@@ -0,0 +1,28 @@
# © 2024 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# By default, build ICU4C as C11 & C++17.
build --enable_platform_specific_config
build:android --conlyopt=-std=c11
build:android --host_conlyopt=-std=c11
build:ios --conlyopt=-std=c11
build:ios --host_conlyopt=-std=c11
build:linux --conlyopt=-std=c11
build:linux --host_conlyopt=-std=c11
build:macos --conlyopt=-std=c11
build:macos --host_conlyopt=-std=c11
build:windows --conlyopt=/std:c11
build:windows --host_conlyopt=/std:c11
build:android --cxxopt=-std=c++17
build:android --host_cxxopt=-std=c++17
build:ios --cxxopt=-std=c++17
build:ios --host_cxxopt=-std=c++17
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17
+15 -12
View File
@@ -17,7 +17,8 @@ trigger:
- '*'
exclude:
- .github/*
- .ci-builds/.azure-pipelines.yml
- .ci-builds/.azure-pipelines-icu4c.yml
- .ci-builds/.azure-pipelines-icu4j.yml
- .ci-builds/.azure-valgrind.yml
- docs/*
- tools/*
@@ -27,42 +28,45 @@ trigger:
- KEYS
- README.md
variables:
MAVEN_ARGS: '--show-version --no-transfer-progress'
jobs:
#-------------------------------------------------------------------------
# Note: The exhaustive tests can take more than 1 hour to complete.
- job: ICU4J_OpenJDK_Ubuntu_1804
displayName: 'J: Linux OpenJDK (Ubuntu 18.04)'
timeoutInMinutes: 120
- job: ICU4J_OpenJDK_Ubuntu_2204
displayName: 'J: Linux OpenJDK (Ubuntu 22.04)'
timeoutInMinutes: 180
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-22.04'
demands: ant
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
echo "Building ICU4J" && cd icu4j && ant init && ant exhaustiveCheck
echo "Building ICU4J" && cd icu4j && mvn install -DICU.exhaustive=10
displayName: 'Build and Exhaustive Tests'
env:
BUILD: ICU4J
- script: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`
condition: failed() # only run if the build fails.
displayName: 'List failures (if any)'
timeoutInMinutes: 2
#-------------------------------------------------------------------------
# Note: The exhaustive tests can take more than 1 hour to complete.
- job: ICU4C_Clang_Exhaustive_Ubuntu_1804
displayName: 'C: Linux Clang Exhaustive Tests (Ubuntu 18.04)'
- job: ICU4C_Clang_Exhaustive_Ubuntu_2204
displayName: 'C: Linux Clang Exhaustive Tests (Ubuntu 22.04)'
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
displayName: 'Build'
- script: |
cd icu4c/source && make check-exhaustive
@@ -71,4 +75,3 @@ jobs:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
+665
View File
@@ -0,0 +1,665 @@
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
trigger:
branches:
include:
- main
- maint/maint-*
paths:
include:
- icu4c
- .ci-builds/.azure-pipelines-icu4c.yml
pr:
branches:
include:
- main
- maint/maint-*
paths:
include:
- icu4c
- .ci-builds/.azure-pipelines-icu4c.yml
variables:
MAVEN_ARGS: '--show-version --no-transfer-progress'
jobs:
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_2204
displayName: 'C: Linux Clang (Ubuntu 22.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: clang
CXX: clang++
- script: |
cd icu4c/source/test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
displayName: 'Test C Default locale'
- script: |
cd icu4c/source/test/cintltst && LANG=C.UTF-8 LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
displayName: 'Test C.UTF-8 Default locale'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_DataFilter_2204
displayName: 'C: Linux Clang DataFilter (Ubuntu 22.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Note: This job uses `make -j2` instead of `make -j -l2.5` because with more parallelism (PR #2456)
# this check became flaky. The build apparently was not done copying one or another .ucm file before
# calling makeconv for it, although the Makefile has appropriate dependencies.
- script: |
cd icu4c/source && \
ICU_DATA_FILTER_FILE=../../.ci-builds/data-filter.json ./runConfigureICU Linux && \
make -j2 tests && \
\[ ! -d data/out/build/icudt66l/translit \] && \
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData) && \
(cd test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestEnglishExemplarCharacters /tsutil/cldrtest/TestCoverage)
displayName: 'Build with Data Filter'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Cpp17_Debug_Ubuntu_2204
displayName: 'C: Linux Clang C++17 Debug (Ubuntu 22.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j -l2.5 check
displayName: 'Build and Test C++17'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_GCC_Ubuntu_2004
displayName: 'C: Linux GCC (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: gcc
CXX: g++
#-------------------------------------------------------------------------
- job: ICU4C_GCC11_Cpp20_Ubuntu_2004
displayName: 'C: Linux GCC-11 C++20 (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11
displayName: 'Install GCC-11'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: gcc-11
CXX: g++-11
CXXFLAGS: '-std=c++20 -fext-numeric-literals'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_2004_LANG
displayName: 'C: Linux Clang (Ubuntu 20.04) - LANG has extension tags'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: clang
CXX: clang++
LANG: "en_US@calendar=gregorian;hours=h12"
#-------------------------------------------------------------------------
- job: ICU4C_Clang16_Ubuntu_2004_WarningsAsErrors
displayName: 'C: Linux Clang-16 WarningsAsErrors (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Install Clang-16 from https://apt.llvm.org/
- script: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
sudo apt update
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
displayName: 'Install Clang-16'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 tests
displayName: 'Build only (WarningsAsErrors)'
env:
CC: clang-16
CPPFLAGS: '-Werror -Wno-strict-prototypes -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor -Wsuggest-override'
CXX: clang++-16
#-------------------------------------------------------------------------
- job: ICU4C_Clang16_Cpp20_Ubuntu_2004
displayName: 'C: Linux Clang-16 C++20 (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Install Clang-16 from https://apt.llvm.org/
- script: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
sudo apt update
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
displayName: 'Install Clang-16'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: clang-16
CPPFLAGS: '-Werror -Wno-strict-prototypes'
CXX: clang++-16
CXXFLAGS: '-std=c++20'
#-------------------------------------------------------------------------
- job: ICU4C_Clang16_Cpp20_libcpp_Ubuntu_2004
displayName: 'C: Linux Clang-16 C++20 libc++ (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Install Clang-16 from https://apt.llvm.org/
- script: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
sudo apt update
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
displayName: 'Install Clang-16'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
displayName: 'Build and Test'
env:
CC: clang-16
CPPFLAGS: '-Werror -Wno-strict-prototypes'
CXX: clang++-16
CXXFLAGS: '-std=c++20 -stdlib=libc++'
#-------------------------------------------------------------------------
# VS 2022 Builds
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_Distrelease
displayName: 'C: MSVC 64-bit Release (VS 2022) + Distrelease'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (x64)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch x64'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish x64 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x64_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_DataFilter
displayName: 'C: MSVC 64-bit Release DataFilter (VS 2022)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- powershell: |
$filterPath = $Env:BUILD_SOURCESDIRECTORY + "\.ci-builds\data-filter.json"
$vstsCommandString = "vso[task.setvariable variable=ICU_DATA_FILTER_FILE]" + $filterPath
Write-Host "##$vstsCommandString"
- task: VSBuild@1
displayName: 'Build Solution with Data Filter'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: '/p:SkipUWP=true'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x86_Release_Distrelease
displayName: 'C: MSVC 32-bit Release (VS 2022) + Distrelease'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: Win32
configuration: Release
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x86 Release'
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (x86)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch x86'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish x86 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x86_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_ARM32_Release
displayName: 'C: MSVC x64 ARM32 Release (VS 2022)'
timeoutInMinutes: 35
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: VSBuild@1
displayName: 'Build ARM32'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM
configuration: Release
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_ARM64_Release_Distrelease
displayName: 'C: MSVC x64 ARM64 Release (VS 2022) + Distrelease'
timeoutInMinutes: 35
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: VSBuild@1
displayName: 'Build ARM64'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM64
configuration: Release
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (ARM64)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch ARM64'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish ARM64 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_ARM64_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Debug
displayName: 'C: MSVC x64 Debug (VS 2022)'
timeoutInMinutes: 60
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Debug
- task: BatchScript@1
displayName: 'Run x64 Debug Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Debug'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_ARM64_Debug
displayName: 'C: MSVC ARM64 Debug (VS 2022)'
timeoutInMinutes: 35
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Debug
- task: VSBuild@1
displayName: 'Build ARM64 Debug'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM64
configuration: Debug
#-------------------------------------------------------------------------
# There is no /std:c++20 yet, so use c++latest as that includes many of
# the C++20 compiler and library changes.
- job: ICU4C_MSVC_x64_Release_CppLatest
displayName: 'C: MSVC 64-bit Release (VS 2022) /std:c++latest'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: '/p:LanguageStandard="stdcpplatest"'
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
#-------------------------------------------------------------------------
# VS 2019 Builds
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_VS2019
displayName: 'C: MSVC 64-bit Release (VS 2019)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x86_Debug_VS2019
displayName: 'C: MSVC 32-bit Debug (VS 2019)'
timeoutInMinutes: 90
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: Win32
configuration: Debug
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x86 Debug'
#-------------------------------------------------------------------------
- job: ICU4C_MSYS2_GCC_x86_64_Release
displayName: 'C: MSYS2 GCC x86_64 Release'
timeoutInMinutes: 45
pool:
vmImage: 'windows-2019'
demands:
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
choco install -y msys2
rem refreshenv
displayName: 'Install MSYS2'
- script: |
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Hello World' && uname -a"
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain"
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S make"
exit
displayName: 'Install mingw-w64-x86_64-toolchain'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j -l2.5 check"
displayName: 'Build and Test'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && make install && cd /tmp/build-icu && echo 'Recursive ls' && ls -lR"
displayName: 'make install'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Run icuinfo from MSYS shell' && cd /tmp/build-icu/bin && ./icuinfo.exe"
echo 'Run icuinfo from CMD shell' && cd /d C:\tools\msys64\tmp\build-icu\bin && set PATH=C:\tools\msys64\mingw64\bin;%PATH% && icuinfo.exe"
displayName: 'run icuinfo'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_MacOS_WarningsAsErrors
displayName: 'C: macOS(Latest) Clang WarningsAsErrors'
timeoutInMinutes: 30
pool:
vmImage: 'macOS-latest'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j -l2.5 check
displayName: 'Build and Test (WarningsAsErrors)'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_icuexportdata_Ubuntu_2204
displayName: 'C: Create Artifacts from icuexportdata'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
displayName: 'Build'
env:
CC: clang
CXX: clang++
- script: |
cd icu4c/source
mkdir -p icuexportdata/uprops/fast
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/fast --trie-type fast --all
mkdir -p icuexportdata/uprops/small
./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/small --trie-type small --all
displayName: 'Build property data files'
env:
LD_LIBRARY_PATH: lib
- script: |
cd icu4c/source
mkdir -p icuexportdata/norm/fast
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/fast --trie-type fast --all
mkdir -p icuexportdata/norm/small
./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/small --trie-type small --all
displayName: 'Build normalization data files'
env:
LD_LIBRARY_PATH: lib
- script: |
cd icu4c/source
mkdir -p icuexportdata/ucase/fast
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/fast --trie-type fast --all
mkdir -p icuexportdata/ucase/small
./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/small --trie-type small --all
displayName: 'Build case data files'
env:
LD_LIBRARY_PATH: lib
- script: |
cd icu4c/source
FILES=`ls data/coll "*.txt"`
mkdir -p icuexportdata/collation/unihan
./bin/genrb -X -s data/coll/ --ucadata data/in/coll/ucadata-unihan-icu4x.icu -d icuexportdata/collation/unihan $FILES
rm icuexportdata/collation/unihan/*.res
mkdir -p icuexportdata/collation/implicithan
./bin/genrb -X -s data/coll/ --ucadata data/in/coll/ucadata-implicithan-icu4x.icu -d icuexportdata/collation/implicithan $FILES
rm icuexportdata/collation/implicithan/*.res
displayName: 'Build collation data files'
env:
LD_LIBRARY_PATH: lib
- script: |
cd icu4c/source
mkdir -p icuexportdata/segmenter/dictionary
for FILE in `ls data/brkitr/dictionaries`
do
./bin/gendict --uchars --toml data/brkitr/dictionaries/$FILE icuexportdata/segmenter/dictionary/`basename $FILE .txt`.toml
done
displayName: 'Build segmenter dictionary files'
env:
LD_LIBRARY_PATH: lib
- task: ArchiveFiles@2
displayName: 'Zip'
inputs:
rootFolderOrFile: 'icu4c/source/icuexportdata'
includeRootFolder: false
archiveFile: 'icuexportdata_tag-goes-here.zip'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: 'icuexportdata_tag-goes-here.zip'
ArtifactName: 'icuexportdata_output'
#-------------------------------------------------------------------------
# Builds MSVC with cpp exceptions turned off
- job: ICU4C_MSVC_x64_Release_NoExceptions
displayName: 'C: MSVC 64-bit Release No Exceptions'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: '/p:_HAS_EXCEPTIONS=0'
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
+47
View File
@@ -0,0 +1,47 @@
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
trigger:
branches:
include:
- main
- maint/maint-*
paths:
include:
- icu4j
- .ci-builds/.azure-pipelines-icu4j.yml
pr:
branches:
include:
- main
- maint/maint-*
paths:
include:
- icu4j
- .ci-builds/.azure-pipelines-icu4j.yml
variables:
MAVEN_ARGS: '--show-version --no-transfer-progress'
jobs:
#-------------------------------------------------------------------------
- job: ICU4J_OpenJDK_Ubuntu_2204
displayName: 'J: Linux OpenJDK (Ubuntu 22.04)'
timeoutInMinutes: 20
pool:
vmImage: 'ubuntu-22.04'
demands: ant
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
echo "Building ICU4J" && cd icu4j && mvn install
displayName: 'Build and Test'
env:
BUILD: ICU4J
# exit with a non-zero status in order to make this step show as a red X in the UI.
- script: |
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;` && exit 1
condition: failed() # only run if the build fails.
displayName: 'List failures (if any)'
-631
View File
@@ -1,631 +0,0 @@
# Azure Pipelines (VSTS) configuration for CI builds for ICU.
jobs:
#-------------------------------------------------------------------------
- job: ICU4J_OpenJDK_Ubuntu_1804
displayName: 'J: Linux OpenJDK (Ubuntu 18.04)'
timeoutInMinutes: 20
pool:
vmImage: 'ubuntu-18.04'
demands: ant
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
echo "Building ICU4J" && cd icu4j && ant init && ant check && ant localespiCheck
displayName: 'Build and Test'
env:
BUILD: ICU4J
# exit with a non-zero status in order to make this step show as a red X in the UI.
- script: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;` && exit 1
condition: failed() # only run if the build fails.
displayName: 'List failures (if any)'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_1804
displayName: 'C: Linux Clang (Ubuntu 18.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
displayName: 'Build and Test'
env:
CC: clang
CXX: clang++
- script: |
cd icu4c/source/test/cintltst && LANG=C LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
displayName: 'Test C Default locale'
- script: |
cd icu4c/source/test/cintltst && LANG=C.UTF-8 LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./cintltst /tsutil/cloctst/TestCDefaultLocale
displayName: 'Test C.UTF-8 Default locale'
#-------------------------------------------------------------------------
- job: ICU4C_Clang13_Ubuntu_2004_WarningsAsErrors
displayName: 'C: Linux Clang-13 WarningsAsErrors (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Install Clang-13 from https://apt.llvm.org/
- script: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
sudo apt update
sudo apt install -qy clang-13 lld-13 libc++-13-dev libc++abi-13-dev
displayName: 'Install Clang-13'
- script: |
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor -Wsuggest-override" && cd icu4c/source && ./runConfigureICU Linux && make -j2 tests
displayName: 'Build only (WarningsAsErrors)'
env:
CC: clang-13
CXX: clang++-13
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_DataFilter_1804
displayName: 'C: Linux Clang DataFilter (Ubuntu 18.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && \
ICU_DATA_FILTER_FILE=../../.ci-builds/data-filter.json ./runConfigureICU Linux && \
make -j2 tests && \
\[ ! -d data/out/build/icudt66l/translit \] && \
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData)
displayName: 'Build with Data Filter'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Cpp14_Debug_Ubuntu_1804
displayName: 'C: Linux Clang C++17 Debug (Ubuntu 18.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j2 check
displayName: 'Build and Test C++17'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_GCC_Ubuntu_2004
displayName: 'C: Linux GCC (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
displayName: 'Build and Test'
env:
CC: gcc
CXX: g++
#-------------------------------------------------------------------------
- job: ICU4C_GCC11_Cpp20_Ubuntu_2004
displayName: 'C: Linux GCC-11 C++20 (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11
displayName: 'Install GCC-11'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
displayName: 'Build and Test'
env:
CC: gcc-11
CXX: g++-11
CXXFLAGS: '-std=c++20 -fext-numeric-literals'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_2004_LANG
displayName: 'C: Linux Clang (Ubuntu 20.04) - LANG has extension tags'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
displayName: 'Build and Test'
env:
CC: clang
CXX: clang++
LANG: "en_US@calendar=gregorian;hours=h12"
#-------------------------------------------------------------------------
- job: ICU4C_Clang13_Cpp20_Ubuntu_2004
displayName: 'C: Linux Clang-13 C++20 (Ubuntu 20.04)'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
# Install Clang-13 from https://apt.llvm.org/
- script: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
sudo apt update
sudo apt install -qy clang-13 lld-13 libc++-13-dev libc++abi-13-dev
displayName: 'Install Clang-13'
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
displayName: 'Build and Test'
env:
CC: clang-13
CXX: clang++-13
CXXFLAGS: '-std=c++20'
#-------------------------------------------------------------------------
# VS 2019 Builds
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_Distrelease
displayName: 'C: MSVC 64-bit Release (VS 2019) + Distrelease'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (x64)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch x64'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish x64 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x64_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_DataFilter
displayName: 'C: MSVC 64-bit Release DataFilter (VS 2019)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- powershell: |
$filterPath = $Env:BUILD_SOURCESDIRECTORY + "\.ci-builds\data-filter.json"
$vstsCommandString = "vso[task.setvariable variable=ICU_DATA_FILTER_FILE]" + $filterPath
Write-Host "##$vstsCommandString"
- task: VSBuild@1
displayName: 'Build Solution with Data Filter'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: '/p:SkipUWP=true'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x86_Release_Distrelease
displayName: 'C: MSVC 32-bit Release (VS 2019) + Distrelease'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: Win32
configuration: Release
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x86 Release'
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (x86)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch x86'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish x86 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_x86_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_ARM32_ARM64_Release_Distrelease
displayName: 'C: MSVC x64 ARM32 ARM64 Release (VS 2019) + Distrelease ARM64'
timeoutInMinutes: 60
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
- task: VSBuild@1
displayName: 'Build ARM32'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM
configuration: Release
- task: VSBuild@1
displayName: 'Build ARM64'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM64
configuration: Release
- task: PowerShell@2
displayName: 'PowerShell: Distrelease script (ARM64)'
inputs:
targetType: filePath
filePath: 'icu4c/packaging/distrelease.ps1'
arguments: '-arch ARM64'
workingDirectory: icu4c
- task: PublishBuildArtifacts@1
displayName: 'Publish ARM64 Artifacts: icu-windows.zip'
inputs:
PathtoPublish: 'icu4c/source/dist/icu-windows.zip'
ArtifactName: '$(Build.BuildNumber)_ICU4C_MSVC_ARM64_Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_ARM64_Debug
displayName: 'C: MSVC x64 ARM64 Debug (VS 2019)'
timeoutInMinutes: 45
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Debug
- task: BatchScript@1
displayName: 'Run x64 Debug Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Debug'
- task: VSBuild@1
displayName: 'Build ARM64 Debug'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: ARM64
configuration: Debug
#-------------------------------------------------------------------------
# There is no /std:c++20 yet, so use c++latest as that includes many of
# the C++20 compiler and library changes.
- job: ICU4C_MSVC_x64_Release_CppLatest
displayName: 'C: MSVC 64-bit Release (VS 2019) /std:c++latest'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: '/p:LanguageStandard="stdcpplatest"'
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
#-------------------------------------------------------------------------
# VS2019 using the VS2017 toolset builds
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_VS2017
displayName: 'C: MSVC 64-bit Release (VS 2017)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: /p:DefaultPlatformToolset=v141
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x86_Debug_VS2017
displayName: 'C: MSVC 32-bit Debug (VS 2017)'
timeoutInMinutes: 60
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: Win32
configuration: Debug
msbuildArgs: /p:DefaultPlatformToolset=v141
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x86 Debug'
#-------------------------------------------------------------------------
# VS2019 using the VS2015 toolset
#-------------------------------------------------------------------------
- job: ICU4C_MSVC_x64_Release_VS2015
displayName: 'C: MSVC 64-bit Release (VS 2015)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: x64
configuration: Release
msbuildArgs: /p:SkipUWP=true /p:DefaultPlatformToolset=v140 /p:AutodetectWin10SDK=true
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: 'x64 Release'
#-------------------------------------------------------------------------
- job: ICU4C_MSYS2_GCC_x86_64_Release
displayName: 'C: MSYS2 GCC x86_64 Release'
timeoutInMinutes: 45
pool:
vmImage: 'windows-2019'
demands:
- Cmd
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
choco install -y msys2
rem refreshenv
displayName: 'Install MSYS2'
- script: |
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Hello World' && uname -a"
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S mingw-w64-x86_64-toolchain"
c:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S make"
exit
displayName: 'Install mingw-w64-x86_64-toolchain'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j2 check"
displayName: 'Build and Test'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && make install && cd /tmp/build-icu && echo 'Recursive ls' && ls -lR"
displayName: 'make install'
- script: |
set MSYSTEM=MINGW64
c:\tools\msys64\usr\bin\bash.exe -lc "echo 'Run icuinfo from MSYS shell' && cd /tmp/build-icu/bin && ./icuinfo.exe"
echo 'Run icuinfo from CMD shell' && cd /d C:\tools\msys64\tmp\build-icu\bin && set PATH=C:\tools\msys64\mingw64\bin;%PATH% && icuinfo.exe"
displayName: 'run icuinfo'
#-------------------------------------------------------------------------
- job: ICU4C_Clang_MacOSX_WarningsAsErrors
displayName: 'C: macOSX Clang WarningsAsErrors (Catalina 10.15)'
timeoutInMinutes: 30
pool:
vmImage: 'macOS-10.15'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j2 check
displayName: 'Build and Test (WarningsAsErrors)'
env:
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
- job: ICU4C_Cygwin_GCC_x86_64_Release
displayName: 'C: Cygwin GCC x86_64 Release'
timeoutInMinutes: 180
pool:
vmImage: 'windows-2019'
variables:
ICU_CI_CACHE: c:\icu-ci-cache
CYG_URL: https://cygwin.com/setup-x86_64.exe
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYG_PACKAGES: automake,gcc-core,gcc-g++,make,pkg-config,perl,python3
CYG_ROOT: c:\cygwin-root
CYG_CACHE: '$(ICU_CI_CACHE)\cygwin64-v3'
CYG_CACHED_SETUP: '$(CYG_CACHE)\setup.exe'
CYG_VERSION_KEY: cygwin-3.2
steps:
# Use 'autocrlf input' since checked-in files may already be using CRLF.
- script: |
git config --global core.autocrlf input
displayName: 'Configure Git to checkout with Unix line endings (LF)'
- checkout: self
lfs: true
fetchDepth: 10
# Cache expires after 7 days of no activity.
- task: Cache@2
displayName: 'Restore Cygwin cache'
inputs:
# Use the contents of the file ".azure-pipelines.yml" as part of the key, as that contains the list of CYG_PACKAGES.
# Also include the Cygwin version as part of the key. If we want to use a newer version of Cygwin, we can update CYG_VERSION_KEY.
# Note: CYG_VERSION_KEY may become out of sync with (older than) the version we actually use if we update this file
# without updating CYG_VERSION_KEY. Any updates to this file guarantees that we're using the latest version.
key: '"$(CYG_VERSION_KEY)" | .ci-builds/.azure-pipelines.yml'
path: "$(CYG_CACHE)"
- task: PowerShell@2
displayName: 'Download Cygwin setup'
inputs:
targetType: inline
script: |
if ( !(Test-Path "${env:CYG_CACHED_SETUP}" -NewerThan (Get-Date).AddDays(-7)) )
{
Write-Host "Cached Cygwin setup does not exist or is older than 7 days, downloading from external site."
New-Item -Force -Type Directory $env:CYG_CACHE
Write-Host "Downloading Cygwin setup..."
$start_time = Get-Date
(New-Object System.Net.WebClient).DownloadFile($env:CYG_URL, $env:CYG_CACHED_SETUP)
Write-Output "Download took: $((Get-Date).Subtract($start_time).Seconds) second(s)."
}
- script: |
%CYG_CACHED_SETUP% --no-verify --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site "%CYG_MIRROR%" --root "%CYG_ROOT%" --local-package-dir "%CYG_CACHE%" --packages "%CYG_PACKAGES%"
displayName: 'Install Cygwin'
- script: |
%CYG_ROOT%\\bin\\sh -lc 'echo Hello' && %CYG_ROOT%\\bin\\sh -lc 'uname -a'
displayName: 'Check Cygwin environment'
- script: |
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests"
displayName: 'Build ICU (source and test)'
env:
CC: gcc
CXX: g++
- script: |
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make check"
displayName: 'Run Tests'
env:
CC: gcc
CXX: g++
#-------------------------------------------------------------------------
- job: ICU4C_icuexportdata_Ubuntu_1804
displayName: 'C: Create Artifacts from icuexportdata'
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
cd icu4c/source && ./runConfigureICU Linux && make -j2
displayName: 'Build'
env:
CC: clang
CXX: clang++
- script: |
mkdir -p icu4c/source/icuexportdata_uprops_full/fast
mkdir -p icu4c/source/icuexportdata_uprops_full/small
cd icu4c/source
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_full/fast --trie-type fast --all
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_full/small --trie-type small --all
displayName: 'Build Unicode property data export file (Full)'
# In the sample file, include:
# - Basic binary properties: AHex WSpace
# - Property of strings: Basic_Emoji
# - POSIX binary property: blank
# - Enumerated properties: gc nt sc
- script: |
mkdir -p icu4c/source/icuexportdata_uprops_sample/fast
mkdir -p icu4c/source/icuexportdata_uprops_sample/small
cd icu4c/source
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_sample/fast --trie-type fast AHex gc nt Basic_Emoji sc WSpace blank
LD_LIBRARY_PATH=lib ./bin/icuexportdata --mode uprops --index --copyright --destdir icuexportdata_uprops_sample/small --trie-type small AHex gc nt Basic_Emoji sc WSpace blank
displayName: 'Build Unicode property data export file (Sample)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: icuexportdata_uprops_full'
inputs:
PathtoPublish: 'icu4c/source/icuexportdata_uprops_full'
ArtifactName: 'icuexportdata_uprops_full'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: icuexportdata_uprops_sample'
inputs:
PathtoPublish: 'icu4c/source/icuexportdata_uprops_sample'
ArtifactName: 'icuexportdata_uprops_sample'
+139
View File
@@ -0,0 +1,139 @@
# Azure Pipelines (VSTS) configuration for testing things post merging
trigger:
branches:
include:
- main
- maint/*
jobs:
#-------------------------------------------------------------------------
# VS 2022 Builds for testing C Samples on Windows
#-------------------------------------------------------------------------
- job: ICU4C_Samples_MSVC
displayName: 'C: Test Samples MSVC (VS 2022)'
timeoutInMinutes: 30
pool:
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- Cmd
strategy:
maxParallel: 0
matrix:
x64_Debug:
arch: x64
config: Debug
platform: x64
x64_Release:
arch: x64
config: Release
platform: x64
x86_Debug:
arch: x86
config: Debug
platform: Win32
x86_Release:
arch: x86
config: Release
platform: Win32
steps:
- checkout: self
lfs: true
fetchDepth: 10
- task: VSBuild@1
displayName: 'Build Solution'
inputs:
solution: icu4c/source/allinone/allinone.sln
platform: $(platform)
configuration: $(config)
- task: BatchScript@1
displayName: 'Run Tests (icucheck.bat)'
inputs:
filename: icu4c/source/allinone/icucheck.bat
arguments: '$(arch) $(config)'
- task: VSBuild@1
displayName: 'Build Sample Solution'
inputs:
solution: icu4c/source/samples/all/all.sln
platform: $(arch)
configuration: $(config)
- task: BatchScript@1
displayName: 'Test Samples (samplecheck.bat)'
inputs:
filename: icu4c/source/samples/all/samplecheck.bat
arguments: '$(arch) $(config)'
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# Other C tests
#-------------------------------------------------------------------------
- job: ICU4C_Cygwin_GCC_x86_64_Release
displayName: 'C: Cygwin GCC x86_64 Release'
timeoutInMinutes: 50
pool:
vmImage: 'windows-2019'
variables:
ICU_CI_CACHE: c:\icu-ci-cache
CYG_URL: https://cygwin.com/setup-x86_64.exe
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYG_PACKAGES: automake,gcc-core,gcc-g++,make,pkg-config,perl,python3
CYG_ROOT: c:\cygwin-root
CYG_CACHE: '$(ICU_CI_CACHE)\cygwin64-v3'
CYG_CACHED_SETUP: '$(CYG_CACHE)\setup.exe'
CYG_VERSION_KEY: cygwin-3.2
steps:
# Use 'autocrlf input' since checked-in files may already be using CRLF.
- script: |
git config --global core.autocrlf input
displayName: 'Configure Git to checkout with Unix line endings (LF)'
- checkout: self
lfs: true
fetchDepth: 10
# Cache expires after 7 days of no activity.
- task: Cache@2
displayName: 'Restore Cygwin cache'
inputs:
# Use the contents of the file ".azure-pipelines-icu4c.yml" as part of the key, as that contains the list of CYG_PACKAGES.
# Also include the Cygwin version as part of the key. If we want to use a newer version of Cygwin, we can update CYG_VERSION_KEY.
# Note: CYG_VERSION_KEY may become out of sync with (older than) the version we actually use if we update this file
# without updating CYG_VERSION_KEY. Any updates to this file guarantees that we're using the latest version.
key: '"$(CYG_VERSION_KEY)" | .ci-builds/.azure-pipelines-icu4c.yml'
path: "$(CYG_CACHE)"
- task: PowerShell@2
displayName: 'Download Cygwin setup'
inputs:
targetType: inline
script: |
if ( !(Test-Path "${env:CYG_CACHED_SETUP}" -NewerThan (Get-Date).AddDays(-7)) )
{
Write-Host "Cached Cygwin setup does not exist or is older than 7 days, downloading from external site."
New-Item -Force -Type Directory $env:CYG_CACHE
Write-Host "Downloading Cygwin setup..."
$start_time = Get-Date
(New-Object System.Net.WebClient).DownloadFile($env:CYG_URL, $env:CYG_CACHED_SETUP)
Write-Output "Download took: $((Get-Date).Subtract($start_time).Seconds) second(s)."
}
- script: |
%CYG_CACHED_SETUP% --no-verify --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site "%CYG_MIRROR%" --root "%CYG_ROOT%" --local-package-dir "%CYG_CACHE%" --packages "%CYG_PACKAGES%"
displayName: 'Install Cygwin'
- script: |
%CYG_ROOT%\\bin\\sh -lc 'echo Hello' && %CYG_ROOT%\\bin\\sh -lc 'uname -a'
displayName: 'Check Cygwin environment'
- script: |
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests -j -l2.5"
displayName: 'Build ICU (source and test)'
env:
CC: gcc
CXX: g++
- script: |
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make -j -l2.5 check"
displayName: 'Run Tests'
env:
CC: gcc
CXX: g++
-70
View File
@@ -1,70 +0,0 @@
# Azure Pipelines configuration for Valgrind for ICU4C.
#
# Note: The valgrind test configuration is in a separate file
# as it used to be run independently from the regular CI builds.
#
# The Ubuntu images don't have valgrind installed by default, so we need
# install it first.
#
# Run Valgrind for every Pull Request that goes into main
# or a maint- branch. This lets us catch any issues sooner rather than later.
pr:
branches:
include:
- main
- maint/maint-*
paths:
include:
- '*'
exclude:
- docs/*
- icu4j/*
- tools/*
- vendor/*
- .cpyskip.txt
- .travis.yml
- KEYS
- README.md
jobs:
#-------------------------------------------------------------------------
- job: ICU4C_Clang_Valgrind_Ubuntu_1804
displayName: 'C: Linux Clang Valgrind (Ubuntu 18.04)'
timeoutInMinutes: 60
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
lfs: true
fetchDepth: 10
- script: |
set -ex
sudo apt -y update
sudo apt install -y valgrind
displayName: 'Install valgrind'
timeoutInMinutes: 5
- script: |
cd icu4c/source && ./runConfigureICU --enable-debug Linux --disable-renaming && make -j2 tests
displayName: 'Build'
timeoutInMinutes: 10
env:
CC: clang
CXX: clang++
- script: |
cd icu4c/source/test/intltest && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./intltest
displayName: 'Valgrind intltest'
timeoutInMinutes: 45
- script: |
cd icu4c/source/test/cintltst && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./cintltst
displayName: 'Valgrind cintltst'
timeoutInMinutes: 15
- script: |
cd icu4c/source/test/iotest && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./iotest
displayName: 'Valgrind iotest'
timeoutInMinutes: 5
- script: |
cd icu4c/source/tools/icuinfo && LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH valgrind --tool=memcheck --error-exitcode=1 --leak-check=full --show-reachable=yes ./icuinfo
displayName: 'Valgrind icuinfo'
timeoutInMinutes: 5
#-------------------------------------------------------------------------
+2 -1
View File
@@ -24,7 +24,8 @@
},
"brkitr_dictionaries": {
"blacklist": ["cjdict"]
}
},
"lang_tree": "exclude"
},
"resourceFilters": [
{
+4 -4
View File
@@ -92,10 +92,10 @@ icu4c/source/tools/tzcode/zic.c
#
icu4j/eclipse-build/pdebuild/allElements.xml
icu4j/eclipse-build/pdebuild/customTargets.xml
icu4j/main/tests/core/src/com/ibm/icu/dev/data/IDNATestInput.txt
icu4j/main/tests/core/src/com/ibm/icu/dev/data/unicode/confusablesWholeScript.txt
icu4j/main/tests/core/src/com/ibm/icu/dev/data/unicode/UnicodeData.txt
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/testdata/*
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/IDNATestInput.txt
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/confusablesWholeScript.txt
icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/UnicodeData.txt
icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/message2/*.json
icu4j/perf-tests/data/conversion/*
icu4j/perf-tests/data/udhr/*
icu4j/perf-tests/data/collation/thesis.txt
+14
View File
@@ -0,0 +1,14 @@
// © 2022 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
//
// Include Japanese adaboost model.
{
"featureFilters": {
"brkitr_adaboost": {
"includelist": [
"jaml"
]
}
}
}
+15
View File
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
+61
View File
@@ -0,0 +1,61 @@
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# This workflow is designed to keep specific caches on the main
# branch from getting evicted according to the Github Actions policy
# (currently in 2023: 7 days) in cases where the cost to construct
# the cache is high, especially in cases where there is flakiness
# (ex: network loss / throttling when downloading artifacts) involved in
# constructing the cache.
#
# Preventing a cache from eviction using this workflow requires that:
# - the cache is not too big that it starves other caches
# from using the shared cache quota for the repository
# - the cache key is specific enough to avoid cache collisions, according
# to good cache key design
# - the cache key is not overly specific to cause unnecessary cache misses
# (resulting in duplicate caches values, thereby wasting space), according
# to good cache key design
# - For more details, see: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
name: Retain Specific Caches
on:
schedule:
# Because the Github Actions cache eviction policy is every 7 days,
# this cron schedule is set to run every 6 days to ensure retention
- cron: '0 12 */6 * *'
env:
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
permissions:
contents: read
jobs:
retain-maven-cache:
name: Run all tests with Maven
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '11'
- name: Restore read-only cache of local Maven repository
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run Maven unit & integration tests
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify
+573
View File
@@ -0,0 +1,573 @@
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: GHA ICU4C
on:
push:
branches:
- main
- 'maint/maint*'
paths:
- 'icu4c/**'
- '.github/workflows/**'
pull_request:
branches: '**'
paths:
- 'icu4c/**'
- '.github/workflows/**'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
permissions:
contents: read
jobs:
# ICU4C docs build using doxygen..
icu4c-docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C doc
run: |
sudo apt-get -y install doxygen;
cd icu4c/source;
./runConfigureICU Linux --disable-renaming;
# Fail if 'warning:' appears in doxygen's output, but ignore warnings from file Doxyfile.
# Regex note: (?! ... ) is a negative lookahead. Succeed if the pattern is not present.
set +o pipefail && make doc 2>&1 | tee doxygen.log && ( ! grep -P 'warning:(?! .* file .?Doxyfile)' doxygen.log )
# gcc debug build.
# Includes dependency checker.
# Note - the dependency checker needs to be run on both a debug and an optimized build.
# This one (gcc) for debug, and linux clang (see job below) for optimized.
#
# Test both out-of-source and in-source builds. This one (gcc) for out-of-source,
# and linux clang (below) for in-source.
#
# Invokes test/hdrtst to check public headers compliance.
gcc-debug-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with gcc
env:
PREFIX: /tmp/icu-prefix
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
make -j -l4.5 check;
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
make install;
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
# clang release build with some options to enforce useful constraints.
# Includes dependency checker on an in-source, optimized build.
# Includes checking @draft etc. API tags vs. ifndef guards like
# U_HIDE_DRAFT_API and U_FORCE_HIDE_DRAFT_API.
# (FORCE guards make this tool pass but won't compile to working code.
# See the testtagsguards.sh script for details.)
clang-release-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install doxygen
run: |
sudo apt-get -y install doxygen;
- name: Build ICU4C with clang
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
cd icu4c/source;
./runConfigureICU Linux/clang;
make -j -l4.5 check;
- name: Test Dependency
run: |
cd icu4c/source/test/depstest;
python3 depstest.py ../../../source/;
- name: Test Tags Guards
run: |
cd icu4c;
source/test/hdrtst/testtagsguards.sh;
- name: Make Dist
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
cd icu4c/source;
make dist
# clang build with some options
clang-options-build-and-test:
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other options.
fail-fast: false
matrix:
build_option:
[ --enable-static, --enable-static --disable-shared ]
# --disable-shared has a build problem.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build ICU4C with clang
run: |
cd icu4c/source;
./runConfigureICU Linux/clang ${{ matrix.build_option }};
make -j -l4.5 tests;
- name: Test
run: |
cd icu4c/source;
make check;
# Out of source build with gcc 10, c++14, and extra warnings; executes icuinfo.
gcc-10-stdlib17:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with gcc 10 and c++17 and extra warnings.
env:
PREFIX: /tmp/icu-prefix
CC: gcc-10
CXX: g++-10
CXXFLAGS: -std=c++17 -Wextra
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
make -j -l4.5 check;
make -j -l4.5 install;
cd $PREFIX/bin;
LD_LIBRARY_PATH=../lib ./icuinfo
# Clang Linux with address sanitizer.
clang-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and asan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming --enable-tracing;
make -j -l4.5 check;
env:
CPPFLAGS: -fsanitize=address
LDFLAGS: -fsanitize=address
# Clang Linux with undefined-behavior sanitizer.
clang-ubsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and ubsan +alignment
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming;
make -j -l4.5 check;
env:
CPPFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
CFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
LDFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
# Control Flow Integrity.
clang-cfi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang using CFI
run: |
cd icu4c/source;
./runConfigureICU Linux --disable-renaming;
make -j -l4.5 check;
env:
CC: clang
CXX: clang++
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
CXXFLAGS: -flto -fvisibility=hidden -fsanitize=cfi-derived-cast -fno-sanitize-trap=cfi -fno-inline-functions -fno-inline -fno-omit-frame-pointer -O1
# add -fsanitize=cfi-vcall -fsanitize=cfi-icall later
LDFLAGS: -flto -fvisibility=hidden -fuse-ld=gold -fsanitize=cfi-derived-cast -fsanitize=cfi-unrelated-cast -fno-sanitize-trap=cfi -fsanitize-cfi-icall-generalize-pointers
# Clang Linux with thread sanitizer.
clang-tsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang and tsan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming
make -j -l4.5;
make -j -l4.5 -C test;
make -j -l4.5 -C test/intltest check
env:
INTLTEST_OPTS: utility/MultithreadTest
CPPFLAGS: -fsanitize=thread
LDFLAGS: -fsanitize=thread
# MacOS with clang
macos-clang:
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C with clang on MacOS
run: |
cd icu4c/source;
PYTHON=python3 ./runConfigureICU MacOSX;
make -j -l4.5 check
# Run ICU4C tests with stubdata.
run-with-stubdata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C tests with stubdata
run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 check;
rm lib/libicudata.so*;
cp -P stubdata/libicudata.so* lib;
cd test/cintltst;
echo 'Running ICU4C cintltst with stubdata.';
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
CINTLTST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_ctest.log;
if ! grep 'Elapsed Time: ' stubdata_ctest.log
then
echo
echo cintltst run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
cd ../intltest;
echo 'Running ICU4C intltest with stubdata.';
INTLTEST_OPTS=-w make -j -l4.5 check 2>&1 | tee stubdata_intltest.log;
if ! grep 'Elapsed Time: ' stubdata_intltest.log
then
echo
echo intltest run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
# Test U_CHARSET_IS_UTF8
u-charset-is-utf8-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
make -j -l4.5 check
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
u-override-cxx-allocation-is-0-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
make clean;
make -j -l4.5 check
# Test LSTM
lstm-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 check
# Test adaboost
adaboost-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 check
# Build and run testmap
testmap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 check;
CONFIG_FILES=test/testmap/Makefile ./config.status;
cd test/testmap;
make -j -l4.5 check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
# Copyright scan
copyright-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: perl tools/scripts/cpysearch/cpyscan.pl
# Check compilation of internal headers.
internal-header-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: cd icu4c/source; test/hdrtst/testinternalheaders.sh
# Check source files for valid UTF-8 and for absence of BOM.
valid-UTF-8-and-no-BOM-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: tools/scripts/icu-file-utf8-check.py
# Run unit tests with UCONFIG_NO_XXX variations.
uconfig-unit-tests:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
fail-fast: false
matrix:
uconfig_cppflags:
# Ignore the following two.
# - "-DUCONFIG_NO_FILE_IO=1"
# - "-DUCONFIG_NO_CONVERSION=1"
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
- "-DUCONFIG_NO_NORMALIZATION=1"
- "-DUCONFIG_NO_BREAK_ITERATION=1"
- "-DUCONFIG_NO_IDNA=1"
- "-DUCONFIG_NO_COLLATION=1"
- "-DUCONFIG_NO_FORMATTING=1"
- "-DUCONFIG_NO_MF2=1"
- "-DUCONFIG_NO_TRANSLITERATION=1"
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
- "-DUCONFIG_NO_SERVICE=1"
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
# Turn on all the options in one test.
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Verify no additional new UCONFIG_NO_xxx added
run: |
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
expected_count="13";
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
if [ $expected_count != $count ]; then
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $expected_count;
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
exit -1
fi
- name: Build and Test
env:
CPPFLAGS: ${{ matrix.uconfig_cppflags }}
run: |
cd icu4c/source/;
./runConfigureICU Linux;
make -j -l4.5 tests;
# Run header tests with UCONFIG_NO_XXX variations.
uconfig-header-tests:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other uconfig.
fail-fast: false
matrix:
uconfig_cppflags:
# Ignore the following two.
# - "-DUCONFIG_NO_FILE_IO=1"
# - "-DUCONFIG_NO_CONVERSION=1"
- "-DUCONFIG_NO_LEGACY_CONVERSION=1"
- "-DUCONFIG_NO_NORMALIZATION=1"
- "-DUCONFIG_NO_BREAK_ITERATION=1"
- "-DUCONFIG_NO_IDNA=1"
- "-DUCONFIG_NO_COLLATION=1"
- "-DUCONFIG_NO_FORMATTING=1"
- "-DUCONFIG_NO_MF2=1"
- "-DUCONFIG_NO_TRANSLITERATION=1"
- "-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
- "-DUCONFIG_NO_SERVICE=1"
- "-DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
# Turn on all the options in one test.
- "-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_FILTERED_BREAK_ITERATION=1"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Verify no additional new UCONFIG_NO_xxx added
run: |
# Test that we have exactly 13 "#ifndef UCONFIG_NO_" in uconfig.h. If the number changes, we need to also
# adjust the uconfig_cppflags above to include the new one and update the "13" below.
count=`egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h| wc -l`;
if [ "13" != $count ]; then
echo "More than %s UCONFIG_NO_* defined in uconfig.h, please adjust uconfig_cppflags above to include any newly added flag" % $count;
echo "Currently UCONFIG_NO_* defined in uconfig.h:";
egrep "#ifndef UCONFIG_NO_" icu4c/source/common/unicode/uconfig.h;
exit -1
fi
- name: Build and Install
run: |
cd icu4c/source/;
mkdir /tmp/icu_cnfg;
./runConfigureICU Linux --prefix=/tmp/icu_cnfg;
make -j -l4.5 install;
- name: Test
env:
UCONFIG_NO: ${{ matrix.uconfig_cppflags }}
run: |
cd icu4c/source/;
PATH=/tmp/icu_cnfg/bin:$PATH make -C test/hdrtst check;
# Build Unicode update tools
unicode-update-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0
- name: Get CI Linux runner VM version
id: linux-version
run: |
echo "LINUX_VERSION=$(grep -F VERSION_ID /etc/os-release | cut -d'"' -f2)" >> $GITHUB_OUTPUT
- name: Mount bazel cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: "~/.cache/bazel"
key: bazel-${{ runner.os }}-${{ steps.linux-version.outputs.LINUX_VERSION }}
- name: Generate the data
run: |
export ICU_SRC=`pwd`;
icu4c/source/data/unidata/generate.sh;
if $?
then
echo
echo Build of Unicode update tools failed.
echo See
echo https://unicode-org.github.io/icu/processes/unicode-update#bazel-build-process
echo for how to reproduce and debug the failure
exit 1
fi
git diff --exit-code;
if $?
then
echo
echo ICU unicode data has changed!
echo Did you forget to include the changed data files in this PR?
exit 1
fi
# Build and run ICU4C samples
icu4c-test-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: ICU4C configure and build
run: |
# Perform an out-of-source build of icu4c
mkdir /tmp/icu_samples
cd icu4c/source
./runConfigureICU Linux -prefix=/tmp/icu_samples
make install
# Reference the paths in the new build
cd samples
# To clean all the test binaries
make clean-samples-recursive
# To rebuild them all
echo "Make all samples"
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make all-samples-recursive
# To run all tests serially
echo "Run all samples"
pwd
PATH=$PATH:/tmp/icu_samples/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/icu_samples/lib make check-samples-recursive
# https://unicode-org.github.io/icu/processes/release/tasks/integration.html#verify-that-icu4c-tests-pass-without-collation-rule-strings
icu4c-without-collation-rule-strings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install hjson dependency
run: |
sudo apt-get install python3-pip
pip3 install hjson
- name: Create data filter file to remove collation rule strings
run: |
cat > icu4c/coll-norules.hjson <<EOL
{
resourceFilters: [
{
categories: [
coll_tree
]
rules: [
-/UCARules
-/collations/*/Sequence
]
}
]
}
EOL
- name: Configure ICU4C with the data filter file
env:
ICU_DATA_FILTER_FILE: ../coll-norules.hjson
run: |
cd icu4c/source
./runConfigureICU Linux
- name: Run tests with data-errors-as-warnings
env:
INTLTEST_OPTS: -w
CINTLTST_OPTS: -w
run: |
cd icu4c/source
make -j -l4.5 check
# https://unicode-org.github.io/icu/processes/release/tasks/healthy-code.html#test-uconfig_no_conversion
icu4c-uconfig-no-conversion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set UCONFIG_NO_CONVERSION and configure ICU4C
env:
UCONFIG_NO_CONVERSION: 1
run: |
cd icu4c/source
./runConfigureICU Linux
- name: Run make for stubdata, common, i18n
run: |
cd icu4c/source
pushd stubdata && make -j -l4.5 && popd
# Ensure lib directory for output object file exists
mkdir -p lib
pushd common && make -j -l4.5 && popd
pushd i18n && make -j -l4.5 && popd
+180
View File
@@ -0,0 +1,180 @@
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: GHA ICU4J
on:
push:
branches:
- main
- 'maint/maint*'
paths:
- 'icu4j/**'
- '.github/workflows/**'
pull_request:
branches: '**'
paths:
- 'icu4j/**'
- '.github/workflows/**'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
env:
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
permissions:
contents: read
jobs:
# Initialize the Maven artifact cache
#
# This job is created according to the cache strategy of reuse from a single job:
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
icu4j-mvn-init-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
# Download all of the artifacts needed for the code and build plugins, but
# exclude any needed by profiles depending on system artifacts
- name: Download all artifacts
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
# ICU4J build and unit test using Maven
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
icu4j-mvn-build-and-test:
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
java-version: [ '8', '11', '17' ]
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Restore read-only cache of local Maven repository
uses: actions/cache/restore@v4
id: cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: ICU4J
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify
- name: List failures (if any)
run: |
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
if: ${{ failure() }}
# ICU4J build and unit test under lstm
lstm-icu4j-build-and-test:
if: false # TODO(ICU-22505)
needs: icu4j-mvn-init-cache
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Restore read-only cache of local Maven repository
uses: actions/cache/restore@v4
id: cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Config LSTM and Rebuild data jar
run: |
cd icu4c/source;
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
cd ../..
- name: ICU4J
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify
- name: List failures (if any)
run: |
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
if: ${{ failure() }}
# ICU4J build and unit test under adaboost
adaboost-icu4j-build-and-test:
if: false # Temporary disable, until we disable the .jar creation from C and distribute the individual files
needs: icu4j-mvn-init-cache
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Restore read-only cache of local Maven repository
uses: actions/cache/restore@v4
id: cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Config Adaboost and Rebuild data jar
run: |
cd icu4c/source;
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j -l4.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
cd ../..
- name: ICU4J
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} -Dcom.ibm.icu.impl.breakiter.useMLPhraseBreaking=true verify
- name: List failures (if any)
run: |
cd icu4j && cat `find . -name surefire-reports -type d -exec grep -l -r --include="*.txt" FAILED {} \;`;
if: ${{ failure() }}
-442
View File
@@ -1,442 +0,0 @@
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: GHA CI
on:
push:
branches:
- main
- 'maint/maint*'
pull_request:
branches: '**'
jobs:
# ICU4C docs build using doxygen..
icu4c-docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C doc
run: |
sudo apt-get -y install doxygen;
cd icu4c/source;
./runConfigureICU Linux --disable-renaming;
# Fail if 'warning:' appears in doxygen's output, but ignore warnings from file Doxyfile.
# Regex note: (?! ... ) is a negative lookahead. Succeed if the pattern is not present.
set +o pipefail && make doc 2>&1 | tee doxygen.log && ( ! grep -P 'warning:(?! .* file .?Doxyfile)' doxygen.log )
# Java7 ICU4J build and unit test
java7-icu4j-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: Cache for Java 7 tarball
id: cache-java7
uses: actions/cache@v2
with:
path: java7-tarball
key: ${{ runner.os }}-java7-tarball
- name: Download Java 7
if: steps.cache-java7.outputs.cache-hit != 'true'
run: |
mkdir -p java7-tarball
download_url="https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz"
wget -O java7-tarball/java_package.tar.gz $download_url
pushd java7-tarball
gunzip java_package.tar.gz
tar xvf java_package.tar
popd
- name: Configure Ant build to use Java 7 JRE
run: |
echo "java7.bootclasspath" > $RUNNER_TEMP/draft
ls java7-tarball/java-se-7u75-ri/jre/lib/*.jar|paste -sd ":" - >> $RUNNER_TEMP/draft
paste -sd "=" < $RUNNER_TEMP/draft > icu4j/build-local.properties
- name: ICU4J
run: |
cd icu4j;
ant init;
ant check;
ant localespiCheck
- name: List failures (if any)
run: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
if: ${{ failure() }}
# ICU4J build and unit test under Java11
java11-icu4j-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@v1
with:
java-version: '11'
- name: ICU4J
run: |
cd icu4j;
ant init;
ant check;
ant localespiCheck
- name: List failures (if any)
run: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
if: ${{ failure() }}
# ICU4J build and unit test under Java16
java16-icu4j-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@v1
with:
java-version: '16'
- name: ICU4J
run: |
cd icu4j;
ant init;
ant check;
ant localespiCheck
- name: List failures (if any)
run: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
if: ${{ failure() }}
# ICU4J build and unit test under lstm
lstm-icu4j-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@v1
with:
java-version: '11'
- name: Config LSTM and Rebuild data jar
run: |
cd icu4c/source;
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j2 ICU4J_ROOT=../../../icu4j icu4j-data-install;
cd ../..
- name: ICU4J
run: |
cd icu4j;
ant init;
ant check;
ant localespiCheck
- name: List failures (if any)
run: |
[ -d icu4j/out/junit-results ] && cd icu4j && cat `find out/junit-results -name "*.txt" -exec grep -l FAILED {} \;`;
if: ${{ failure() }}
# gcc debug build.
# Includes dependency checker.
# Note - the dependency checker needs to be run on both a debug and an optimized build.
# This one (gcc) for debug, and linux clang (see job below) for optimized.
#
# Test both out-of-source and in-source builds. This one (gcc) for out-of-source,
# and linux clang (below) for in-source.
#
# Invokes test/hdrtst to check public headers compliance.
gcc-debug-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with gcc
env:
PREFIX: /tmp/icu-prefix
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
make -j2;
make -j2 check;
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
make install;
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
# clang release build with some options to enforce useful constraints.
# Includes dependency checker on an in-source, optimized build.
# Includes checking @draft etc. API tags vs. ifndef guards like
# U_HIDE_DRAFT_API and U_FORCE_HIDE_DRAFT_API.
# (FORCE guards make this tool pass but won't compile to working code.
# See the testtagsguards.sh script for details.)
clang-release-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with clang
env:
CPPFLAGS: -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1
CFLAGS: -Wimplicit-fallthrough
CXXFLAGS: -Wimplicit-fallthrough
run: |
sudo apt-get -y install doxygen;
cd icu4c/source;
./runConfigureICU Linux;
make -j 2;
make -j 2 check;
( cd test/depstest && python3 depstest.py ../../../source/ );
( cd .. && source/test/hdrtst/testtagsguards.sh );
make dist
# Out of source build with gcc 10, c++14, and extra warnings; executes icuinfo.
gcc-10-stdlib14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with gcc 10 and c++14 and extra warnings.
env:
PREFIX: /tmp/icu-prefix
CC: gcc-10
CXX: g++-10
CXXFLAGS: -std=c++14 -Wextra
run: |
mkdir build;
cd build;
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
make -j2;
make -j2 check;
make install;
cd $PREFIX/bin;
LD_LIBRARY_PATH=../lib ./icuinfo
# Clang Linux with address sanitizer.
clang-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with clang and asan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming --enable-tracing;
make -j2;
make -j2 check
env:
CPPFLAGS: -fsanitize=address
LDFLAGS: -fsanitize=address
# Clang Linux with thread sanitizer.
clang-tsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with clang and tsan
run: |
cd icu4c/source;
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming
make -j2;
make -j2 -C test;
make -j2 -C test/intltest check
env:
INTLTEST_OPTS: utility/MultithreadTest
CPPFLAGS: -fsanitize=thread
LDFLAGS: -fsanitize=thread
# MacOS with clang
macos-clang:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C with clang on MacOS
run: |
cd icu4c/source;
PYTHON=python3 ./runConfigureICU MacOSX;
make -j2 check
# Run ICU4C tests with stubdata.
run-with-stubdata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ICU4C tests with stubdata
run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j2 check;
rm lib/libicudata.so*;
cp -P stubdata/libicudata.so* lib;
cd test/cintltst;
echo 'Running ICU4C cintltst with stubdata.';
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
CINTLTST_OPTS=-w make check 2>&1 | tee stubdata_ctest.log;
if ! grep 'Elapsed Time: ' stubdata_ctest.log
then
echo
echo cintltst run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
cd ../intltest;
echo 'Running ICU4C intltest with stubdata.';
INTLTEST_OPTS=-w make check 2>&1 | tee stubdata_intltest.log;
if ! grep 'Elapsed Time: ' stubdata_intltest.log
then
echo
echo intltest run with stubdata failed
echo
echo See
echo https://unicode-org.github.io/icu/processes/release/tasks/integration.html#run-tests-without-icu-data
echo for how to reproduce and debug the failure
exit 1
fi
# Test U_CHARSET_IS_UTF8
u-charset-is-utf8-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
make -j2 check
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
u-override-cxx-allocation-is-0-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cd icu4c/source;
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
make clean;
make -j2 check
# Test LSTM
lstm-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cd icu4c/source;
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
make clean;
make -j2 check
# Build and run testmap
testmap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j2 check;
CONFIG_FILES=test/testmap/Makefile ./config.status;
cd test/testmap;
make check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
# Copyright scan
copyright-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: perl tools/scripts/cpysearch/cpyscan.pl
# Check compilation of internal headers.
internal-header-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cd icu4c/source; test/hdrtst/testinternalheaders.sh
# Check source files for valid UTF-8 and for absence of BOM.
valid-UTF-8-and-no-BOM-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: tools/scripts/icu-file-utf8-check.py
# Verify icu4c release tools buildability.
icu4c-release-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: mvn -f tools/release/java/pom.xml package dependency:analyze
# Run unit tests with UCONFIG_NO_XXX variations.
uconfig_variation-check-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: python3 tools/scripts/uconfig_vars_test.py -u
# Run header tests with UCONFIG_NO_XXX variations.
uconfig_variation-check-all-header-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: python3 tools/scripts/uconfig_vars_test.py -p
# Build Unicode update tools
unicode-update-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v1
- name: Mount bazel cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel
- name: Generate the data
run: |
export ICU_SRC=`pwd`;
icu4c/source/data/unidata/generate.sh;
if $?
then
echo
echo Build of Unicode update tools failed.
echo See
echo https://unicode-org.github.io/icu/processes/unicode-update#bazel-build-process
echo for how to reproduce and debug the failure
exit 1
fi
git diff --exit-code;
if $?
then
echo
echo ICU unicode data has changed!
echo Did you forget to include the changed data files in this PR?
exit 1
fi
+84
View File
@@ -0,0 +1,84 @@
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: ICU Common
on:
push:
branches:
- main
- 'maint/maint*'
pull_request:
branches: '**'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
env:
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
permissions:
contents: read
jobs:
# Copyright scan
copyright-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: perl tools/scripts/cpysearch/cpyscan.pl
# Check source files for valid UTF-8 and for absence of BOM.
valid-UTF-8-and-no-BOM-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: tools/scripts/icu-file-utf8-check.py
# Initialize the Maven artifact cache
#
# This job is created according to the cache strategy of reuse from a single job:
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
icu4j-mvn-init-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v4
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
# Download all of the artifacts needed for the code and build plugins, but
# exclude any needed by profiles depending on system artifacts
- name: Download all artifacts
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
# Verify icu4c release tools buildability.
icu4c-release-tools:
needs: icu4j-mvn-init-cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore read-only cache of local Maven repository
uses: actions/cache/restore@v4
id: cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn ${SHARED_MVN_ARGS} -f tools/release/java/pom.xml package dependency:analyze
+56
View File
@@ -0,0 +1,56 @@
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks.
name: GHA ICU Docs
on:
push:
branches:
- main
- 'maint/maint*'
paths:
- 'docs/**'
- '.github/workflows/**'
pull_request:
branches: '**'
paths:
- 'docs/**'
- '.github/workflows/**'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
permissions:
contents: read
jobs:
# Build job
# Keep in sync with deploy workflow in `jekyll-gh-pages.yml`
test-docs-build:
name: Test build of User Guide docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.4' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
with:
generator_config_file: docs/_config.yml
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
cd docs # root directory of markdown, also contains Jekyll configs, etc.
bundle install
# The baseurl arg is parsed from the `baseurl` field of _config.yml.
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
+146
View File
@@ -0,0 +1,146 @@
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU environment test tasks.
#
name: GHA EnvTest
on:
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
schedule:
# This cron schedule is set to run 10:23 UTC every SAT
- cron: '23 10 * * SAT'
# In addition, during the major release cycle (in March/April, September/October),
# this cron schedule is set to run 10:21 UTC every Workday and Sunday.
- cron: '21 10 * MAR,APR,SEP,OCT MON-FRI,SUN'
permissions:
contents: read
jobs:
#=================================================================
# locale env tests.
env-test-locale:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" let other jobs keep running even if the test break in some locales.
fail-fast: false
matrix:
# Since we have total 500+ locales to run on three set of test, we create
# many jobs to test concurrently.
# shard is used to bucket the lines from the locale list into jobs.
# Currently we run testing of 30 locales per shard, and we have total 17 shards.
# 17x30 = 510 > 502 (the number of locales in 'locale -a').
tests_per_shard: [30]
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
steps:
- name: Install all locales by apt-get
run: |
sudo apt-get update -y;
sudo apt-get install -y locales-all;
- name: Show installed locales post apt-get
run: |
locale -a;
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build
run: |
cd icu4c/source/;
./runConfigureICU Linux;
make -j -l4.5 tests;
- name: Test different locales as LC_ALL
run: |
echo "This job run the environment test of the following Locales";
begin=$(( ${{matrix.shard}} * ${{matrix.tests_per_shard}} + 1));
end=$(( (${{matrix.shard}}+1) * ${{matrix.tests_per_shard}} ));
sedarg=${begin},${end}p;
locale -a |sed -n ${sedarg};
cd icu4c/source/test;
for loc in `locale -a |sed -n ${sedarg}`;
do
echo "============================================";
echo "Start Tests under LC_ALL=$loc locale";
for test_dir in iotest cintltst intltest
do
cd $test_dir;
LC_ALL=$loc make -j -l4.5 check;
cd ..;
done
echo "Complete Tests under LC_ALL=$loc locale";
echo "============================================";
done
echo "This job completed the test of the following Locales";
locale -a |sed -n ${sedarg};
#=================================================================
# tz env tests.
env-test-tz:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" let other jobs keep running even if the test break in some timezones.
fail-fast: false
matrix:
# Since we have total 600+ timezones to run on three set of test, we create
# many jobs to test concurrently.
# shard is used to bucket the lines from the timezone list into jobs.
# Currently we run testing of 30 timezones per shard, and we have total 21 shards.
# 21x30 = 630 > 604 (the number of known timezones).
tests_per_shard: [30]
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
steps:
- name: Install all locales by apt-get
run: |
sudo apt-get update -y;
sudo apt-get install -y tzdata;
- name: Show all the TimeZones
run: |
echo "Total number of TimeZone is "
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|wc -l;
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|cut -d '/' -f5-50;
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build
run: |
cd icu4c/source/;
./runConfigureICU Linux;
make -j -l4.5 tests;
- name: Test different locales as TZ
run: |
echo "This job run the environment test of the following TimeZones";
begin=$(( ${{matrix.shard}} * ${{matrix.tests_per_shard}} + 1));
end=$(( (${{matrix.shard}}+1) * ${{matrix.tests_per_shard}} ));
sedarg=${begin},${end}p;
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50;
echo "The tzdb version on this machine is:";
head -1 /usr/share/zoneinfo/tzdata.zi;
cd icu4c/source/test;
for tz in `find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50`;
do
echo "============================================";
echo "zdump of the system timezone $tz";
zdump $tz;
echo "Start Tests under TZ=$tz TimeZone";
for test_dir in iotest cintltst intltest
do
cd $test_dir;
TZ=$tz make -j -l4.5 check;
cd ..;
done
echo "Complete Tests under TZ=$tz TimeZone";
echo "============================================";
done
echo "This job completed the test of the following TimeZones";
find /usr/share/zoneinfo/ -type f,l|egrep -v "/(right|posix)/"|egrep -v "\.tab"|sed -n ${sedarg}|cut -d '/' -f5-50;
#=================================================================
+789 -8
View File
@@ -8,31 +8,812 @@ name: GHA ICU Merge CI
on:
push:
branches:
- main
- main
- 'maint/maint*'
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
env:
SHARED_MVN_ARGS: '--show-version --no-transfer-progress'
permissions:
contents: read
jobs:
# Test ICU4J with little-endian ICU4C data only
icu4j-little-endian-data-test:
# Initialize the Maven artifact cache
# Uses Java 8 because Java version not deemed significant for downloading
# artifacts
#
# This job is created according to the cache strategy of reuse from a single job:
# https://github.com/actions/cache/blob/main/caching-strategies.md#make-cache-read-only--reuse-cache-from-centralized-job
icu4j-mvn-init-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- uses: actions/setup-java@v1
- name: Cache local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
# Download all of the artifacts needed for the code and build plugins
- name: Download all artifacts
run: |
cd icu4j;
mvn ${SHARED_MVN_ARGS} dependency:go-offline -P '!old_jdk_taglet'
# Test ICU4J with little-endian ICU4C data only
icu4j-little-endian-data-test:
needs: icu4j-mvn-init-cache
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '11'
- name: ICU4J little-endian
run: |
cd icu4c/source;
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ./runConfigureICU Linux;
make -j2 check;
make -j -l4.5 check;
mkdir /tmp/icu4j_data_test;
cp -P data/out/tmp/icudt*l* /tmp/icu4j_data_test/
cd ../../icu4j;
ant clean;
ant -Dicu4c.data.path=/tmp/icu4j_data_test check;
mvn ${SHARED_MVN_ARGS} clean;
mvn ${SHARED_MVN_ARGS} -Dicu4c.data.path=/tmp/icu4j_data_test install
# Compile libraries used by all ICU4C performance tests.
icu4c-store-perf-libs:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build ICU libraries
run: |
cd icu4c/source;
./runConfigureICU Linux;
make -j -l4.5 all;
cd lib;
cp -Ps ../tools/ctestfw/libicutest* .
- name: Upload ICU libraries
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: icu-perf-libs
path: icu4c/source/lib
retention-days: 1
# Assorted ICU4C performance tests
icu4c-performance-tests:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
matrix:
perf: [charperf, usetperf, utfperf]
include:
- perf: charperf
tests: TestIsAlpha TestIsUpper TestIsLower TestIsDigit TestIsSpace TestIsAlphaNumeric TestIsPrint TestIsControl TestToLower TestToUpper TestIsWhiteSpace
- perf: usetperf
tests: titlecase_letter_add titlecase_letter_contains titlecase_letter_iterator unassigned_add unassigned_contains unassigned_iterator pattern1 pattern2 pattern3
- perf: utfperf
tests: Roundtrip FromUnicode FromUTF8
file: "-f ../../icu4j/perf-tests/data/conversion/xuzhimo.txt"
flag: "-e gb18030"
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run ICU4C perf tests
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }})
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 ${{ matrix.file }} ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# Assorted ICU4C performance tests using data files
icu4c-performance-tests-with-files:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
# Matrix of test drivers and test data and, if applicable, flags. Note
# that GHA first excludes the 'exclude:' items from the total of
# combinations and then adds the 'include:' items.
matrix:
perf: [collperf, ustrperf, normperf]
data: [TestNames_Asian, TestNames_Chinese, TestNames_Japanese, TestNames_Japanese_h, TestNames_Japanese_k, TestNames_Korean, TestNames_Latin, TestNames_Russian, TestNames_SerbianSH, TestNames_SerbianSR, TestNames_Simplified_Chinese, TestNames_Thai, th18057, thesis, vfear11a]
include:
- perf: collperf
tests: TestIcu_KeyGen_null TestIcu_qsort_strcoll_null TestIcu_qsort_usekey TestIcu_BinarySearch_strcoll_null TestIcu_BinarySearch_usekey
- perf: ustrperf
tests: TestCtor TestCtor1 TestCtor2 TestCtor3 TestAssign TestAssign1 TestAssign2 TestGetch TestCatenate TestScan TestScan1 TestScan2
flag: "-l -u"
- perf: normperf
tests: TestICU_NFC_NFD_Text TestICU_NFC_NFC_Text TestICU_NFC_Orig_Text TestICU_NFD_NFD_Text TestICU_NFD_NFC_Text TestICU_NFD_Orig_Text
exclude:
- perf: collperf
data: th18057
- perf: collperf
data: thesis
- perf: collperf
data: vfear11a
- perf: ustrperf
data: TestNames_Japanese
- perf: ustrperf
data: thesis
- perf: ustrperf
data: vfear11a
- perf: normperf
data: TestNames_Simplified_Chinese
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run ICU4C perf tests
env:
DATA_FILE_PATH: ../../icu4j/perf-tests/data/collation
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/${{ matrix.perf }} && mkdir -p results/${{ matrix.perf }}/${{ matrix.data }})
LD_LIBRARY_PATH=lib ./test/perf/${{ matrix.perf }}/${{ matrix.perf }} ${{ matrix.flag }} -t 5 -p 10 -f $DATA_FILE_PATH/${{ matrix.data }}.txt ${{ matrix.tests }} | tee test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/${{ matrix.perf }}/${{ matrix.data }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/${{ matrix.perf }}/${{ matrix.data }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# String search performance test
icu4c-strsrchperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4c-store-perf-libs
strategy:
fail-fast: false
# Matrix of locales and corresponding test data.
matrix:
locale: [de, en, fr, ja, ru, th, zh]
include:
- locale: de
data: udhr_deu_1996
- locale: en
data: udhr_eng
- locale: fr
data: udhr_fra
- locale: ja
data: udhr_jpn
- locale: ru
data: udhr_rus
- locale: th
data: udhr_tha
- locale: zh
data: udhr_cmn_hans
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create directory for lib files
run: mkdir icu4c/source/perflib
- name: Get ICU libs
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: icu-perf-libs
path: icu4c/source/lib
- name: Build and run strschrperf test
env:
DATA_FILE_PATH: ../../icu4j/perf-tests/data/udhr
run: |
cd icu4c/source;
./runConfigureICU Linux;
(cd test/perf && make -j -l4.5 everything && mkdir -p results && mkdir -p results/strsrchperf && mkdir -p results/strsrchperf/${{ matrix.locale }})
LD_LIBRARY_PATH=lib ./test/perf/strsrchperf/strsrchperf -b Test_ICU_Forward_Search Test_ICU_Backward_Search -t 5 -p 10 -L ${{ matrix.locale }} -f $DATA_FILE_PATH/${{ matrix.data }}.txt | tee test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4c/source/test/perf/results/strsrchperf/${{ matrix.locale }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/strsrchperf/${{ matrix.locale }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for Unicode sets
icu4j-unicodesetperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [UnicodeSetAdd, UnicodeSetContains, UnicodeSetIterate]
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run unicodesetperf test
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
git status
cd perf-tests;
mkdir -p perf/results/j_unicodesetperf/${{ matrix.perf }};
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.UnicodeSetPerf ${{ matrix.perf }} -a -t 2 -p 4 [:Lt:] | tee perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_unicodesetperf/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_unicodesetperf/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for character APIs
icu4j-ucharacterperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run ucharacterperf test
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_ucharacterperf;
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.UCharacterPerf -a -t 2 -p 4 0 ffff | tee perf/results/j_ucharacterperf/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_ucharacterperf/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_ucharacterperf
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for decimal formatting
icu4j-decimalformatperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
locale: [en_US, de_DE]
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run decimalformatperf
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.DecimalFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} "#,###.##" "1.234,56" -r 1 | tee perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_decimalformatperf/${{ matrix.locale }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for normalization
icu4j-normperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICU_NFD_NFC_Text, TestICU_NFC_NFC_Text, TestICU_NFC_Orig_Text, TestICU_NFD_NFC_Text, TestICU_NFD_NFD_Text, TestICU_NFD_Orig_Text]
source_text: [TestNames_Asian, TestNames_Chinese, TestNames_SerbianSH]
mode: [-l]
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run normperf
env:
DATA_FILE_PATH: data/collation
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.NormalizerPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 ${{ matrix.mode }} | tee perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
cat perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_normperf/${{ matrix.source_text }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for encoding conversion
icu4j-converterperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
source_text: [arabic, english, french, greek, hebrew, hindi, japanese, korean, s-chinese]
perf: [TestCharsetDecoderICU, TestCharsetEncoderICU]
test_enc: [UTF-8]
include:
- test_enc: csisolatinarabic
source_text: arabic
perf: TestCharsetDecoderICU
- test_enc: csisolatinarabic
source_text: arabic
perf: TestCharsetEncoderICU
- test_enc: csisolatin1
source_text: french
perf: TestCharsetDecoderICU
- test_enc: csisolatin1
source_text: french
perf: TestCharsetEncoderICU
- test_enc: csisolatingreek
source_text: greek
perf: TestCharsetDecoderICU
- test_enc: csisolatingreek
source_text: greek
perf: TestCharsetEncoderICU
- test_enc: csisolatinhebrew
source_text: hebrew
perf: TestCharsetDecoderICU
- test_enc: csisolatinhebrew
source_text: hebrew
perf: TestCharsetEncoderICU
- test_enc: EUC-JP
source_text: japanese
perf: TestCharsetDecoderICU
- test_enc: EUC-JP
source_text: japanese
perf: TestCharsetEncoderICU
- test_enc: csiso2022jp
source_text: japanese
perf: TestCharsetDecoderICU
- test_enc: csiso2022jp
source_text: japanese
perf: TestCharsetEncoderICU
- test_enc: csiso2022kr
source_text: korean
perf: TestCharsetDecoderICU
- test_enc: csiso2022kr
source_text: korean
perf: TestCharsetEncoderICU
- test_enc: EUC-CN
source_text: s-chinese
perf: TestCharsetDecoderICU
- test_enc: EUC-CN
source_text: s-chinese
perf: TestCharsetEncoderICU
- test_enc: UTF-16BE
source_text: french
perf: TestCharsetDecoderICU
- test_enc: UTF-16BE
source_text: french
perf: TestCharsetEncoderICU
- test_enc: UTF-16LE
source_text: french
perf: TestCharsetDecoderICU
- test_enc: UTF-16LE
source_text: french
perf: TestCharsetEncoderICU
- test_enc: US-ASCII
source_text: english
perf: TestCharsetDecoderICU
- test_enc: US-ASCII
source_text: english
perf: TestCharsetEncoderICU
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Build and run converterperf
env:
DATA_FILE_PATH: data/conversion
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2;
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:../tools/misc/target/*:../main/core/target/*:../main/charset/target/* com.ibm.icu.dev.test.perf.ConverterPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -f $DATA_FILE_PATH/${{ matrix.source_text }}.txt -e UTF-8 -T ${{ matrix.test_enc }} | tee perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_converterperf/${{ matrix.source_text }}/${{ matrix.test_enc }}/${{ matrix.perf }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# ICU4J performance test for date formatting
icu4j-dateformatperf:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
needs: icu4j-mvn-init-cache
strategy:
fail-fast: false
matrix:
perf: [TestICUConstruction, TestICUParse, TestICUFormat]
locale: [en_US]
# The parameters don't make for good directory names. Add an identifying digit
# at the end to be used as directory name for the results.
parms: ['"dddd MMM yyyy" "15 Jan 2007" 1', '"HH:mm" "13:13" 2', '"HH:mm zzzz" "13:13 Pacific Standard Time" 3', '"HH:mm z" "13:13 PST" 4', '"HH:mm Z" "13:13 -0800" 5']
include:
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUConstruction
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUParse
- locale: sw_KE
parms: '"dddd MMM yyyy" "15 Jan 2007" 1'
perf: TestICUFormat
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- name: Checkout lfs objects
run: git lfs pull
- name: Lookup read-only cache of local Maven repository
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
lookup-only: true
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '8'
- name: Extract identifying digit and parameter.
run: |
ddir='${{ matrix.parms }}';
echo "PARM=${ddir:: -2}" >> $GITHUB_ENV;
echo "DDIR=${ddir: -1}" >> $GITHUB_ENV
- name: Build and run dateformatperf
run: |
# This file needs to be restored otherwise GHA cannot
# check-out the perfdata branch. Setting up this task with GH lfs
# modifies the file but the details of why and how are unknown.
git restore --staged tools/multi/proj/icu4cscan/old-xmls.tar.bz2
git restore tools/multi/proj/icu4cscan/old-xmls.tar.bz2
cd icu4j;
mvn ${SHARED_MVN_ARGS} verify -DskipITs -DskipTests;
cd perf-tests;
mkdir -p perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }};
# Delay execution by random number of seconds. Spreading execution of multiple
# tests over 180 secs. minimizes the possibility of push conflicts when storing
# tests results in the data branch.
sleep $(($RANDOM % 180));
java -cp ./target/*:../tools/misc/target/*:../main/core/target/* com.ibm.icu.dev.test.perf.DateFormatPerformanceTest ${{ matrix.perf }} -a -t 2 -p 4 -L ${{ matrix.locale }} ${{ env.PARM }} -r 1 | tee perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
- name: Store performance test results
uses: gregtatum/github-action-benchmark@d3f06f738e9612988d575db23fae5ca0008d3d12
with:
# The perf tests result data is in ndjson format.
tool: 'ndjson'
output-file-path: icu4j/perf-tests/perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}/output.txt
# Tentative setting.
alert-threshold: '200%'
fail-on-alert: true
gh-pages-branch: perfdata
benchmark-data-dir-path: perf/results/j_dateformatperf/${{ matrix.locale }}/${{ matrix.perf }}/${{ env.DDIR }}
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
# Retrieve performance test results and upload results to remote repository
perf-test-data-move:
# Run performance tests only on the main branch of the ICU repository.
if: github.repository == 'unicode-org/icu' && github.ref == 'refs/heads/main'
name: Copy perf data to remote repo for visualization
needs: [icu4c-performance-tests, icu4c-performance-tests-with-files, icu4c-strsrchperf, icu4j-unicodesetperf, icu4j-ucharacterperf, icu4j-decimalformatperf, icu4j-normperf, icu4j-converterperf, icu4j-dateformatperf]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Switch to benchmark data storage branch.
run: |
git fetch
git checkout perfdata
- name: Publish data
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: unicode-org/icu-perf
publish_branch: main
publish_dir: ./perf
keep_files: true
+110
View File
@@ -0,0 +1,110 @@
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# GitHub Action configuration script for ICU continuous integration tasks
# for Valgrind
name: GHA CI Valgrind
on:
push:
branches:
- main
- 'maint/maint*'
paths:
- 'icu4c/**'
- '.github/workflows/**'
pull_request:
branches: '**'
paths:
- 'icu4c/**'
- '.github/workflows/**'
permissions:
contents: read
jobs:
clang-valgrind-test:
runs-on: ubuntu-latest
steps:
- name: Install valgrind
run: |
set -ex;
sudo apt-get -y update;
sudo apt-get install -y valgrind;
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build with debug enable
env:
CC: clang
CFLAGS: -gdwarf-4
CXX: clang++
CXXFLAGS: -gdwarf-4
run: |
cd icu4c/source;
./runConfigureICU --enable-debug Linux --disable-renaming && make -j -l4.5 tests;
- name: Test iotest with valgrind
run: |
cd icu4c/source/test/iotest
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
--show-reachable=yes ./iotest
- name: Test cintltst with valgrind
run: |
cd icu4c/source/test/cintltst
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
--show-reachable=yes ./cintltst
- name: Test icuinfo with valgrind
run: |
cd icu4c/source/tools/icuinfo
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
--show-reachable=yes ./icuinfo;
clang-valgrind-intltest:
runs-on: ubuntu-latest
strategy:
# "fail-fast: false" lets other jobs keep running even if the test breaks in some other test.
fail-fast: false
matrix:
case: [utility, normalize, collator, regex, format, translit,
rbbi, rbnf, rbnfrt, icuserv, idna, convert, rbnfp, csdet,
spoof, bidi]
steps:
- name: Install valgrind
run: |
set -ex;
sudo apt-get -y update;
sudo apt-get install -y valgrind;
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build with debug enable
env:
CC: clang
CFLAGS: -gdwarf-4
CXX: clang++
CXXFLAGS: -gdwarf-4
run: |
cd icu4c/source;
./runConfigureICU --enable-debug Linux --disable-renaming && make -j -l4.5 tests;
- name: Check all top path in intltest is covered
run: |
cd icu4c/source/test/intltest;
if [ $(LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
./intltest LIST |
egrep "^ [a-z]+$" | awk '{print $1;}' | sort | tr '\n' '|') != \
"bidi|collate|convert|csdet|format|icuserv|idna|normalize|rbbi|rbnf|rbnfp|rbnfrt|regex|spoof|translit|utility|" ]
then
echo ICU has made changes to the top level tests in intltest!
echo Please update this workflow file to include those top level tests in
echo the "case" list.
exit -1
fi
- name: Test with valgrind
run: |
cd icu4c/source/test/intltest
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH \
valgrind --tool=memcheck --error-exitcode=1 --leak-check=full \
--show-reachable=yes ./intltest ${{ matrix.case }};
+79
View File
@@ -0,0 +1,79 @@
# Copyright (C) 2023 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
# Note: the workflow here is based on the Github Actions workflow used
# by the Jekyll theme we are using:
# https://github.com/just-the-docs/just-the-docs/blob/main/.github/workflows/deploy.yml
#
# The Jekyll theme (just-the-docs) configured its Github CI to manually run the Jekyll
# build instead of relying on the default behavior from
# https://github.com/actions/jekyll-build-pages . The default behavior of
# actions/jekyll-build-pages seems to be causing errors with this theme.
name: Deploy User Guide
on:
# Runs on pushes targeting the default branch and only if in the `docs/` directory
push:
branches: ["main"]
paths: ["docs/**"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
# Keep in sync with docs test workflow in `icu_docs.yml`
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '2.7.4' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6
with:
generator_config_file: docs/_config.yml
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
cd docs # root directory of markdown, also contains Jekyll configs, etc.
bundle install
# The baseurl arg is parsed from the `baseurl` field of _config.yml.
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: docs/_site
# Deployment job
deploy:
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
+27 -24
View File
@@ -2,39 +2,42 @@ name: Publish icu4j.jar/utilities.jar to GH Maven
on:
release:
types: [created]
workflow_dispatch:
# To trigger the Env Test workflow manually, follow the instructions in
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
env:
SHARED_MVN_ARGS: '--show-version'
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
lfs: true
- uses: actions/setup-java@v1
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 1.8
- name: icu4j ant releaseCLDR
run: ant -noinput releaseCLDR -f icu4j/build.xml
distribution: 'temurin'
java-version: '11'
- name: icu4j and releaseCLDR
run: |
cd icu4j
mvn ${SHARED_MVN_ARGS} clean install -DskipTests -DskipIT -P with_sources
- name: deploy it
run: |
MYVERSION=$(sed -n -e 's%^\s*maven.pom.ver[ =]*%%p' < icu4j/build.properties)-$(echo ${GITHUB_REF} | cut -d/ -f3- | tr ./ _-)
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA}, version ${MYVERSION}
mvn deploy:deploy-file -DgroupId=com.ibm.icu \
-DartifactId=icu4j-for-cldr \
-Dversion=${MYVERSION} \
-Dpackaging=jar \
-Dfile=icu4j/release_cldr/icu4j.jar \
-Dsources=icu4j/release_cldr/icu4j-src.jar \
-DrepositoryId=github \
-Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY}
mvn deploy:deploy-file -DgroupId=com.ibm.icu \
-DartifactId=utilities-for-cldr \
-Dversion=${MYVERSION} \
-Dpackaging=jar \
-Dfile=icu4j/release_cldr/utilities.jar \
-Dsources=icu4j/release_cldr/utilities-src.jar \
-DrepositoryId=github \
-Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY}
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA};
cd icu4j
mvn deploy ${SHARED_MVN_ARGS} \
-pl :icu4j,:utilities-for-cldr,:icu4j-root \
-DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \
-P cldr_utilities,with_sources
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Note: can use 0.0.0-${GITHUB_SHA} as the version for hash-based.
# i.e. build on every commit
# i.e. build on every commit
+64
View File
@@ -0,0 +1,64 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: "23 15 * * 6"
push:
branches: ["main"]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) fine-grained personal access token. Uncomment the `repo_token` line below if
# you want to enable the Branch-Protection check on a *public* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
with:
sarif_file: results.sarif
+14
View File
@@ -9,6 +9,7 @@
*.dll
*.dylib
*.exp
*.iml
*.lib
*.lnk
*.ncb
@@ -63,6 +64,7 @@ lib/
!tools/cldr/lib
out/
release/
target/
!docs/processes/release/
tmp/
x64/
@@ -278,3 +280,15 @@ tools/unicode/c/genprops/genprops.[0-9]
tools/unicode/c/genuca/genuca
tools/unicode/c/genuca/genuca.8
tools/unicode/c/icudefs.txt
# QNX files
icu4c/build_qnx/linux-x86_64-o/*
icu4c/build_qnx/nto-aarch64-le/*
icu4c/build_qnx/nto-x86_64-o/*
!icu4c/build_qnx/linux-x86_64-o/GNUmakefile
!icu4c/build_qnx/nto-aarch64-le/GNUmakefile
!icu4c/build_qnx/nto-x86_64-o/GNUmakefile
!icu4c/build_qnx/**/Makefile
icu4c/build_qnx/linux-x86_64-o/Makefile
icu4c/build_qnx/nto-aarch64-le/Makefile
icu4c/build_qnx/nto-x86_64-o/Makefile
+126 -7
View File
@@ -2,13 +2,132 @@
Thank you for wanting to contribute to ICU!
Please see our instructions at <https://icu.unicode.org/processes/contribute>
Starting with ICU 58, ICU is a project of the Unicode® Consortium and the ICU Project Management Committee is a Unicode Technical Committee, the ICU-TC. For more details, see [the Unicode announcement][unicode-announcement]. Since 2018-July, ICU is hosted on [GitHub][unicode-org/icu].
### License
## Why contribute?
Please see [./icu4c/LICENSE](./icu4c/LICENSE) (C and J are under an identical license file.)
ICU is an open source library that is a de-facto industry standard for internationalization libraries. Our goal is to provide top of the line i18n support on all widely used platforms. By contributing your code to the ICU library, you will get the benefit of continuing improvement by the ICU team and the community, as well as testing and multi-platform portability. In addition, it saves you from having to re-merge your own additions into ICU each time you upgrade to a new ICU release.
> Copyright © 2021 and later Unicode, Inc. and others. All Rights Reserved.
Unicode and the Unicode Logo are registered trademarks
of Unicode, Inc. in the U.S. and other countries.
[Terms of Use and License](http://www.unicode.org/copyright.html)
## Contributor License Agreement
In order to contribute to this project, the Unicode Consortium must have on file a Contributor License Agreement (CLA) covering your contributions, either an individual or a corporate CLA. Pull Requests, issues, and other contributions will not be merged/accepted until the correct CLA is signed. Which version needs to be signed depends on who owns the contribution being made: you as the individual making the contribution or your employer. **It is your responsibility to determine whether your contribution is owned by your employer.** Please review the [Unicode Intellectual Property, Licensing, & Technical Contribution Policy][policies] for further guidance on which CLA to sign, as well as other information and guidelines regarding the Consortium’s licensing and technical contribution policies and procedures.
To sign the CLA in Github, open a Pull Request (a comment will be automatically added with a link to the CLA Form), or go directly to [the CLA Form][sign-cla]. You may need to sign in to Github to see the entire CLA Form.
- **Individual CLA**: If you have determined that the Individual CLA is appropriate, then when you access the CLA Form, click the Individual CLA and complete the Form.
- **Corporate CLA**: If you have determined that a Corporate CLA is appropriate, please first check the [public list of Corporate CLAs][unicode-corporate-clas] that the Consortium has on file. If your employer is listed, then when you access the CLA Form, you can click the box indicating that you are covered by your employer’s corporate CLA. If your employer is not on the list, then it has not already signed a CLA and you will need to arrange for your employer to do so before you contribute, as described in [How to Sign a Unicode CLA][signing].
Unless otherwise noted in the [`LICENSE`](./LICENSE) file, this project is released under the [OSI-approved][osi-Unicode-License-3.0] free and open-source [Unicode License v3][unicode-license].
## Process
See also [git for ICU Developers][git4icu].
If you want to join the team, then please [contact us][contacts]. Once everything is agreed, the ICU team adds you to the [GitHub project][unicode-org/icu] and the [Jira issue tracker][bugs].
## General Contribution Requirements
We will be glad to take a look at the code you wish to contribute to ICU. We cannot guarantee that the code will be included. Contributions of general interest and written according to the following guidelines have a better chance of becoming a part of ICU.
For any significant new functionality, contact the ICU development team through the [icu-design][contacts] mailing list first, and discuss the features, design and scope of the possible contribution. This helps ensure that the contribution is expected and will be welcome, that it will fit in well with the rest of ICU, and that it does not overlap with other development work that may be underway.
While you are considering contributing code to ICU, make sure that the legal terms (see [Licenses](#licenses) above) are acceptable to you and your organization.
Here are several things to keep in mind when developing a potential contribution to the ICU project:
1. ICU has both C/C++ and Java versions. If you develop in one programming language, please either provide a port or make sure that the logic is clear enough so that the code can be reasonably ported. We cannot guarantee that we will port a contribution to the other library.
2. Before implementation, read and understand ICU's [coding guidelines][coding-guidelines]. Contributions that require too much adaptation to be included in the ICU tree will probably wait for a long time.
3. During implementation, try to mimic the style already present in the ICU source code.
4. Always develop the code as an integral part of the library, rather than an add-on.
5. Always provide enough test code and test cases. We require that our APIs are 100% tested and that tests cover at least 85% of the ICU library code. Make sure that your tests are integrated into one of ICU's test suites ([cintltst][cintltst] and [intltest][intltest] for ICU4C and [com.ibm.icu.dev.test][com.ibm.icu.dev.test] classes in ICU4J). New tests and the complete test suite should pass.
6. Compile using the strictest compiler options. Due to ICU's multi-platform nature, warnings on some platforms may mean disastrous errors on other platforms. This can be enabled for C++ by using the `--enable-strict` configure option on any platform using the gcc or clang compilers.
7. Test on more than one platform. For ICU4C, it is good to combine testing on Windows with testing on Linux, Mac OS X or another Unix platform. It is always good to try to mix big and little endian platforms. For ICU4J, test using both Oracle's and IBM's JDKs and/or on Android.
8. Each contribution should contain everything that will allow building, testing and running ICU with the contribution. This usually includes: source code, build files and test files.
## Team
We have several [mailing lists][contacts]. Contributors should at least subscribe to the **icu-design** mailing list, and we also have a team-internal list that you should get added to.
We meet once a week by phone. See the [agenda & meeting minutes][meetings].
## Understand ICU
* Home page: <https://icu.unicode.org>
* User Guide: <https://unicode-org.github.io/icu/userguide/>
* [Coding guidelines][coding-guidelines]
* [Introduction][introduction]
* [Design][design]
* [How to use ICU][howtouse]
* etc.
* API References: [C][icu4c-api] & [J][icu4j-api]
## Setup & Workflow
- [Source Code Access][repository]
- [git for ICU Developers][git4icu]
- [Tips for developers][tips]
- [Eclipse and other setup][setup]
- [Submitting ICU Bugs and Feature Requests][bugs]
- [ICU Ticket Life cycle][ticket-lifecycle]
Significant/disruptive changes should be discussed on the icu-design list or on the team-internal list.
**API changes must be proposed** on the **icu-design** list, see the [API Proposal Email Template][proposal-template].
Proposed changes will be discussed at the ICU meeting that follows at least six days later. Proposals are frequently modified during email and in-meeting discussion. Please do not "jump the gun" unless you are very confident your proposal will go through as-is, or be prepared to revert your changes.
## Welcome
_… and thanks for contributing!_
### Copyright & Licenses
Copyright © 2016-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
The project is released under [LICENSE](./LICENSE).
[bugs]: https://icu.unicode.org/bugs
[cintltst]: ./icu4c/source/test/cintltst/
[coding-guidelines]: docs/userguide/dev/codingguidelines.md
[com.ibm.icu.dev.test]: ./icu4j/main/framework/src/test/java/com/ibm/icu/dev/test/
[contacts]: https://icu.unicode.org/contacts
[copyright]: http://www.unicode.org/copyright.html
[design]: docs/userguide/icu/design.md
[git4icu]: https://icu.unicode.org/repository/gitdev
[howtouse]: docs/userguide/icu/howtouseicu.md
[icu4c-api]: https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/
[icu4j-api]: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/
[intltest]: ./icu4c/source/test/intltest/
[introduction]: docs/userguide/index.md
[meetings]: https://icu.unicode.org/projectinfo/meetings
[osi-Unicode-License-3.0]: https://opensource.org/license/unicode-license-v3/
[policies]: https://www.unicode.org/policies/licensing_policy.html
[proposal-template]: https://icu.unicode.org/processes/proposal-template
[repository]: https://icu.unicode.org/repository
[setup]: https://icu.unicode.org/setup
[sign-cla]: https://cla-assistant.io/unicode-org/.github
[signing]: https://www.unicode.org/policies/licensing_policy.html#signing
[ticket-lifecycle]: https://icu.unicode.org/processes/ticket-lifecycle
[tips]: https://icu.unicode.org/repository/tips
[unicode-announcement]: http://blog.unicode.org/2016/05/icu-joins-unicode-consortium.html
[unicode-corporate-clas]: https://www.unicode.org/policies/corporate-cla-list/
[unicode-license]: https://www.unicode.org/license.txt
[unicode-org/icu]: https://github.com/unicode.org/icu
+671 -319
View File
File diff suppressed because it is too large Load Diff
+138 -36
View File
@@ -1,38 +1,46 @@
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
UNICODE LICENSE V3
Copyright © 1991-2020 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
COPYRIGHT AND PERMISSION NOTICE
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
Copyright © 2016-2024 Unicode, Inc.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.
---------------------
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.
SPDX-License-Identifier: Unicode-3.0
----------------------------------------------------------------------
Third-Party Software Licenses
@@ -40,7 +48,9 @@ This section contains third-party software notices and/or additional
terms for licensed third-party software components included within ICU
libraries.
1. ICU License - ICU 1.8.1 to ICU 57.1
----------------------------------------------------------------------
ICU License - ICU 1.8.1 to ICU 57.1
COPYRIGHT AND PERMISSION NOTICE
@@ -75,7 +85,9 @@ of the copyright holder.
All trademarks and registered trademarks mentioned herein are the
property of their respective owners.
2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
----------------------------------------------------------------------
Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
# The Google Chrome software developed by Google is licensed under
# the BSD license. Other software included in this distribution is
@@ -279,7 +291,9 @@ property of their respective owners.
#
# ---------------COPYING.ipadic-----END----------------------------------
3. Lao Word Break Dictionary Data (laodict.txt)
----------------------------------------------------------------------
Lao Word Break Dictionary Data (laodict.txt)
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
@@ -319,7 +333,9 @@ property of their respective owners.
# OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------------
4. Burmese Word Break Dictionary Data (burmesedict.txt)
----------------------------------------------------------------------
Burmese Word Break Dictionary Data (burmesedict.txt)
# Copyright (c) 2014 International Business Machines Corporation
# and others. All Rights Reserved.
@@ -359,7 +375,9 @@ property of their respective owners.
# SUCH DAMAGE.
# --------------------------------------------------------------------------
5. Time Zone Database
----------------------------------------------------------------------
Time Zone Database
ICU uses the public domain data and code derived from Time Zone
Database for its time zone support. The ownership of the TZ database
@@ -382,7 +400,9 @@ Database section 7.
# making a contribution to the database or code waives all rights to
# future claims in that contribution or in the TZ Database.
6. Google double-conversion
----------------------------------------------------------------------
Google double-conversion
Copyright 2006-2011, the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -410,3 +430,85 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
File: aclocal.m4 (only for ICU4C)
Section: pkg.m4 - Macros to locate and utilise pkg-config.
Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
As a special exception to the GNU General Public License, if you
distribute this file as part of a program that contains a
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that
program.
(The condition for the exception is fulfilled because
ICU4C includes a configuration script generated by Autoconf,
namely the `configure` script.)
----------------------------------------------------------------------
File: config.guess (only for ICU4C)
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <https://www.gnu.org/licenses/>.
As a special exception to the GNU General Public License, if you
distribute this file as part of a program that contains a
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that
program. This Exception is an additional permission under section 7
of the GNU General Public License, version 3 ("GPLv3").
(The condition for the exception is fulfilled because
ICU4C includes a configuration script generated by Autoconf,
namely the `configure` script.)
----------------------------------------------------------------------
File: install-sh (only for ICU4C)
Copyright 1991 by the Massachusetts Institute of Technology
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of M.I.T. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission. M.I.T. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
+13 -9
View File
@@ -17,11 +17,15 @@ Around March 24-25, 2021 we renamed the `master` branch to `main`. You may need
Build | Status
------|-------
GitHub Actions | [![GHA CI](https://github.com/unicode-org/icu/workflows/GHA%20CI/badge.svg)](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+CI%22)
Azure Pipelines | [![Build Status](https://dev.azure.com/ms/icu/_apis/build/status/unicode-org/CI?branchName=main)](https://dev.azure.com/ms/icu/_build/latest?definitionId=360&branchName=main)
GitHub Actions (ICU4C) | [![GHA ICU4C](https://github.com/unicode-org/icu/workflows/GHA%20ICU4C/badge.svg)](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+ICU4C%22+branch%3Amain)
GitHub Actions (ICU4J) | [![GHA ICU4J](https://github.com/unicode-org/icu/workflows/GHA%20ICU4J/badge.svg)](https://github.com/unicode-org/icu/actions?query=workflow%3A%22GHA+ICU4J%22+branch%3Amain)
Azure Pipelines (ICU4C) | [![Build Status](https://dev.azure.com/ms/icu/_apis/build/status/unicode-org/CI?branchName=main)](https://dev.azure.com/ms/icu/_build/latest?definitionId=360&branchName=main)
Azure Pipelines (ICU4J) | [![Build Status](https://dev.azure.com/ms/icu/_apis/build/status%2Funicode-org%2FCI-ICU4J?branchName=main)](https://dev.azure.com/ms/icu/_build/latest?definitionId=631&branchName=main)
Azure Pipelines (Exhaustive Tests) | [![Build Status](https://dev.azure.com/ms/icu/_apis/build/status/unicode-org/CI-Exhaustive-Main?branchName=main)](https://dev.azure.com/ms/icu/_build/latest?definitionId=361&branchName=main)
Azure Pipelines (Valgrind ICU4C) | [![Build Status](https://dev.azure.com/ms/icu/_apis/build/status/unicode-org/CI-Valgrind?branchName=main)](https://dev.azure.com/ms/icu/_build/latest?definitionId=364&branchName=main)
Github Actions (Valgrind) | [![GHA CI Valgrind]](https://github.com/unicode-org/icu/workflows/GHA%20CI%20Valgrind/badge.svg)](https://github.com/unicode-org/icu/actions/workflows/icu_valgrind.yml?query=workflow%3A%22GHA+CI%22+branch%3Amain)
Fuzzing | [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/icu.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:icu)
OpenSSF Scorecard | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/unicode-org/icu/badge)](https://securityscorecards.dev/viewer/?uri=github.com/unicode-org/icu)
### Subdirectories and Information
@@ -31,11 +35,11 @@ Fuzzing | [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/
- [`tools/`](./tools/) Tools
- [`vendor/`](./vendor/) Vendor dependencies
### License
### Copyright & Licenses
Please see [./icu4c/LICENSE](./icu4c/LICENSE) (C and J are under an identical license file.)
Copyright © 2016-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
The project is released under [LICENSE](./LICENSE).
A CLA is required to contribute to this project - please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file (or start a Pull Request) for more information.
> Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved.
Unicode and the Unicode Logo are registered trademarks
of Unicode, Inc. in the U.S. and other countries.
[Terms of Use and License](http://www.unicode.org/copyright.html)
+24
View File
@@ -0,0 +1,24 @@
# Security Policy
If you have discovered a security vulnerability in this project, please report it
privately. **Do not disclose it as a public issue.** This gives us time to work with you
to fix the issue before public exposure, reducing the chance that the exploit will be
used before a patch is released.
Please submit the bug report as an [ICU Jira issue](https://icu.unicode.org/bugs).
Be sure to set "Security level: Sensitive".
This ensures the report will only be visible to the ICU team.
Please provide the following information in your report:
- A description of the vulnerability and its impact
- How to reproduce the issue
This project is maintained by volunteers on a reasonable-effort basis. As such, we ask
that you give us 90 days to work on a fix before public exposure.
> Copyright © 2023 and later Unicode, Inc. and others. All Rights Reserved.
Unicode and the Unicode Logo are registered trademarks
of Unicode, Inc. in the U.S. and other countries.
[Terms of Use and License](http://www.unicode.org/copyright.html)
+2 -8
View File
@@ -11,15 +11,10 @@ source "https://rubygems.org"
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 3.8.7"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you aren't using GitHub Pages, then uncomment out the line above that starts with
# 'gem "jekyll"' and then comment out the line below that starts with 'gem "github-pages"'.
# To upgrade, run `bundle update github-pages`.
gem "github-pages", "~> 213", group: :jekyll_plugins
gem "just-the-docs"
gem "github-pages", "228", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
@@ -34,4 +29,3 @@ end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
+1 -1
View File
@@ -14,7 +14,7 @@ url: "https://unicode-org.github.io" # the base hostname & protocol for your sit
twitter_username: unicode
github_username: unicode-org
remote_theme: pmarsceill/just-the-docs
theme: just-the-docs
# GitHub uses its own markdown renderer called CommonMarkGhPages.
#
-8
View File
@@ -1,8 +0,0 @@
// © 2020 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Increase the side bar width as some of the page titles don't fit in the default size.
$nav-width: 284px;
// Increase the main content area width as some tables assume a larger size.
$content-width: 900px;
+74
View File
@@ -0,0 +1,74 @@
---
layout: default
title: Demos
nav_order: 350
description: Demos
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Demos
## ICU4C Demos
[List of ICU Demonstrations](https://icu4c-demos.unicode.org/icu-bin/icudemos)
## ICU4J Demos
### Server Side Demos
#### Web Demos
These demos are running on the ICU server, and are implemented as Java Servlets
and JSP pages.
* [Browse the Demos](http://demo.icu-project.org/icu4jweb/)
* [View Demo Source](https://github.com/unicode-org/icu-demos/tree/master/icu4jweb/)
### Client Side demos
#### To build the client side samples:
1. Download the ICU4J source code ( see [Source Code Setup](../devsetup/source) )
2. Run `ant jar` to build ICU4J jar
3. Run `ant jarDemos` to build the demos
4. Run `cp icu4j.jar demos/out/lib`
5. Finally, run `java -jar demos/out/lib/icu4j-demos.jar` to launch the demos
**CalendarApp** This demo compares two calendars against each other. Choose the
two calendar types, and the display language, from the pop-up menus. Navigate by
days using the < and > buttons, or by years using the << and >> buttons.
**Translit** This demonstration shows ICU Transliteration. The transliteration
mode chosen in the menu will be used as you type.
**HolidayCalendarDemo** This demo displays holidays from a certain locale,
localized into the display language of your choice. Navigate by days using the <
and > buttons, or by years using the << and >> buttons.
**RbnfDemo** This demo shows Rule Based Number Formatting. Please expand the
window to show the entire demo. A number may be entered in the top left corner,
or the navigation buttons may be used. The pop-up menus in the top right corner
will pick the rule and the variant used.
**DetectingViewer** By opening a document using the Open file or Open URL menu
items, this demo will statistically detect the probable file encoding of a file.
Use the DetectedEncodings menu to see which encodings were detected.
*Note:* Due to security constraints, you must use the Downloadable Demo Jar in
order to use these demos with files on your local disk. The Java Web Start
application will not have permission to read local files.
---
### ICU Introduction Applets
#### About the Applets
This is a paper introducing ICU calendars, which has live applets throughout the
text to demonstrate various features.
The paper is now archived, see <https://github.com/unicode-org/icu-demos/pull/5>
+14
View File
@@ -0,0 +1,14 @@
---
layout: default
title: Design Docs
nav_order: 8000
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Design Docs
File diff suppressed because it is too large Load Diff
+333
View File
@@ -0,0 +1,333 @@
---
layout: default
title: Preparsed UCD
parent: Design Docs
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Preparsed UCD
## What
A text file with preparsed UCD ([Unicode Character
Database](http://www.unicode.org/ucd/)) data.
* Preparser script:
[tools/unicode/py/**preparseucd.py**](https://github.com/unicode-org/icu/blob/master/tools/unicode/py/preparseucd.py)
* ppucd.txt output:
[icu4c/source/data/unidata/**ppucd.txt**](https://github.com/unicode-org/icu/blob/master/icu4c/source/data/unidata/ppucd.txt)
([raw text
version](https://raw.githubusercontent.com/unicode-org/icu/master/icu4c/source/data/unidata/ppucd.txt))
* Parser for ppucd.txt:
[icu4c/source/tools/toolutil/**ppucd.h**](https://github.com/unicode-org/icu/blob/master/icu4c/source/tools/toolutil/ppucd.h)
&
[.cpp](https://github.com/unicode-org/icu/blob/master/icu4c/source/tools/toolutil/ppucd.cpp)
* genprops tool rewritten to use that:
[tools/unicode/c/**genprops**](https://github.com/unicode-org/icu/tree/master/tools/unicode/c/genprops)
## Syntax
```
# Preparsed UCD generated by ICU preparseucd.py
```
Only whole-line comments starting with #, no inline comments.
```
ucd;10.0.0
```
Data lines start with a type keyword. Data fields are semicolon-separated. The
number of fields per line is highly variable.
The ucd line should be the first data line. It provides the Unicode version
number.
```
property;Binary;Alpha;Alphabetic
property;Enumerated;bc;Bidi_Class
```
Property lines define properties with a type and two or more aliases.
```
binary;N;No;F;False
binary;Y;Yes;T;True
value;bc;ON;Other_Neutral
```
Property value lines define the values of enumerated and catalog properties,
with the property short name and two or more aliases for each value.
There is only one shared definition of the values and aliases for binary
properties.
```
defaults;0000..10FFFF;age=NA;bc=L;blk=NB;bpt=n;cf=<code point>;dm=<code point>;dt=None;ea=N;FC_NFKC=<code point>;gc=Cn;GCB=XX;gcm=Cn;hst=NA;InPC=NA;InSC=Other;jg=No_Joining_Group;jt=U;lb=XX;lc=<code point>;NFC_QC=Y;NFD_QC=Y;NFKC_CF=<code point>;NFKC_QC=Y;NFKD_QC=Y;nt=None;SB=XX;sc=Zzzz;scf=<code point>;scx=<script>;slc=<code point>;stc=<code point>;suc=<code point>;tc=<code point>;uc=<code point>;vo=R;WB=XX
```
After the version, property, and property value lines, and before other data
lines, the defaults line defines default values for all code points
(corresponding to @missing data in the UCD). Any properties not mentioned here
default to null values according to their type, such as False or the empty
string.
The general syntax of this line is the same as for the following data lines:
1. Line type keyword.
2. Code point or start..end range (inclusive end).
3. Zero or more property values.
* Binary values are given by their property name alone if True ("Alpha"),
or with a minus sign prepended ("-Alpha").
* Other values are given as "pname=value" pairs, where pname is the
property name.
* In the ppucd.txt file, short names of properties and values are used,
but parsers should be prepared to accept any of the aliases according to
the earlier sections of the file.
* In the ppucd.txt file, properties are listed in sorted order, but this
is not required by the syntax.
```
block;20000..2A6DF;age=3.1;Alpha;blk=CJK_Ext_B;ea=W;gc=Lo;Gr_Base;IDC;Ideo;IDS;lb=ID;SB=LE;sc=Hani;UIdeo;vo=U;XIDC;XIDS
# 20000..2A6D6 CJK Unified Ideographs Extension B
algnamesrange;20000..2A6D6;han;CJK UNIFIED IDEOGRAPH-
cp;20001;nt=Nu;nv=7
cp;20064;nt=Nu;nv=4
unassigned;2A6D7..2A6DF;ea=W;lb=ID;vo=U
# No block
unassigned;2A6E0..2A6FF;ea=W;lb=ID;vo=U
algnamesrange;AC00..D7A3;hangul
```
Block lines specify a Unicode Block and provide an opportunity for compact data
lines for ranges inside the block, by listing common property values once for
the whole block. Block properties override the defaults for cp and unassigned
lines with code point ranges inside the block. The file syntax and parser do not
require the presence of block lines.
cp lines provide the data for a code point or range. They override the
default+block properties. Properties that are not mentioned fall back to the
block, then to the defaults.
Unassigned lines (new in ICU 60 for Unicode 10) provide the data for an
unassigned code point or range (gc=Cn). They override only the default
properties, except for the blk=Block property (if the range is inside a block).
Properties that are not mentioned fall back to the defaults, except that the
blk=Block property applies to unassigned lines as well.
A range is considered inside a block if it is fully inside the range of the last
defined block. Otherwise it is considered outside a block and falls back only to
the defaults. This is the case even if the range is inside an earlier block, to
simplify parsing & processing (such data lines should be avoided).
A range inside the block for which there is no data line inherits all of the
default+block properties (see Han blocks). Note that this is very different from
the behavior of an unassigned line, in particular since such blocks typically
default to gc!=Cn.
Non-default properties for unassigned ranges inside and outside of blocks are
typically for [complex
defaults](http://www.unicode.org/reports/tr44/#Default_Values_Table) and for
noncharacters.
ppucd.txt data lines are in code point order, although this should not be
strictly required.
Assigned characters normally have their unique na=Name property value. For
Hangul syllables with their algorithmically computed names, the entire range is
covered by the line "algnamesrange;AC00..D7A3;hangul". For ranges of ideographic
characters, a line like "algnamesrange;20000..2A6D6;han;CJK UNIFIED IDEOGRAPH-"
provides a Name prefix which is to be followed by the code point (in hex like
%04lX).
## Why not UCD .txt files?
See [UAX #44 "Unicode Character Database"](http://www.unicode.org/reports/tr44/)
Nontrivial parsing:
* The UCD has grown from a couple of semicolon-delimited files plus an
informative "Property dump" (early PropList.txt) to a collection of dozens
of files with a variety of (now more regular) formats.
* Related properties are scattered over several files.
* Full information for Numeric_Value and Numeric_Type requires parsing two
files.
* Default values are "hidden" in comments.
* The UCD folder structure (which file where) has changed over time.
* UCD filenames change during each Unicode beta period. (A detailed version
number is inserted into each filename.)
* Many files are bloated with comments that show the General Category and name
of each character or range start/end; if the data were combined into a
single file, then all properties for a character or range would be listed
together, without need for such comments.
Nontrivial patching: Adding characters (e.g., PUA or proposed/draft) requires
adding data in many of the UCD files.
ICU already preprocesses some of the UCD .txt files. We strip comments from some
files (because they are huge) and in some files merge adjacent same-property
code points into ranges.
Some changes are manual, such as updating and adding ranges of algorithmic
character names.
Then we run several tools, most of them twice, to parse different sets of .txt
files and write several output files. We use several Python and shell scripts,
and a "log" (unidata/changes.txt) with details of what was changed and run in
each Unicode version upgrade.
Markus has done ICU Unicode updates since about 2002. Someone else might have a
hard time picking this up for maintenance and future Unicode version updates.
### Why not UCD XML files?
See [UAX #42 "Unicode Character Database in
XML"](http://www.unicode.org/reports/tr42/)
Good: The UCD XML file format stores all properties in a single file with a
relatively simple structure, with property values as XML attributes.
Issues:
* **Missing data** which is needed for ICU
* Name_Alias added in UCD 5.0 but missing in UCD XML as of UCD 6.1 beta.
* Script_Extensions added in UCD 6.0 but not "blessed" as a Unicode
property as of UCD 6.1. Useful, used in ICU, but not available in UCD
XML.
* Adopting UCD XML would require to either still also parse some UCD .txt
files or write another tool to merge more data into the XML.
* Dependency on third party
* Lag time between UCD .txt vs. XML availability during beta.
* Unable to fix/update/extend XML generator tools.
* For new properties, need to wait for standardization (UAX #42), tool
update, and XML publication.
* Will not support custom/nonstandard data.
* Could be simpler: Parsing XML is easy in Java, Python, etc. and doable in
C++ (we have a "poor man's" XML parser), but not as easy as
`line.split(";")`.
* There is no need for complex structure for the UCD.
* Could be easier to read for humans: By not storing defaults for all of
Unicode in one place, each `<group>` carries them, making it hard to see which
values are specific to each group. "Fluffy" XML makes for longer text lines,
more horizontal scrolling.
* Hard to diff: The XML format can be used in different ways, and Unicode
publishes different forms of the same data. Also, the precise XML text
depends on the XML formatting code used.
* For diffing, a special tool needs to be run, parse old & new XML data,
compare values and generate a diff report. Unicode publishes some of
those too.
* Some data still requires nontrivial parsing.
* For algorithmic character names, the range needs to be determined by
collecting a contiguous sequence of elements with a shared name pattern.
There is not even any special notation for the algorithmic names for
Hangul syllables.
* Minor: Unnecessary data (for ICU)
* Precomputed Hangul syllable names
* Irrelevant contributory properties like "Other_Xyz"
* Properties not used by ICU
* Minor, just awkward: Blocks are treated as auxiliary data, rather than as a
core means to organize and store the data. On the other hand, the "grouped"
XML files also use them as the basis for the `<group>` elements and associated
compaction. (The "flat" files don't.)
## Goals
* Single file with all data relevant for ICU.
* Very easy to parse and use the data in C/C++ tools.
* Easily human readable.
* Easy-to-read diffs from standard diff tools.
* Compact file format.
* Conversion tool easy to write, maintain, extend.
* Convert from UCD .txt files because those are maintained directly by the UTC
& editorial committee. No waiting for third party to convert the files.
* Able to extend for new kinds of data.
* Easy format for manual data fixes/additions (e.g., PUA or proposed/draft).
* Move much of the parsing from scattered C code into one Python script.
## Details
* All-Unicode defaults in one place, but only list non-null default values.
(`blk=No_Block, cf=<code point>, ...`)
* Line-oriented, always semicolon-separated, with type-of-line in the first
field.
* Block properties override defaults; only for few properties where properties
in the block have common, non-default values.
* Effective because blocks represent actual allocation & organization of
Unicode. Maintained by UTC.
* Code point/range properties override default+block properties.
* Algorithmic names stored as ranges with type & shared name prefixes (for
CJK).
* No gratuitous white space or syntax characters.
* Mostly key=value, simpler format for binary properties. Easy to read.
* Comment lines with headings from NamesList.txt further improve readability.
(There are few of them, so no significant size bloat.)
* Simple, stable file generation allows diffing.
* E.g., list properties in sorted order of property names.
* No need to implement/store properties that are not used in ICU. (But format
& tool are easy to extend.)
## Plan
* (done) Write Python tool to preparse UCD .txt files and generate one output
ppucd.txt file.
* (done) Subsume existing ucdcopy.py.
* (done) Write toolutil C++ parser for ppucd.txt, add ppucd.txt to the unidata
folder.
* (done) Merge genbidi, gencase, gennames, gennorm into genprops
* Replace scattered many-.txt parsers with calls to the toolutil ppucd.txt
parser.
* Generate all output files in one genprops invocation.
* Update makeprops.sh (delete half of it) & changes.txt.
* (done) Make preparseucd.py also parse uchar.h & uscript.h and write the
property names data header file. (was: ~~Change genpname/preparse.pl to read
ppucd.txt rather than Property\[Value\]Aliases.txt.~~)
* (done) Consider changing pnames_data.h so that minor changes don't change
most of the file contents.
* (done) Write wiki/Markus/ReviewTicket8972 with diff links.
* 2019-sep-27: The old Trac server is going away. I copied the wiki page
contents into a comment on
[ICU-8972](https://unicode-org.atlassian.net/browse/ICU-8972).
* Move UCD tests from cintltst to intltest, change to use the toolutil
ppucd.txt parser. ([ticket
#9041](https://unicode-org.atlassian.net/browse/ICU-9041))
* Change Java UCD tests to parse & use ppucd.txt. (ticket #9041)
* (partially done) Change Python preparser to not copy input UCD .txt files
any more, delete them from unidata & Java. (ticket #9041)
## Other tool improvements
**Bad**: Until **ICU 4.8**, the process is
build & install ICU -> build Unicode tools -> run genpname -> build & install
ICU (now with updated property names) -> build Unicode tools -> run UCD parsers
-> build & install ICU (now also with case properties & normalization etc.) ->
build Unicode tools -> run genuca -> build & install ICU
It should be possible to
1. merge the Unicode tools into one binary
2. parameterize the relevant properties code (property name lookup, case & some
other properties, NFC)
3. inject newly built data into the common library for the next part of the
merged Unicode tool's processing.
**ICU 49**:
build & install ICU -> build Unicode tools -> run genprops -> build & install
ICU (now with updated properties) -> build Unicode tools -> run genuca -> build
& install ICU
genprops builds the property (value) names data and injects it into the live
ppucd.txt parser for further processing.
**Goal**:
build & install ICU -> build Unicode tool -> run it -> build & install ICU (now
with all updated Unicode data)
Requires [ticket #9040](https://unicode-org.atlassian.net/browse/ICU-9040),
could be "hard".
+20
View File
@@ -0,0 +1,20 @@
---
layout: default
title: Data Structures
parent: Design Docs
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Data Structures
## Subpage Listing
* [ICU Code Point Tries](./utrie)
* [ICU String Tries](./tries/)
* [BytesTrie](./tries/bytestrie/)
* [UCharsTrie](./tries/ucharstrie)
@@ -0,0 +1,358 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bytetrie.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010sep25
* created by: Markus W. Scherer
*/
#ifndef __BYTETRIE_H__
#define __BYTETRIE_H__
/**
* \file
* \brief C++ API: Dictionary trie for mapping arbitrary byte sequences
* to integer values.
*/
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class ByteTrieBuilder;
class ByteTrieIterator;
/**
* Light-weight, non-const reader class for a ByteTrie.
* Traverses a byte-serialized data structure with minimal state,
* for mapping byte sequences to non-negative integer values.
*/
class /*U_COMMON_API*/ ByteTrie : public UMemory {
public:
ByteTrie(const void *trieBytes)
: bytes(reinterpret_cast<const uint8_t *>(trieBytes)),
pos(bytes), remainingMatchLength(-1), value(0) {}
ByteTrie &reset() {
pos=bytes;
remainingMatchLength=-1;
return *this;
}
/**
* Traverses the trie from the current state for this input byte.
* @return TRUE if the byte continues a matching byte sequence.
*/
UBool next(int inByte);
/**
* @return TRUE if the trie contains the byte sequence so far.
* In this case, an immediately following call to getValue()
* returns the byte sequence's value.
*/
UBool contains();
/**
* Traverses the trie from the current state for this byte sequence,
* calls next(b) for each byte b in the sequence,
* and calls contains() at the end.
*/
UBool containsNext(const char *s, int32_t length);
/**
* Returns a byte sequence's value if called immediately after contains()
* returned TRUE. Otherwise undefined.
*/
int32_t getValue() const { return value; }
// TODO: For startsWith() functionality, add
// UBool getRemainder(ByteSink *remainingBytes, &value);
// Returns TRUE if exactly one byte sequence can be reached from the current iterator state.
// The remainingBytes sink will receive the remaining bytes of that one sequence.
// It might receive some bytes even when the function returns FALSE.
private:
friend class ByteTrieBuilder;
friend class ByteTrieIterator;
inline void stop() {
pos=NULL;
}
// Reads a compact 32-bit integer and post-increments pos.
// pos is already after the leadByte.
// Returns TRUE if the integer is a final value.
inline UBool readCompactInt(int32_t leadByte);
inline UBool readCompactInt() {
int32_t leadByte=*pos++;
return readCompactInt(leadByte);
}
// pos is on the leadByte.
inline void skipCompactInt(int32_t leadByte);
inline void skipCompactInt() { skipCompactInt(*pos); }
// Reads a fixed-width integer and post-increments pos.
inline int32_t readFixedInt(int32_t bytesPerValue);
// Node lead byte values.
// 0..3: Branch node with one comparison byte, 1..4 bytes for less-than jump delta,
// and compact int for equality.
// 04..0b: Branch node with a list of 2..9 bytes comparison bytes, each except last one
// followed by compact int as final value or jump delta.
static const int32_t kMinListBranch=4;
// 0c..1f: Node with 1..20 bytes to match.
static const int32_t kMinLinearMatch=0xc;
// 20..ff: Intermediate value or jump delta, or final value, with 0..4 bytes following.
static const int32_t kMinValueLead=0x20;
// It is a final value if bit 0 is set.
static const int32_t kValueIsFinal=1;
// Compact int: After testing bit 0, shift right by 1 and then use the following thresholds.
static const int32_t kMinOneByteLead=0x10;
static const int32_t kMinTwoByteLead=0x51;
static const int32_t kMinThreeByteLead=0x6d;
static const int32_t kFourByteLead=0x7e;
static const int32_t kFiveByteLead=0x7f;
static const int32_t kMaxOneByteValue=0x40; // At least 6 bits in the first byte.
static const int32_t kMaxTwoByteValue=0x1bff;
static const int32_t kMaxThreeByteValue=0x11ffff; // A little more than Unicode code points.
static const int32_t kMaxListBranchLength=kMinLinearMatch-kMinListBranch+1; // 9
static const int32_t kMaxLinearMatchLength=kMinValueLead-kMinLinearMatch; // 20
// Map a shifted-right compact-int lead byte to its number of bytes.
static const int8_t bytesPerLead[kFiveByteLead+1];
// Fixed value referencing the ByteTrie bytes.
const uint8_t *bytes;
// Iterator variables.
// Pointer to next trie byte to read. NULL if no more matches.
const uint8_t *pos;
// Remaining length of a linear-match node, minus 1. Negative if not in such a node.
int32_t remainingMatchLength;
// Value for a match, after contains() returned TRUE.
int32_t value;
};
const int8_t ByteTrie::bytesPerLead[kFiveByteLead+1]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5
};
UBool
ByteTrie::readCompactInt(int32_t leadByte) {
UBool isFinal=(UBool)(leadByte&kValueIsFinal);
leadByte>>=1;
int numBytes=bytesPerLead[leadByte]-1; // -1: lead byte was already consumed.
switch(numBytes) {
case 0:
value=leadByte-kMinOneByteLead;
break;
case 1:
value=((leadByte-kMinTwoByteLead)<<8)|*pos;
break;
case 2:
value=((leadByte-kMinThreeByteLead)<<16)|(pos[0]<<8)|pos[1];
break;
case 3:
value=(pos[0]<<16)|(pos[1]<<8)|pos[2];
break;
case 4:
value=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
break;
}
pos+=numBytes;
return isFinal;
}
void
ByteTrie::skipCompactInt(int32_t leadByte) {
pos+=bytesPerLead[leadByte>>1];
}
int32_t
ByteTrie::readFixedInt(int32_t bytesPerValue) {
int32_t fixedInt;
switch(bytesPerValue) { // Actually number of bytes minus 1.
case 0:
fixedInt=*pos;
break;
case 1:
fixedInt=(pos[0]<<8)|pos[1];
break;
case 2:
fixedInt=(pos[0]<<16)|(pos[1]<<8)|pos[2];
break;
case 3:
fixedInt=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
break;
}
pos+=bytesPerValue+1;
return fixedInt;
}
UBool
ByteTrie::next(int inByte) {
if(pos==NULL) {
return FALSE;
}
int32_t length=remainingMatchLength; // Actual remaining match length minus 1.
if(length>=0) {
// Remaining part of a linear-match node.
if(inByte==*pos) {
remainingMatchLength=length-1;
++pos;
return TRUE;
} else {
// No match.
stop();
return FALSE;
}
}
int32_t node=*pos++;
if(node>=kMinValueLead) {
if(node&kValueIsFinal) {
// No further matching bytes.
stop();
return FALSE;
} else {
// Skip intermediate value.
skipCompactInt(node);
// The next node must not also be a value node.
node=*pos++;
// TODO: U_ASSERT(node<kMinValueLead);
}
}
if(node<kMinLinearMatch) {
// Branch according to the current byte.
while(node<kMinListBranch) {
// Branching on a byte value,
// with a jump delta for less-than, a compact int for equals,
// and continuing for greater-than.
// The less-than and greater-than branches must lead to branch nodes again.
uint8_t trieByte=*pos++;
if(inByte<trieByte) {
int32_t delta=readFixedInt(node);
pos+=delta;
} else {
pos+=node+1; // Skip fixed-width integer.
node=*pos;
if(inByte==trieByte) {
// TODO: U_ASSERT(node>=KMinValueLead);
if(node&kValueIsFinal) {
// Leave the final value for contains() to read.
} else {
// Use the non-final value as the jump delta.
++pos;
readCompactInt(node);
pos+=value;
}
return TRUE;
} else { // inByte>trieByte
skipCompactInt(node);
}
}
node=*pos++;
// TODO: U_ASSERT(node<kMinLinearMatch);
}
// Branch node with a list of key-value pairs where
// values are compact integers: either final values or jump deltas.
// If the last key byte matches, just continue after it rather
// than jumping.
length=node-(kMinListBranch-1); // Actual list length minus 1.
for(;;) {
uint8_t trieByte=*pos++;
// U_ASSERT(listLength==0 || *pos>=KMinValueLead);
if(inByte==trieByte) {
if(length>0) {
node=*pos;
if(node&kValueIsFinal) {
// Leave the final value for contains() to read.
} else {
// Use the non-final value as the jump delta.
++pos;
readCompactInt(node);
pos+=value;
}
}
return TRUE;
}
if(inByte<trieByte || length--==0) {
stop();
return FALSE;
}
skipCompactInt();
}
} else {
// Match the first of length+1 bytes.
length=node-kMinLinearMatch; // Actual match length minus 1.
if(inByte==*pos) {
remainingMatchLength=length-1;
++pos;
return TRUE;
} else {
// No match.
stop();
return FALSE;
}
}
}
UBool
ByteTrie::contains() {
int32_t node;
if(pos!=NULL && remainingMatchLength<0 && (node=*pos)>=kMinValueLead) {
// Deliver value for the matching bytes.
++pos;
if(readCompactInt(node)) {
stop();
}
return TRUE;
}
return FALSE;
}
UBool
ByteTrie::containsNext(const char *s, int32_t length) {
if(length<0) {
// NUL-terminated
int b;
while((b=(uint8_t)*s++)!=0) {
if(!next(b)) {
return FALSE;
}
}
} else {
while(length>0) {
if(!next((uint8_t)*s++)) {
return FALSE;
}
--length;
}
}
return contains();
}
U_NAMESPACE_END
#endif // __BYTETRIE_H__
@@ -0,0 +1,536 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bytetriebuilder.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010sep25
* created by: Markus W. Scherer
*
* Builder class for ByteTrie dictionary trie.
*/
#ifndef __BYTETRIEBUILDER_H__
#define __BYTETRIEBUILDER_H__
#include "unicode/utypes.h"
#include "unicode/stringpiece.h"
#include "bytetrie.h"
#include "charstr.h"
#include "cmemory.h"
#include "uarrsort.h"
U_NAMESPACE_BEGIN
class ByteTrieElement;
class /*U_TOOLUTIL_API*/ ByteTrieBuilder : public UMemory {
public:
ByteTrieBuilder()
: elements(NULL), elementsCapacity(0), elementsLength(0),
bytes(NULL), bytesCapacity(0), bytesLength(0) {}
~ByteTrieBuilder();
ByteTrieBuilder &add(const StringPiece &s, int32_t value, UErrorCode &errorCode);
StringPiece build(UErrorCode &errorCode);
ByteTrieBuilder &clear() {
strings.clear();
elementsLength=0;
bytesLength=0;
return *this;
}
private:
void makeNode(int32_t start, int32_t limit, int32_t byteIndex);
void makeListBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length);
void makeThreeWayBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length);
UBool ensureCapacity(int32_t length);
void write(int32_t byte);
void write(const char *b, int32_t length);
void writeCompactInt(int32_t i, UBool final);
int32_t writeFixedInt(int32_t i); // Returns number of bytes.
CharString strings;
ByteTrieElement *elements;
int32_t elementsCapacity;
int32_t elementsLength;
// Byte serialization of the trie.
// Grows from the back: bytesLength measures from the end of the buffer!
char *bytes;
int32_t bytesCapacity;
int32_t bytesLength;
};
/*
* Note: This builder implementation stores (bytes, value) pairs with full copies
* of the byte sequences, until the ByteTrie is built.
* It might(!) take less memory if we collected the data in a temporary, dynamic trie.
*/
class ByteTrieElement : public UMemory {
public:
// Use compiler's default constructor, initializes nothing.
void setTo(const StringPiece &s, int32_t val, CharString &strings, UErrorCode &errorCode);
StringPiece getString(const CharString &strings) const {
int32_t offset=stringOffset;
int32_t length;
if(offset>=0) {
length=(uint8_t)strings[offset++];
} else {
offset=~offset;
length=((int32_t)(uint8_t)strings[offset]<<8)|(uint8_t)strings[offset+1];
offset+=2;
}
return StringPiece(strings.data()+offset, length);
}
int32_t getStringLength(const CharString &strings) const {
int32_t offset=stringOffset;
if(offset>=0) {
return (uint8_t)strings[offset];
} else {
offset=~offset;
return ((int32_t)(uint8_t)strings[offset]<<8)|(uint8_t)strings[offset+1];
}
}
char charAt(int32_t index, const CharString &strings) const { return data(strings)[index]; }
int32_t getValue() const { return value; }
int32_t compareStringTo(const ByteTrieElement &o, const CharString &strings) const;
private:
const char *data(const CharString &strings) const {
int32_t offset=stringOffset;
if(offset>=0) {
++offset;
} else {
offset=~offset+2;
}
return strings.data()+offset;
}
// If the stringOffset is non-negative, then the first strings byte contains
// the string length.
// If the stringOffset is negative, then the first two strings bytes contain
// the string length (big-endian), and the offset needs to be bit-inverted.
// (Compared with a stringLength field here, this saves 3 bytes per string for most strings.)
int32_t stringOffset;
int32_t value;
};
void
ByteTrieElement::setTo(const StringPiece &s, int32_t val,
CharString &strings, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return;
}
int32_t length=s.length();
if(length>0xffff) {
// Too long: We store the length in 1 or 2 bytes.
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return;
}
int32_t offset=strings.length();
if(length>0xff) {
offset=~offset;
strings.append((char)(length>>8), errorCode);
}
strings.append((char)length, errorCode);
stringOffset=offset;
value=val;
strings.append(s, errorCode);
}
int32_t
ByteTrieElement::compareStringTo(const ByteTrieElement &other, const CharString &strings) const {
// TODO: add StringPiece.compareTo()
StringPiece thisString=getString(strings);
StringPiece otherString=other.getString(strings);
int32_t lengthDiff=thisString.length()-otherString.length();
int32_t commonLength;
if(lengthDiff<=0) {
commonLength=thisString.length();
} else {
commonLength=otherString.length();
}
int32_t diff=uprv_memcmp(thisString.data(), otherString.data(), commonLength);
return diff!=0 ? diff : lengthDiff;
}
ByteTrieBuilder::~ByteTrieBuilder() {
delete[] elements;
uprv_free(bytes);
}
ByteTrieBuilder &
ByteTrieBuilder::add(const StringPiece &s, int32_t value, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return *this;
}
if(bytesLength>0) {
// Cannot add elements after building.
errorCode=U_NO_WRITE_PERMISSION;
return *this;
}
bytesCapacity+=s.length()+1; // Crude bytes preallocation estimate.
if(elementsLength==elementsCapacity) {
int32_t newCapacity;
if(elementsCapacity==0) {
newCapacity=1024;
} else {
newCapacity=4*elementsCapacity;
}
ByteTrieElement *newElements=new ByteTrieElement[newCapacity];
if(newElements==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
}
if(elementsLength>0) {
uprv_memcpy(newElements, elements, elementsLength*sizeof(ByteTrieElement));
}
delete[] elements;
elements=newElements;
}
elements[elementsLength++].setTo(s, value, strings, errorCode);
return *this;
}
U_CDECL_BEGIN
static int32_t U_CALLCONV
compareElementStrings(const void *context, const void *left, const void *right) {
const CharString *strings=reinterpret_cast<const CharString *>(context);
const ByteTrieElement *leftElement=reinterpret_cast<const ByteTrieElement *>(left);
const ByteTrieElement *rightElement=reinterpret_cast<const ByteTrieElement *>(right);
return leftElement->compareStringTo(*rightElement, *strings);
}
U_CDECL_END
StringPiece
ByteTrieBuilder::build(UErrorCode &errorCode) {
StringPiece result;
if(U_FAILURE(errorCode)) {
return result;
}
if(bytesLength>0) {
// Already built.
result.set(bytes+(bytesCapacity-bytesLength), bytesLength);
return result;
}
if(elementsLength==0) {
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return result;
}
uprv_sortArray(elements, elementsLength, (int32_t)sizeof(ByteTrieElement),
compareElementStrings, &strings,
FALSE, // need not be a stable sort
&errorCode);
if(U_FAILURE(errorCode)) {
return result;
}
// Duplicate strings are not allowed.
StringPiece prev=elements[0].getString(strings);
for(int32_t i=1; i<elementsLength; ++i) {
StringPiece current=elements[i].getString(strings);
if(prev==current) {
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
return result;
}
prev=current;
}
// Create and byte-serialize the trie for the elements.
if(bytesCapacity<1024) {
bytesCapacity=1024;
}
bytes=reinterpret_cast<char *>(uprv_malloc(bytesCapacity));
if(bytes==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
return result;
}
makeNode(0, elementsLength, 0);
if(bytes==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
} else {
result.set(bytes+(bytesCapacity-bytesLength), bytesLength);
}
return result;
}
// Requires start<limit,
// and all strings of the [start..limit[ elements must be sorted and
// have a common prefix of length firstByteIndex.
void
ByteTrieBuilder::makeNode(int32_t start, int32_t limit, int32_t byteIndex) {
if(byteIndex==elements[start].getStringLength(strings)) {
// An intermediate or final value.
int32_t value=elements[start++].getValue();
UBool final= start==limit;
if(!final) {
makeNode(start, limit, byteIndex);
}
writeCompactInt(value, final);
return;
}
// Now all [start..limit[ strings are longer than byteIndex.
int32_t minByte=(uint8_t)elements[start].charAt(byteIndex, strings);
int32_t maxByte=(uint8_t)elements[limit-1].charAt(byteIndex, strings);
if(minByte==maxByte) {
// Linear-match node: All strings have the same character at byteIndex.
int32_t lastByteIndex=byteIndex;
int32_t length=0;
do {
++lastByteIndex;
++length;
} while(length<ByteTrie::kMaxLinearMatchLength &&
elements[start].getStringLength(strings)>lastByteIndex &&
elements[start].charAt(lastByteIndex, strings)==
elements[limit-1].charAt(lastByteIndex, strings));
makeNode(start, limit, lastByteIndex);
write(elements[start].getString(strings).data()+byteIndex, length);
write(ByteTrie::kMinLinearMatch+length-1);
return;
}
// Branch node.
int32_t length=0; // Number of different bytes at byteIndex.
int32_t i=start;
do {
char byte=elements[i++].charAt(byteIndex, strings);
while(i<limit && byte==elements[i].charAt(byteIndex, strings)) {
++i;
}
++length;
} while(i<limit);
// length>=2 because minByte!=maxByte.
if(length<=ByteTrie::kMaxListBranchLength) {
makeListBranchNode(start, limit, byteIndex, length);
} else {
makeThreeWayBranchNode(start, limit, byteIndex, length);
}
}
// start<limit && all strings longer than byteIndex &&
// 2..kMaxListBranchLength different bytes at byteIndex
void
ByteTrieBuilder::makeListBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length) {
// List of byte-value pairs where values are either final values
// or jumps to other parts of the trie.
int32_t starts[ByteTrie::kMaxListBranchLength-1];
UBool final[ByteTrie::kMaxListBranchLength-1];
// For each byte except the last one, find its elements array start and its value if final.
int32_t byteNumber=0;
do {
int32_t i=starts[byteNumber]=start;
char byte=elements[i++].charAt(byteIndex, strings);
while(byte==elements[i].charAt(byteIndex, strings)) {
++i;
}
final[byteNumber]= start==i-1 && byteIndex+1==elements[start].getStringLength(strings);
start=i;
} while(++byteNumber<length-1);
// byteNumber==length-1, and the maxByte elements range is [start..limit[
// Write the sub-nodes in reverse order: The jump lengths are deltas from
// after their own positions, so if we wrote the minByte sub-node first,
// then its jump delta would be larger.
// Instead we write the minByte sub-node last, for a shorter delta.
int32_t jumpTargets[ByteTrie::kMaxListBranchLength-1];
byteNumber-=2;
do {
if(!final[byteNumber]) {
makeNode(starts[byteNumber], starts[byteNumber+1], byteIndex+1);
jumpTargets[byteNumber]=bytesLength;
}
} while(--byteNumber>=0);
// The maxByte sub-node is written as the very last one because we do
// not jump for it at all.
byteNumber=length-1;
makeNode(start, limit, byteIndex+1);
write(elements[start].charAt(byteIndex, strings));
// Write the rest of this node's byte-value pairs.
while(--byteNumber>=0) {
start=starts[byteNumber];
int32_t value;
if(final[byteNumber]) {
// Write the final value for the one string ending with this byte.
value=elements[start].getValue();
} else {
// Write the delta to the start position of the sub-node.
value=bytesLength-jumpTargets[byteNumber];
}
writeCompactInt(value, final[byteNumber]);
write(elements[start].charAt(byteIndex, strings));
}
// Write the node lead byte.
write(ByteTrie::kMinListBranch+length-2);
}
// start<limit && all strings longer than byteIndex &&
// at least three different bytes at byteIndex
void
ByteTrieBuilder::makeThreeWayBranchNode(int32_t start, int32_t limit, int32_t byteIndex, int32_t length) {
// Three-way branch on the middle byte.
// Find the middle byte.
length/=2; // >=1
int32_t i=start;
do {
char byte=elements[i++].charAt(byteIndex, strings);
while(byte==elements[i].charAt(byteIndex, strings)) {
++i;
}
} while(--length>0);
// Encode the less-than branch first.
// Unlike in the list-branch node (see comments above) where
// all jumps are encoded in compact integers, in this node type the
// less-than jump is more efficient
// (because it is only ever a jump, with a known number of bytes)
// than the equals jump (where a jump needs to be distinguished from a final value).
makeNode(start, i, byteIndex);
int32_t leftNode=bytesLength;
// Find the elements range for the middle byte.
start=i;
char byte=elements[i++].charAt(byteIndex, strings);
while(byte==elements[i].charAt(byteIndex, strings)) {
++i;
}
// Encode the equals branch.
int32_t value;
UBool final;
if(start==i-1 && byteIndex+1==elements[start].getStringLength(strings)) {
// Store the final value for the one string ending with this byte.
value=elements[start].getValue();
final=TRUE;
} else {
// Store the start position of the sub-node.
makeNode(start, i, byteIndex+1);
value=bytesLength;
final=FALSE;
}
// Encode the greater-than branch last because we do not jump for it at all.
makeNode(i, limit, byteIndex);
// Write this node.
if(!final) {
value=bytesLength-value;
}
writeCompactInt(value, final); // equals
int32_t bytesForJump=writeFixedInt(bytesLength-leftNode); // less-than
write(byte);
write(bytesForJump-1);
}
UBool
ByteTrieBuilder::ensureCapacity(int32_t length) {
if(bytes==NULL) {
return FALSE; // previous memory allocation had failed
}
if(length>bytesCapacity) {
int32_t newCapacity=bytesCapacity;
do {
newCapacity*=2;
} while(newCapacity<=length);
char *newBytes=reinterpret_cast<char *>(uprv_malloc(newCapacity));
if(newBytes==NULL) {
// unable to allocate memory
uprv_free(bytes);
bytes=NULL;
return FALSE;
}
uprv_memcpy(newBytes+(newCapacity-bytesLength),
bytes+(bytesCapacity-bytesLength), bytesLength);
uprv_free(bytes);
bytes=newBytes;
bytesCapacity=newCapacity;
}
return TRUE;
}
void
ByteTrieBuilder::write(int32_t byte) {
int32_t newLength=bytesLength+1;
if(ensureCapacity(newLength)) {
bytesLength=newLength;
bytes[bytesCapacity-bytesLength]=(char)byte;
}
}
void
ByteTrieBuilder::write(const char *b, int32_t length) {
int32_t newLength=bytesLength+length;
if(ensureCapacity(newLength)) {
bytesLength=newLength;
uprv_memcpy(bytes+(bytesCapacity-bytesLength), b, length);
}
}
void
ByteTrieBuilder::writeCompactInt(int32_t i, UBool final) {
char intBytes[5];
int32_t length=1;
if(i<0 || i>0xffffff) {
intBytes[0]=(char)(ByteTrie::kFiveByteLead);
intBytes[1]=(char)(i>>24);
intBytes[2]=(char)(i>>16);
intBytes[3]=(char)(i>>8);
intBytes[4]=(char)(i);
length=5;
} else if(i<=ByteTrie::kMaxOneByteValue) {
intBytes[0]=(char)(ByteTrie::kMinOneByteLead+i);
} else {
if(i<=ByteTrie::kMaxTwoByteValue) {
intBytes[0]=(char)(ByteTrie::kMinTwoByteLead+(i>>8));
} else {
if(i<=ByteTrie::kMaxThreeByteValue) {
intBytes[0]=(char)(ByteTrie::kMinThreeByteLead+(i>>16));
} else {
intBytes[0]=(char)(ByteTrie::kFourByteLead);
intBytes[1]=(char)(i>>16);
length=2;
}
intBytes[length++]=(char)(i>>8);
}
intBytes[length++]=(char)(i);
}
intBytes[0]=(char)((intBytes[0]<<1)|final);
write(intBytes, length);
}
int32_t
ByteTrieBuilder::writeFixedInt(int32_t i) {
char intBytes[4];
int32_t length;
if(i<0 || i>0xffffff) {
intBytes[0]=(char)(i>>24);
intBytes[1]=(char)(i>>16);
intBytes[2]=(char)(i>>8);
length=3; // last byte below
} else {
if(i<=0xffff) {
length=0;
} else {
intBytes[0]=(char)(i>>16);
length=1;
}
if(i>0xff) {
intBytes[length++]=(char)(i>>8);
}
}
intBytes[length++]=(char)(i);
write(intBytes, length);
return length;
}
U_NAMESPACE_END
#endif // __BYTETRIEBUILDER_H__
@@ -0,0 +1,137 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bytetriedemo.cpp
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010nov05
* created by: Markus W. Scherer
*/
#include <stdio.h>
#include "unicode/utypes.h"
#include "unicode/stringpiece.h"
#include "bytetrie.h"
#include "bytetriebuilder.h"
#include "bytetrieiterator.h"
#include "denseranges.h"
#include "toolutil.h"
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
static void
printBytes(const char *name, const StringPiece &bytes) {
printf("%18s [%3d]", name, (int)bytes.length());
for(int32_t i=0; i<bytes.length(); ++i) {
printf(" %02x", bytes.data()[i]&0xff); // TODO: Add StringPiece::operator[] const
}
puts("");
}
static void
printTrie(const StringPiece &bytes) {
IcuToolErrorCode errorCode("printTrie");
ByteTrieIterator iter(bytes.data(), errorCode);
while(iter.next(errorCode)) {
printf(" '%s': %d\n", iter.getString().data(), (int)iter.getValue());
}
}
static void printRanges(const int32_t ranges[][2], int32_t length) {
printf("ranges[%d]", (int)length);
for(int32_t i=0; i<length; ++i) {
printf(" [%ld..%ld]", (long)ranges[i][0], (long)ranges[i][1]);
}
puts("");
}
extern int main(int argc, char* argv[]) {
IcuToolErrorCode errorCode("bytetriedemo");
ByteTrieBuilder builder;
StringPiece sp=builder.add("", 0, errorCode).build(errorCode);
printBytes("empty string", sp);
ByteTrie empty(sp.data());
UBool contains=empty.contains();
printf("empty.next() %d %d\n", contains, (int)empty.getValue());
printTrie(sp);
sp=builder.clear().add("a", 1, errorCode).build(errorCode);
printBytes("a", sp);
ByteTrie a(sp.data());
contains=a.next('a') && a.contains();
printf("a.next(a) %d %d\n", contains, (int)a.getValue());
printTrie(sp);
sp=builder.clear().add("ab", -1, errorCode).build(errorCode);
printBytes("ab", sp);
ByteTrie ab(sp.data());
contains=ab.next('a') && ab.next('b') && ab.contains();
printf("ab.next(ab) %d %d\n", contains, (int)ab.getValue());
printTrie(sp);
sp=builder.clear().add("a", 1, errorCode).add("ab", 100, errorCode).build(errorCode);
printBytes("a+ab", sp);
ByteTrie a_ab(sp.data());
contains=a_ab.next('a') && a_ab.contains();
printf("a_ab.next(a) %d %d\n", contains, (int)a_ab.getValue());
contains=a_ab.next('b') && a_ab.contains();
printf("a_ab.next(b) %d %d\n", contains, (int)a_ab.getValue());
contains=a_ab.contains();
printf("a_ab.next() %d %d\n", contains, (int)a_ab.getValue());
printTrie(sp);
sp=builder.clear().add("a", 1, errorCode).add("b", 2, errorCode).add("c", 3, errorCode).build(errorCode);
printBytes("a+b+c", sp);
ByteTrie a_b_c(sp.data());
contains=a_b_c.next('a') && a_b_c.contains();
printf("a_b_c.next(a) %d %d\n", contains, (int)a_b_c.getValue());
contains=a_b_c.next('b') && a_b_c.contains();
printf("a_b_c.next(b) %d %d\n", contains, (int)a_b_c.getValue());
contains=a_b_c.reset().next('b') && a_b_c.contains();
printf("a_b_c.r.next(b) %d %d\n", contains, (int)a_b_c.getValue());
contains=a_b_c.reset().next('c') && a_b_c.contains();
printf("a_b_c.r.next(c) %d %d\n", contains, (int)a_b_c.getValue());
contains=a_b_c.reset().next('d') && a_b_c.contains();
printf("a_b_c.r.next(d) %d %d\n", contains, (int)a_b_c.getValue());
printTrie(sp);
builder.clear().add("a", 1, errorCode).add("b", 2, errorCode).add("c", 3, errorCode);
builder.add("d", 10, errorCode).add("e", 20, errorCode).add("f", 30, errorCode);
builder.add("g", 100, errorCode).add("h", 200, errorCode).add("i", 300, errorCode);
builder.add("j", 1000, errorCode).add("k", 2000, errorCode).add("l", 3000, errorCode);
sp=builder.build(errorCode);
printBytes("a-l", sp);
ByteTrie a_l(sp.data());
for(char c='`'; c<='m'; ++c) {
contains=a_l.reset().next(c) && a_l.contains();
printf("a_l.r.next(%c) %d %d\n", c, contains, (int)a_l.getValue());
}
printTrie(sp);
static const int32_t values[]={
-1, 0, 1, 2,
4, 5, 6, 7,
12, 13, 14,
24, 25, 26
};
int32_t ranges[3][2];
int32_t length;
length=uprv_makeDenseRanges(values, LENGTHOF(values), 1, ranges, LENGTHOF(ranges));
printRanges(ranges, length);
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0xc0, ranges, LENGTHOF(ranges));
printRanges(ranges, length);
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0xf0, ranges, LENGTHOF(ranges));
printRanges(ranges, length);
length=uprv_makeDenseRanges(values, LENGTHOF(values), 0x100, ranges, LENGTHOF(ranges));
printRanges(ranges, length);
return 0;
}
@@ -0,0 +1,199 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bytetrieiterator.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010nov03
* created by: Markus W. Scherer
*/
#ifndef __BYTETRIEITERATOR_H__
#define __BYTETRIEITERATOR_H__
/**
* \file
* \brief C++ API: ByteTrie iterator for all of its (byte sequence, value) pairs.
*/
// Needed if and when we change the .dat package index to a ByteTrie,
// so that icupkg can work with an input package.
#include "unicode/utypes.h"
#include "unicode/stringpiece.h"
#include "bytetrie.h"
#include "charstr.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
/**
* Iterator for all of the (byte sequence, value) pairs in a a ByteTrie.
*/
class /*U_TOOLUTIL_API*/ ByteTrieIterator : public UMemory {
public:
ByteTrieIterator(const void *trieBytes, UErrorCode &errorCode)
: trie(trieBytes), value(0), stack(errorCode) {}
/**
* Finds the next (byte sequence, value) pair if there is one.
* @return TRUE if there is another element.
*/
UBool next(UErrorCode &errorCode);
/**
* @return TRUE if there are more elements.
*/
UBool hasNext() const { return trie.pos!=NULL || !stack.isEmpty(); }
/**
* @return the NUL-terminated byte sequence for the last successful next()
*/
const StringPiece &getString() const { return sp; }
/**
* @return the value for the last successful next()
*/
const int32_t getValue() const { return value; }
private:
// The stack stores pairs of integers for backtracking to another
// outbound edge of a branch node.
// The first integer is an offset from ByteTrie.bytes.
// The second integer has the str.length() from before the node in bits 27..0,
// and the state in bits 31..28.
// Except for the following values for a three-way-branch node,
// the lower values indicate how many branches of a list-branch node
// are left to be visited.
static const int32_t kThreeWayBranchEquals=0xe;
static const int32_t kThreeWayBranchGreaterThan=0xf;
ByteTrie trie;
CharString str;
StringPiece sp;
int32_t value;
UVector32 stack;
};
UBool
ByteTrieIterator::next(UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return FALSE;
}
if(trie.pos==NULL) {
if(stack.isEmpty()) {
return FALSE;
}
// Read the top of the stack and continue with the next outbound edge of
// the branch node.
// The last outbound edge causes the branch node to be popped off the stack
// and the iteration to continue from the trie.pos there.
int32_t stackSize=stack.size();
int32_t state=stack.elementAti(stackSize-1);
trie.pos=trie.bytes+stack.elementAti(stackSize-2);
str.truncate(state&0xfffffff);
state=(state>>28)&0xf;
if(state==kThreeWayBranchEquals) {
int32_t node=*trie.pos; // Known to be a three-way-branch node.
uint8_t trieByte=trie.pos[1];
trie.pos+=node+3; // Skip node, trie byte and fixed-width integer.
UBool isFinal=trie.readCompactInt();
// Rewrite the top of the stack for the greater-than branch.
stack.setElementAt((int32_t)(trie.pos-trie.bytes), stackSize-2);
stack.setElementAt((kThreeWayBranchGreaterThan<<28)|str.length(), stackSize-1);
str.append((char)trieByte, errorCode);
if(isFinal) {
value=trie.value;
trie.stop();
sp.set(str.data(), str.length());
return TRUE;
} else {
trie.pos+=trie.value;
}
} else if(state==kThreeWayBranchGreaterThan) {
// Pop the state.
stack.setSize(stackSize-2);
} else {
// Remainder of a list-branch node.
// Read the next key byte.
str.append((char)*trie.pos++, errorCode);
if(state>0) {
UBool isFinal=trie.readCompactInt();
// Rewrite the top of the stack for the next branch.
stack.setElementAt((int32_t)(trie.pos-trie.bytes), stackSize-2);
stack.setElementAt(((state-1)<<28)|(str.length()-1), stackSize-1);
if(isFinal) {
value=trie.value;
trie.stop();
sp.set(str.data(), str.length());
return TRUE;
} else {
trie.pos+=trie.value;
}
} else {
// Pop the state.
stack.setSize(stackSize-2);
}
}
}
for(;;) {
int32_t node=*trie.pos++;
if(node>=ByteTrie::kMinValueLead) {
// Deliver value for the byte sequence so far.
if(trie.readCompactInt(node)) {
value=trie.value;
trie.stop();
}
sp.set(str.data(), str.length());
return TRUE;
} else if(node<ByteTrie::kMinLinearMatch) {
// Branch node, needs to take the first outbound edge and push state for the rest.
if(node<ByteTrie::kMinListBranch) {
// Branching on a byte value,
// with a jump delta for less-than, a compact int for equals,
// and continuing for greater-than.
stack.addElement((int32_t)(trie.pos-1-trie.bytes), errorCode);
stack.addElement((kThreeWayBranchEquals<<28)|str.length(), errorCode);
// For the less-than branch, ignore the trie byte.
++trie.pos;
// Jump.
int32_t delta=trie.readFixedInt(node);
trie.pos+=delta;
} else {
// Branch node with a list of key-value pairs where
// values are compact integers: either final values or jump deltas.
int32_t length=node-ByteTrie::kMinListBranch; // Actual list length minus 2.
// Read the first (key, value) pair.
uint8_t trieByte=*trie.pos++;
UBool isFinal=trie.readCompactInt();
stack.addElement((int32_t)(trie.pos-trie.bytes), errorCode);
stack.addElement((length<<28)|str.length(), errorCode);
str.append((char)trieByte, errorCode);
if(isFinal) {
value=trie.value;
trie.stop();
sp.set(str.data(), str.length());
return TRUE;
} else {
trie.pos+=trie.value;
}
}
} else {
// Linear-match node, append length bytes to str.
int32_t length=node-ByteTrie::kMinLinearMatch+1;
str.append(reinterpret_cast<const char *>(trie.pos), length, errorCode);
trie.pos+=length;
}
}
}
U_NAMESPACE_END
#endif // __BYTETRIEITERATOR_H__
@@ -0,0 +1,164 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: denseranges.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010sep25
* created by: Markus W. Scherer
*
* Helper code for finding a small number of dense ranges.
*/
#ifndef __DENSERANGES_H__
#define __DENSERANGES_H__
#include "unicode/utypes.h"
// Definitions in the anonymous namespace are invisible outside this file.
namespace {
/**
* Collect up to 15 range gaps and sort them by ascending gap size.
*/
class LargestGaps {
public:
LargestGaps(int32_t max) : maxLength(max<=kCapacity ? max : kCapacity), length(0) {}
void add(int32_t gapStart, int64_t gapLength) {
int32_t i=length;
while(i>0 && gapLength>gapLengths[i-1]) {
--i;
}
if(i<maxLength) {
// The new gap is now one of the maxLength largest.
// Insert the new gap, moving up smaller ones of the previous
// length largest.
int32_t j= length<maxLength ? j=length++ : j=(maxLength-1);
while(j>i) {
gapStarts[j]=gapStarts[j-1];
gapLengths[j]=gapLengths[j-1];
--j;
}
gapStarts[i]=gapStart;
gapLengths[i]=gapLength;
}
}
void truncate(int32_t newLength) {
if(newLength<length) {
length=newLength;
}
}
int32_t count() const { return length; }
int32_t gapStart(int32_t i) const { return gapStarts[i]; }
int64_t gapLength(int32_t i) const { return gapLengths[i]; }
int32_t firstAfter(int32_t value) const {
if(length==0) {
return -1;
}
int32_t minValue=0;
int32_t minIndex=-1;
for(int32_t i=0; i<length; ++i) {
if(value<gapStarts[i] && (minIndex<0 || gapStarts[i]<minValue)) {
minValue=gapStarts[i];
minIndex=i;
}
}
return minIndex;
}
private:
static const int32_t kCapacity=15;
int32_t maxLength;
int32_t length;
int32_t gapStarts[kCapacity];
int64_t gapLengths[kCapacity];
};
} // namespace
/**
* Does it make sense to write 1..capacity ranges?
* Returns 0 if not, otherwise the number of ranges.
* @param values Sorted array of signed-integer values.
* @param length Number of values.
* @param density Minimum average range density, in 256th. (0x100=100%=perfectly dense.)
* Should be 0x80..0x100, must be 1..0x100.
* @param ranges Output ranges array.
* @param capacity Maximum number of ranges.
* @return Minimum number of ranges (at most capacity) that have the desired density,
* or 0 if that density cannot be achieved.
*/
U_CAPI int32_t U_EXPORT2
uprv_makeDenseRanges(const int32_t values[], int32_t length,
int32_t density,
int32_t ranges[][2], int32_t capacity) {
if(length<=2) {
return 0;
}
int32_t minValue=values[0];
int32_t maxValue=values[length-1]; // Assume minValue<=maxValue.
// Use int64_t variables for intermediate-value precision and to avoid
// signed-int32_t overflow of maxValue-minValue.
int64_t maxLength=(int64_t)maxValue-(int64_t)minValue+1;
if(length>=(density*maxLength)/0x100) {
// Use one range.
ranges[0][0]=minValue;
ranges[0][1]=maxValue;
return 1;
}
if(length<=4) {
return 0;
}
// See if we can split [minValue, maxValue] into 2..capacity ranges,
// divided by the 1..(capacity-1) largest gaps.
LargestGaps gaps(capacity-1);
int32_t i;
int32_t expectedValue=minValue;
for(i=1; i<length; ++i) {
++expectedValue;
int32_t actualValue=values[i];
if(expectedValue!=actualValue) {
gaps.add(expectedValue, (int64_t)actualValue-(int64_t)expectedValue);
expectedValue=actualValue;
}
}
// We know gaps.count()>=1 because we have fewer values (length) than
// the length of the [minValue..maxValue] range (maxLength).
// (Otherwise we would have returned with the one range above.)
int32_t num;
for(i=0, num=2;; ++i, ++num) {
if(i>=gaps.count()) {
// The values are too sparse for capacity or fewer ranges
// of the requested density.
return 0;
}
maxLength-=gaps.gapLength(i);
if(length>num*2 && length>=(density*maxLength)/0x100) {
break;
}
}
// Use the num ranges with the num-1 largest gaps.
gaps.truncate(num-1);
ranges[0][0]=minValue;
for(i=0; i<=num-2; ++i) {
int32_t gapIndex=gaps.firstAfter(minValue);
int32_t gapStart=gaps.gapStart(gapIndex);
ranges[i][1]=gapStart-1;
ranges[i+1][0]=minValue=(int32_t)(gapStart+gaps.gapLength(gapIndex));
}
ranges[num-1][1]=maxValue;
return num;
}
#endif // __DENSERANGES_H__
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
---
layout: default
title: BytesTrie
parent: Data Structures
grand_parent: Design Docs
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# BytesTrie
This is an idea for a trie that is intended to be fairly simple but also fairly
efficient and versatile. It maps from arbitrary byte sequences to 32-bit
integers. (Small non-negative integers are stored more efficiently. Negative
integers are the least efficient.)
Input strings would be mapped to byte sequences. Invariant-character strings
could be used directly, if the trie was built for the appropriate charset
family, or we could map EBCDIC input to ASCII (while lowercasing for
case-insensitive matching).
For Thai DBBI, each of U+0E00..U+0EFF could be mapped to its low byte.
For CJK DBBI, we could use UTF-16BE or a slight variant of it. For general
Unicode strings (e.g., time zone names), we could devise a simple encoding that
maps printable ASCII to single bytes, Unihan & Hangul and some other ranges to
two bytes per character, and the rest to three bytes per character. (We could
also use this for CJK DBBI, to reduce the number of such "converters".) Or, we
use a [UCharsTrie](../ucharstrie.md) for those.
Sample code is linked below.
See the [UCharsTrie](../ucharstrie.md) sibling page for some more details. The
BytesTrie and UCharsTrie structures are nearly the same, except that the
UCharsTrie uses fewer, larger units.
See also the [diagram of a BytesTrie for a sample set of string-to-value
mappings](https://docs.google.com/drawings/edit?id=1-doZNpcByYItcDAcvKmIpwJMWFgXpYCm43GnUrbat3g).
## Design points
* The BytesTrie and UCharsTrie are designed to be
byte-serialized/UChar-serialized, for trivial platform swapping.
* Compact: Small values and jump deltas should be encoded in few bytes. This
requires variable-length encodings.
* The length of each value/delta is encoded either in a preceding node or in
its own lead unit. This makes skipping values efficient, and fewer units
need to be range-checked while reading variable-length values.
* Nodes with small values are encoded in single units.
* Linear-match nodes match a sequence of units without choice/selection.
* Branches
* Branches store relative deltas to "jump" to following nodes. Small
deltas are encoded in single units; encoding deltas is much more
efficient than encoding absolute offsets.
* Variable-width values make binary search on branch nodes infeasible.
Therefore, branches with lists of (key, value) pairs are limited to
short list lengths for linear search.
* For large branches, branch nodes contain one unit, for branching to the
left (less-than) or to the right (greater-or-equal). This encodes a
binary search into the data structure.
* Initially, I had an equals edge in split-branch sub-nodes as well,
but that slowed down matching significantly (9% in one case) without
noticeably helping with the serialized size (0.2% in that case).
* At the end of each node (except for a final-value node), matching
continues with the next node, rather than using another jump to a
different location.
* Each branch head node encodes the length of the branch (the number of
units to select from). The split-branch and list-branch sub-nodes do not
have node heads. Instead, the code tracks the remaining length of the
branch, halving it for each split-branch edge and counting down in a
list-branch sub-node.
* The maximum length of a list-branch sub-node is fixed, that is, part of
the serialized data format and cannot be changed compatibly. This
constant is used in the branching code to decide whether to split
less-than/greater-or-equal vs. walk a list of key-value pairs.
* This constant must be at least 3 so that split-branch sub-nodes have a
length of at least 4 so that the following list-branch nodes have a
length of at least 2 and can use a do-while loop rather than a while
loop. (Saving one length check.)
* I explored an alternative, with only split-branch nodes down to length 1
and then a final match unit with continuing matching after that. It was
fast but also significantly larger. A branch like this is about twice
the size of a key-value pair list. If the average list-branch length is
n, a branch has (length/n)-1 split-branch sub-nodes. This experiment
corresponds to n=1.
* API
* The API is simple and low-level. At the core, next(unit) "turns the
crank" and returns basically a 2-bit result that encodes matches() (this
unit continues a matching sequence), hasNext() (another unit can
continue a matching sequence) and hasValue() (the units so far are a
matching string).
* Higher-level functions that handle different input (e.g., normalize
units on the fly) and provide variations of functionality (e.g., longest
match, startsWith, find all matches from some point in text, ...) can be
built on top of the low-level functions without cluttering the API or
pulling in further dependencies.
* The next(unit) function stops on a value node rather than decoding the
value, saving time until the value is requested (via getValue()). The
following next(unit2) call will then skip over the value node.
* There is enough API to serve a variety of uses, including
matching/mapping whole strings, finding out if a prefix belongs only to
strings with the same value, getting all units that can continue from
some point, and getting all (string, value) pairs. This should be able
to support lookups, parsing with abbreviations, word segmentation, etc.
* The "fast" builder code is simple. The builder builds, it need not use a
trie structure until writing the serialized form, and it need not provide
any of the trie runtime API.
* There is builder code that makes a "small" trie, attempting to avoid writing
duplicate nodes. This is possible when whole trees of nodes are the same and
at least one is reached via a "jump" delta which can "jump" to the
previously written serialization of such a tree.
## Sample Code
The following demo code was last updaed Nov. 2010:
* [`bytetrie.h`](./bytetrie.h)
* [`bytetriebuilder.h`](./bytetriebuilder.h)
* [`bytetriedemo.cpp`](./bytetriedemo.cpp)
* [`bytetrieiterator.h`](./bytetrieiterator.h)
* [`denseranges.h`](./denseranges.h)
* [`genpname.cpp`](./genpname.cpp)
### Latest versions of source code
The latest versions of the above sample code (except for `bytetriedemo.cpp`) exist in the ICU repository, sometimes under slightly different names and reorganized:
* [icu4c/source/common/unicode/**bytestrie.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/bytestrie.h)
* [icu4c/source/common/unicode/**bytestriebuilder.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/bytestriebuilder.h)
* [icu4c/source/tools/toolutil/**denseranges.h**](https://github.com/unicode-org/icu/blob/main/icu4c/source/tools/toolutil/denseranges.h)
* [tools/unicode/c/genprops/**pnamesbuilder.cpp**](https://github.com/unicode-org/icu/blob/main/tools/unicode/c/genprops/pnamesbuilder.cpp)
+38
View File
@@ -0,0 +1,38 @@
---
layout: default
title: ICU String Tries
parent: Data Structures
grand_parent: Design Docs
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# ICU String Tries
We have several implementations of string tries, mapping strings to boolean or
integer values: Currently for time zone name parsing and DBBI. Other areas might
also benefit from tries: Property names, character names, UnicodeSetStringSpan,
.dat package file TOC.
We should have a small number of common map-from-string trie implementations;
fairly compact, fairly efficient, easily serializable, and well-tested.
See the subpages for ideas.
For a UnicodeSetStringSpan, we would want to find each next match starting from
some point in the text, rather than passing each unit of text and finding out if
the units so far match.
Note: In terms of whole-string-lookup performance, the fastest data structure is
a hash map. Where whole-string-lookup is the only relevant operation, we could
consider implementing an easily serialized hash map.
See also [ICU Code Point Tries](../utrie.md).
Implementations:
* [BytesTrie](./bytestrie/)
* [UCharsTrie](./ucharstrie)
+32
View File
@@ -0,0 +1,32 @@
---
layout: default
title: UCharsTrie
parent: Data Structures
grand_parent: Design Docs
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# UCharsTrie
Same design as a [BytesTrie](bytestrie/index.md), but mapping any UnicodeString
(any sequence of 16-bit units) to 32-bit integer values. This can use somewhat
simpler code because there are more bits to work with in each unit, and it is
probably more appropriate and faster than a BytesTrie for collation
contractions/prefixes, CJK dictionaries, and maybe for use with Unicode strings
in general when it is not known that we work with a small script or mostly with
ASCII.
The code and data structure are quite similar to the BytesTrie. In general,
larger units are used to store larger values and deltas in single units than
possible in a BytesTrie, and fewer variable-length units are needed in all
cases.
In addition, some of the bits of match-nodes (linear-match and branch nodes) are
used for intermediate values (small values or most significant bits), rather
than separate intermediate-value nodes in a BytesTrie. Larger intermediate
values have one or two units following the match node head, then followed by the
match node's contents.
+312
View File
@@ -0,0 +1,312 @@
---
layout: default
title: ICU Code Point Tries
parent: Data Structures
grand_parent: Design Docs
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# ICU Code Point Tries
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## Fast lookup in arrays
For fast lookup by code point, we store data in arrays. It costs too much space
to use a single array indexed directly by code points: There are about 1.1M of
them (max 0x10ffff, about 20.1 bits), and about 90% are unassigned or private
use code points. For some uses, there are non-default values only for a few
hundred characters.
We use a form of "trie" adapted to single code points. The bits in the code
point integer are divided into two or more parts. The first part is used as an
array offset, the value there is used as a start offset into another array. The
next code point bit field is used as an additional offset into that array, to
fetch another value. The final part yields the data for the code point.
Non-final arrays are called index arrays or tables.
> See also [ICU String Tries](tries/index.md).
For lookup of arbitrary code points, we need at least three successive arrays,
so that the first index table is not too large.
For all but the first index table, different blocks of code points with the same
values can overlap. A special block contains only default values and is shared
among all blocks of code points that map there.
Block sharing works better, and thus leads to smaller data structures, the
smaller the blocks are, that is, the fewer bits in the code point bit fields
used as intra-block offsets.
On the other hand, shorter bit fields require more bit fields and more
successive arrays and lookups, which adds code size and makes lookups slower.
(Until about 2001, all ICU data structures only handled BMP code points.
"Compact arrays" split 16-bit code points into fields of 9 and 7 bits.)
We tend to make compromises including additional index tables for smaller parts
of the Unicode code space, for simpler, faster lookup there.
For a general-purpose structure, we want to be able to be able to store a unique
value for every character. This determines the number of bits needed in the last
index table. With 136,690 characters assigned in Unicode 10, we need at least 18
bits. We allocate data values in blocks aligned at multiples of 4, and we use
16-bit index words shifted left by 2 bits. This leads to a small loss in how
densely the data table can be used, and how well it can be compacted, but not
nearly as much as if we were using 32-bit index words.
## Character conversion
The ICU conversion code uses several variants of code point tries with data
values of 1, 2, 3, or 4 bytes corresponding to the number of bytes in the output
encoding.
## UTrie
The original "UTrie" structure was developed for Unicode Normalization for all
of Unicode. It was then generalized for collation, character properties, and
eventually almost every Unicode data lookup. Values are 16 or 32 bits wide.
It was designed for fast UTF-16 lookup with a special, complicated structure for
supplementary code points using custom values for lead surrogate units. This
custom data and code made this structure relatively hard to use.
11:5 bits for the BMP and effectively 5:5:5:5 bits for supplementary code points
provide for good compaction. The BMP index table is always 2<sup>11</sup> uint16_t = 4kB.
Small index blocks for the supplementary range are added as needed.
The structure stores different values for lead surrogate code *units* (for fast
moving through UTF-16_ vs. code *points* (for lookup by code point).
The first 256 data table entries are a fixed-size, linear table for Latin-1 (up
to U+00FF).
## UTrie2
The "UTrie2" structure, developed in 2008, was designed to enable fast lookup
from UTF-8 without always having to assemble whole code points and to split them
again into the trie bit fields.
It retains separate lookups for lead surrogate code units vs. code points.
It retains the same 11:5 lookup for BMP code points, for good compaction and
good performance.
There is a special small index for lead bytes of two-byte UTF-8 sequences (up to
U+07FF), for 5:6 lookup. These index values are not shifted left by 2.
Lookup for three-byte UTF-8 uses the BMP index, which is clumsy.
Lookup for supplementary code points is much simpler than with UTrie, without
custom data values or code. Two index tables are used for 9:6:5 code point bits.
The first index table omits the BMP part. The structure stores the a code point
after which every one maps to the default value, and the first index is
truncated to below that.
With the fixed BMP index table and other required structures, an empty UTrie2 is
about 5kB large.
The UTF-8 lookup was also designed for the original handling of ill-formed
UTF-8: The first 192 data table entries are a linear table for ASCII plus the 64
trail bytes, to look up "single" bytes 0..BF without further checking, with
error values for the trail bytes. Lookup of two-byte non-shortest forms (C0
80..C1 BF) also yields error values. These error values became unused in 2017
when ICU 60 changed to handling ill-formed UTF-8 compatible with the W3C
Encoding standard (substituting maximal subparts of valid sequences). C0 and C1
are no longer recognized as lead bytes, requiring full byte sequence validation
separate from the data lookup.
## Ideas
Possible goals: Simpler code, smaller data especially for sparse tries, maybe
faster UTF-8, not much slower UTF-16.
We should try to store only one set of values for surrogates. Unicode property
APIs use only by-code point lookup without special lead surrogate values.
Collation uses special lead surrogate data but does not use code point lookup.
Normalization does both, but the per-code point lookup could test for surrogate
code points first and return trivial values for all of them. UTF-16 string
lookup should map unpaired surrogates to the error value.
We should remove the special data for old handling of ill-formed UTF-8, the
error values for trail bytes and two-byte non-shortest forms.
If we use 6 bits for the last code point bit field, then we can use the same
index table for code point/UTF-16 lookup as well as UTF-8 lookup. Compaction
will be less effective, so data will grow some. This would be somewhat
compensated by the smaller BMP index table.
If we also continue to use 6 bits for the second-to-last table, that is, 8:6:6
bits, then we can simplify the code for three- and four-byte UTF-8.
If we always include the BMP in the first index table, then we can also simplify
enumeration code a bit, and use smaller code for code point lookups where code
size is more important than maximum speed.
Alternatively, we could improve compaction and speed for the BMP by using no
index shift-left for BMP indexes (and keep omitting the BMP part of the first
index table). In order to ensure that BMP data can be indexed directly with
16-bit index values, the builder would probably have to copy at least the BMP
data into a new array for compaction, before adding data for supplementary code
points. When some of the indexes are not shifted, and their data is compacted to
arbitrary offsets, then that data cannot also be addressed with uniform
double-index lookup. We may or may not store unused first-index entries. If not
the whole BMP is indexed differently, then UTF-16 and three-byte UTF-8 lookups
need another code branch. (Size vs. simplicity & speed.)
The more tries we use, the higher the total cost of the size overhead. (For
example, many of the 100 or so collation tailorings carry a UTrie2.) The less
overhead, the more we could use separate tries where we currently combine them
or avoid them. Smaller overhead would make it more attractive to offer a public
code point map structure.
Going to 10:6 bits for the BMP cuts the fixed-size index in half, to 2kB.
We could reduce the fixed-size index table much further by using two-index
lookup for some or most of the BMP, trading off data size for speed and
simplicity. The index must be at least 32 uint16_t's for two-byte UTF-8, for up
to U+07FF including Cyrillic and Arabic. We could experiment with length 64 for
U+0FFF including Indic scripts and Thai, 208 entries for U+33FF (most small
scripts and Kana), or back to 1024 entries for the whole BMP. We could configure
a different value at build time for different services (optimizing for speed vs.
size). If we use the faster lookup for three-byte UTF-8, then the boundaries
should be multiples of 0x1000 (up to U+3FFF instead of U+33FF).
## UCPTrie / CodePointTrie
Added as public API in ICU 63. Developed between the very end of 2017 and
mid-2018.
Based on many of the ideas above and experimentation.
Continued linear data array lookup for ASCII.
No more separate values for lead surrogate code points vs. code units.
* Normalization switched to UCPTrie, working around this: Storing special lead
surrogate values for UTF-16 forward iteration; for code point lookup, the
normalization code checks for lead surrogates and returns an "inert" value
for them; for code point range iteration uses special API that treats lead
surrogates as "inert" as well.
* Otherwise simpler API, easier to explain.
* UTF-16 string lookup maps unpaired surrogates to the error value.
For low-code point lookup, uses 6 bits for the last code point field.
* No more need for special UTF-8 2/3-byte lookup structures.
* Smaller BMP index reduces size overhead.
No more data structures for non-shortest UTF-8 sequences.
"Fast" type uses two-stage lookup for all of the BMP (10:6 bits). "Small" type
uses two-stage lookup only up to U+0FFF to trade off size vs. speed. (fastLimit
U+10000 vs. U+1000)
Continued use of highStart for the start of the last range (ending at U+10FFFF),
and highValue for the value of all of its code points.
For code points between fastLimit and highStart, a four-stage lookup is used
(compared with three stages in UTrie2), with small bit fields (6:5:5:4 bits).
"Fast" type: Only for supplementary code points below highStart, if any. "Small"
type: For all code points below highStart; this means that for U+0000..U+0FFF in
a "small" trie data can be accessed with either the two-stage or the four-stage
lookup (and for ASCII also with linear access).
Experimentation confirmed that larger bit fields, especially for the last one or
two stages, lead to poor compaction of sparse data. 6 bits for the data offset
work well for UTF-8 lookup and are a reasonable compromise for the BMP, but for
the large supplementary area which tends to have more sparse data, using a 4 bit
data offset was useful. The drawback is that then the index blocks get larger
and compact less well. Four-byte UTF-8 lookup (for supplementary
* Started with 8:6:6 bits, but some tries were 30% larger than with UTrie2.
* Went to 10:6:4 bits which saved 12% overall, with only one trie larger than
UTrie2 (by 8%).
* Experimented with a "gap", omitting parts of the index for another range
like highStart for a typically large range of code points with a single
common value. This helped
* Experimented with 10:6:4 vs. 11:5:4 vs. 9:6:5 vs. 10:5:5 bits plus the gap.
\*:4 were smaller than \*:5, but the bit distribution within the index
stages had little effect. 11:5:4 yielded the smallest data, indicating that
small bit fields are useful for index stages as well.
* Replaced the gap with splitting the first index bit field into two, for a
four-stage 6:5:5:4 lookup. Just slightly smaller data than 11:5:4+gap, but
less complicated than checking for the gap and working around it; replaces
gap start/limit reads and comparisons with unconditional index array
accesses. 14% smaller overall than UTrie2.
* Added the "small" type where the two-stage lookup only extends to U+0FFF
(6:6 bits) and the four-stage lookup covers all code points below highStart.
34% smaller overall than UTrie2.
The normalization code also lazy-builds a trie with CanonicalIterator data which
is very sparse even in the BMP. With a "fast" UCPTrie it is significantly larger
than with UTrie2, with a "small" UCPTrie it is significantly smaller. Switched
the code to use a "small" trie because it is less performance-sensitive than the
trie used for normalizing strings.
In order to cover up to 256k data values, UTrie2 always shifts 16-bit data block
start offsets left by 2. UCPTrie abandons this, which simplifies two-stage
lookups slightly and improves compaction (no more granularity of 4 for data
block alignment).
* For a "fast" trie to always reach all BMP data values with 16-bit index
entries, the data array is always accessed via a separate pointer, rather
than UTrie2's sharing of the index array with 16-bit data via offsetting by
the length of the index. This also simplifies code slightly and makes access
uniform for all data value widths.
* There are now at most 64k data values for BMP code points because there is
no separate data for lead surrogates any more. The builder code writes data
blocks in code point order to ensure that low code points have low data
block offsets.
* For supplementary code points, data block offsets may need 18 bits. This is
very unusual but possible. (It currently happens only in the collation root
data with Han radical-stroke order, and in a unit test.)
* UCPTrie uses the high bit of the index-2 entry to indicate that the index-3
block stores 18-bit data block offsets rather than 16-bit ones. (This limits
somewhat the length of the index.) In this case, groups of 8 index-3 entries
(= data block start offsets) share an additional entry that stores the two
high bits of each of the eight entries. More complicated lookup, but almost
never used, and keeps BMP lookups always simple.
* A possible alternative could have used a bit per entry, or per small group
of entries, to indicate that a common data value should be returned for
"unused" parts of a sparse data block. There could have been a common value
per index-3 block, per index-2 block, or for the whole trie, etc. Rejected
as much too complicated.
UTrie2 stores a whole block of 64 error values for UTF-8 non-shortest-form
lookup. UCPTrie does not have this block any more; it stores the error value at
the end of the data array, at dataLength-1.
UTrie2 stores the highValue at dataLength-4. UCPTrie stores it at dataLength-2.
Comparison: [UTrie2 vs.
UCPTrie/CodePointTrie](https://docs.google.com/document/d/e/2PACX-1vTbwdDe2tVJ6pACMpOq7uKW_FgvyyjvPVdgZYsIwSoFJj-27cXR20wAO9qHVoaKOIoo-d8iHnsFOCdc/pub)
Sizes for BreakIterator & Collator tries, UTrie2 vs. UTrie3 experiments: [In
this
spreadsheet](https://docs.google.com/spreadsheets/d/e/2PACX-1vTgL260NFgmbiUAtptKj4fNf9wNm-OJ6Q0TbWzFWvhV7wVZk2Qe-gk2pbJh0pHY9XVsObZ3YaoOnb3I/pubhtml)
see the "nocid" sheet (no CanonicalIterator data).
The last columns on the "nocid" sheet, highlighted in green and blue, correspond
to the final UCPTrie/CodePointTrie. For these tries, the "fast" type (green)
yields 14% smaller data than UTrie2; the "small" type (blue) yields 34% smaller
data.
The simplenormperf sheets show performance comparison data between UTrie2 and
"fast" UCPTrie. There should be little difference for BMP characters; the
numbers are too inconsistent to show a significant difference.
UCPTrie has an option of storing 8-bit values, in addition to 16-bit and 32-bit
values that UTrie2 supports. It would be possible to add 12-bit or 64-bit values
etc. later.
+96
View File
@@ -0,0 +1,96 @@
---
layout: default
title: Profiling ICU4C with callgrind
grand_parent: Setup for Contributors
parent: C++ Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Profiling ICU4C with callgrind
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## Prerequisites
Valgrind, callgrind and kcachegrind together proved performance profiling of C++
code, including annotated source code with time consumption at each line.
Prequisites:
* Linux with the clang compiler.
* Valgrind. If not already installed, from the command line,
* `sudo apt install valgrind`
* kcachegrind. To install:
* `sudo apt install kcachegrind`
Build ICU. An optimized build with debug symbols is generally best for
profiling:
```
cd icu4c/source
./runConfigureICU --enable-debug Linux
make -j6 check
```
## Run test code
Prepare the test code you wish to measure. Valgrind is very slow, so be wary of
long running tests. Because Valgrind tracks every last machine instruction (it's
not a sampling profiler), getting good results does not require a long run.
Run the test code under valgrind with callgrind. The example below runs a test
from intltest, but that is not a requirement; valgrind will profile any
executable. The differences from a normal (non-profile) invocation are
highlighted.
Without the `LD_BIND_NOW=y` the output is polluted by symbol lookups.
```
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH
LD_BIND_NOW=y valgrind --tool=callgrind
--callgrind-out-file=callgrind.out ./intltest
translit/TransliteratorTest/TestAllCodepoints
```
The raw profiling data will be left in a callgrind.out file,
```
ls -l callgrind*
-rw------- 1 aheninger eng 325779 Oct 3 15:51 callgrind.out
```
## View in kcachegrind
Run kcachegrind to view the results.
```
kcachegrind callgrind.out
```
Explore. Lots of interesting data is available.
[kcachegrind docs](https://kcachegrind.github.io/html/Documentation.html)
For the above run, here are the top functions, ordered by cumulative time
(including calls out) spent in each.
![image](kcache-cumulative.png)
Time spent in each function, self time only. `UnicodeSet::add()` is hot.
![image](kcache-flat.png)
Annotated source for `UnicodeSet::add()`
![image](kcache-source.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

@@ -1,3 +1,5 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
{
"configurations": [
{
+125
View File
@@ -0,0 +1,125 @@
---
layout: default
title: C++ Setup
parent: Setup for Contributors
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# C++ Setup
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## C/C++ workspace structure
It is best to keep the source file tree and the build-output files separate
("out-of-source build"). It keeps your source tree clean, and you can build
multiple configurations from the same source tree (e.g., debug build, release
build, build with special flags such as no-using-namespace). You could keep the
source and build trees in parallel folders.
**Important:** If you use runConfigureICU together with CXXFLAGS or similar, the
*custom flags must be before the runConfigureICU invocation*. (So that they
are visible as environment variables in the runConfigureICU shell script, rather
than just options text.) See the sample runConfigureICU invocations below.
See the ICU4C readme's [Recommended Build
Options](https://htmlpreview.github.io/?https://github.com/unicode-org/icu/blob/master/icu4c/readme.html#RecBuild).
For example:
* `~/icu/mine/**src**`
* source tree including icu (ICU4C) & icu4j folders
* setup: mkdir + git clone your fork (see the [Linux Tips
subpage](linux.md)) + cd to here.
* Use `git checkout <branch>` to switch between branches.
* Use `git checkout -b <newbranchname>` to create a new branch and switch
to it.
* After switching branches, remember to update your IDE's view of the
source tree.
* For C++ code, you may want to `make clean` *before* switching to a
different branch.
* `~/icu/mine/icu4c/**bld**`
* release build output
* not-using-namespace is always recommended
* setup: mkdir+cd to here, then something like
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
../../src/icu4c/source/**runConfigureICU** Linux
--prefix=/home/*your_user_name*/icu/mine/inst > config.out 2>&1`
* build: `make -j5 check > out.txt 2>&1`
* `~/icu/mine/icu4c/**dbg**`
* debug build output
* not-using-namespace is always recommended
* setup: mkdir+cd to here, then something like
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
../../src/icu4c/source/**runConfigureICU** --enable-debug
--disable-release Linux --prefix=/home/*your_user_name*/icu/mine/inst >
config.out 2>&1`
* build: make -j5 check > out.txt 2>&1
* Be sure to test with both gcc/g++ and clang/clang++!
`CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
../../src/icu4c/source/runConfigureICU --enable-debug --disable-release
Linux/clang`
* `~/icu/mine/icu4c/**nm_utf8**`
* not-using-namespace and default-hardcoded-UTF-8
* setup: mkdir+cd to here, then something like
`../../src/icu4c/source/**configure**
CXXFLAGS="-DU_USING_ICU_NAMESPACE=0" CPPFLAGS="-DU_CHARSET_IS_UTF8=1
-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
--prefix=/home/*your_user_name*/icu/mine/inst > config.out 2>&1`
* ~/icu/mine/icu4c/static
* gcc with static linking
* setup: mkdir+cd to here, then something like
`../../src/icu4c/source/**configure**
CXXFLAGS="-DU_USING_ICU_NAMESPACE=0"
CPPFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -O2 -ffunction-sections
-fdata-sections" LDFLAGS="-Wl,--gc-sections" --enable-static
--disable-shared --prefix=/home/*your_user_name*/icu/mine/inst >
config.out 2>&1`
* `~/icu/mine/`**`inst`**
* “make install” destination (don’t clobber your platform ICU during
development)
* `~/icu/**msg48**/src`
* Optional: You could have multiple parallel workspaces, each with their
own git clones, to reduce switching a single workspace (and the IDE
looking at it) from one branch to another.
### Run individual test suites
* `cd ~/icu/mine/icu4c/dbg/test/intltest`
* `export LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw`
* `make -j5 && ./intltest utility/ByteTrieTest utility/UCharTrieTest`
* `cd ~/icu/mine/icu4c/dbg/test/cintltst`
* same relative `LD_LIBRARY_PATH` as for intltest
* `make -j5 && ./cintltst`
## gdb pretty-printing
Shane wrote this gdb script in 2017: It pretty-prints UnicodeString in GDB.
Instead of seeing the raw internals of UnicodeString, you will see the length,
storage type, and content of the UnicodeString in your debugger. There are
installation instructions in the top comment on the file (it's a matter of
downloading the file and adding a line to `~/.gdbinit`).
<https://gist.github.com/sffc/7b3826fd67cb78057a9e66f2b350a647>
This also works in anything that wraps GDB, like CLion and Visual Studio Code.
## Linux Tips
For more Linux-specific tips see the [Linux Tips subpage](linux.md).
+178
View File
@@ -0,0 +1,178 @@
---
layout: default
title: C++ Setup on Linux
grand_parent: Setup for Contributors
parent: C++ Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# C++ Setup on Linux
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## Compiler
For ICU4C 50 or newer the `configure` script picks `clang` if it is installed,
or else `gcc`. Clang produces superior error messages and warnings.
Most Linuxes should have clang available to install. On Ubuntu or other
Debian-based systems, install it with
```
sudo apt-get install clang
```
Debug builds must use compiler option `-g` and should not optimize (`-O0` is the
default). A future version of `gcc` might support `-Og` as the recommended
optimization level for debugging.
Release builds can use `-O3` for best performance. See
<http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html>
`clang` might even benefit from `-O4` where "whole program optimization is done
at link time". See
<http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/clang.1.html>
## Other build flags
On a modern Linux you can configure with `CPPFLAGS="-DU_CHARSET_IS_UTF8=1"`.
## Debugging
`gdb` should work with both out-of-source and in-source builds. If not,
double-check with "`make VERBOSE=1`" that both .c and .cpp files are compiled
with `-g` and either `-O0` or no `-O*anything*` at all.
`kdbg` is a reasonable GUI frontend for gdb. It keeps the source code in sync
and updates views of variables & memory etc.
* kdbg versions below 2.5.2 do not work with gdb 7.5; you get a message box
with "GDB: Reading symbols from..."
* As a workaround,
* Create a `~/.gdbinit` file with `set print symbol-loading off`
* Start kdbg, open `Settings/Global options` and remove the `--nx`
argument to gdb.
## Portability Testing
GitHub pull requests are automatically tested on Windows, Linux with both clang
& gcc, and Macintosh. The build results show up as check results on the status
page.
Build errors will block the pull request. It's also useful to check the build
logs for new warnings on platforms other than the one used for development.
## Clang sanitizers
Clang has built-in santizers to check for several classes of problems. Here are
the configure options for building ICU with the address checker:
```
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU
--enable-debug --disable-release Linux/clang --disable-renaming
```
The other available sanitizers are `thread`, `memory` and `undefined` behavior.
At the time of this writing, thread and address run cleanly, the others show
warnings that have not yet been resolved.
## Heap Usage (ICU4C)
HeapTrack is a useful tool for analyzing heap usage of a test program, to check
the total heap activity of a particular function or object creation, for
example. It will show totals by line in the source, and can move up and down the
stack to see more detail.
<https://github.com/KDE/heaptrack>
To install on Linux,
```
sudo apt install heaptrack
sudo apt install heaptrack-gui
```
## Quick Scripts for small test programs
I use the following simple scripts to simplify building and debugging small
stand-alone programs against ICU, without needing to set up makefiles. They
assume a program with a single .cpp file with the same name as the directory in
which it resides.
```
b: build
r: run
d: debug
v: run under valgrind
```
You will probably need to modify them to reflect where you keep your most
commonly used ICU build, and whether you routinely use an out-of-source ICU
build.
```
$ cat \`which b\`
#! /bin/sh
if \[\[ -z "${ICU_HOME}" \]\] ; then
ICU_HOME=$HOME/icu/icu4c
fi
DIR=\`pwd\`
PROG=\`basename $DIR\`
clang++ -g -I $ICU_HOME/source/common -I $ICU_HOME/source/i18n -I
$ICU_HOME/source/io -L$ICU_HOME/source/lib -L$ICU_HOME/source/stubdata -licuuc
-licui18n -licudata -o $PROG $PROG.cpp
$ cat \`which r\`
#! /bin/sh
if \[\[ -z "${ICU_HOME}" \]\] ; then
ICU_HOME=$HOME/icu/icu/icu4c
fi
DIR=\`pwd\`
PROG=\`basename $DIR\`
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
ICU_DATA=$ICU_HOME/source/data/out ./$PROG
cat \`which d\`
#! /bin/sh
if \[\[ -z "${ICU_HOME}" \]\] ; then
ICU_HOME=$HOME/icu/icu/icu4c
fi
DIR=\`pwd\`
PROG=\`basename $DIR\`
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
ICU_DATA=$ICU_HOME/source/data/out gdb ./$PROG
$ cat \`which v\`
#! /bin/sh
if \[\[ -z "${ICU_HOME}" \]\] ; then
ICU_HOME=$HOME/icu/icu/icu4c
fi
DIR=\`pwd\`
PROG=\`basename $DIR\`
LD_LIBRARY_PATH=$ICU_HOME/source/lib:$ICU_HOME/source/stubdata
ICU_DATA=$ICU_HOME/source/data/out valgrind --leak-check=full ./$PROG
```
+41
View File
@@ -0,0 +1,41 @@
---
layout: default
title: Configuring VS Code for ICU4C
grand_parent: Setup for Contributors
parent: C++ Setup
---
<!--- © 2020 and later: Unicode, Inc. and others. --->
<!--- License & terms of use: http://www.unicode.org/copyright.html --->
# Configuring VS Code for ICU4C
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
- Create a `.vscode` folder in icu4c/source
- Copy the [`tasks.json`](tasks.json), [`launch.json`](launch.json) and [`c_cpp_properties.json`](c_cpp_properties.json) files into
the `.vscode` folder.
- To test only specific test targets, specify them under `args` in
`launch.json`.
- To adjust the parallelism when building, adjust the `args` in `tasks.json`.
- `-l20` tells VSCode to not launch jobs if the system load average is above
20 (note that the [system load
average](https://en.wikipedia.org/wiki/Load_(computing)) is *not* a CPU
usage percentage).
- `-j24` limits the number of jobs launched in parallel to 24. The system
load average takes a while to respond, reducing this number helps the
initial bad system performance when a new build is launched.
NOTE:
Run the
[`./runConfigureICU` command](https://unicode-org.github.io/icu/userguide/icufaq)
before building `icu4c` from VSCode.
+14
View File
@@ -0,0 +1,14 @@
---
layout: default
title: Setup for Contributors
nav_order: 10000
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Setup for Contributors
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

+246
View File
@@ -0,0 +1,246 @@
---
layout: default
title: Ant Setup for Java
grand_parent: Setup for Contributors
parent: Java Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Ant Setup for Java
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## Overview
ICU4J source layout was changed after 4.2. There are several ways to set up the
ICU4J development environment.
Get the source code by following the [Quick Start
instruction](http://site.icu-project.org/repository). Go into the icu4j/
directory to see the build.xml file. You can run targets displayed by `ant -p`.
Main targets:
* `all` Build all primary targets
* `apireport` Run API report generator tool
* `apireportOld` Run API report generator tool (Pre Java 5 Style)
* `build-tools` Build build-tool classes
* `charset` Build charset classes
* `charset-tests` Build charset tests
* `charsetCheck` Run only the charset tests
* `check` Run the standard ICU4J test suite
* `checkDeprecated` Check consistency between javadoc @deprecated and @Deprecated annotation
* `checkTest` Run only the specified tests of the specified test class or, if no arguments are given, the standard ICU4J test suite.
* `checktags` Check API tags before release
* `cldrUtil` Build Utilities for CLDR tooling
* `clean` Clean up build outputs
* `collate` Build collation classes
* `collate-tests` Build core tests
* `collateCheck` Run only the collation tests
* `core` Build core classes
* `core-tests` Build core tests
* `coreCheck` Run only the core tests
* `coverageJaCoCo` Run the ICU4J unit tests and generate code coverage report
* `currdata` Build currency data classes
* `demos` Build demo classes
* `docs` Build API documents
* `docsStrict` Build API documents with all doclint check enabled
* `draftAPIs` Run API collector tool and generate draft API report
* `exhaustiveCheck` Run the standard ICU4J test suite in exhaustive mode
* `findbugs` Run FindBugs on all library sub projects.
* `gatherapi` Run API database generator tool
* `gatherapiOld` Run API database generator tool (Pre Java 5 style)
* `icu4jJar` Build ICU4J all-in-one core jar
* `icu4jSrcJar` Build icu4j-src.jar
* `icu4jtestsJar` Build ICU4J all-in-one test jar
* `indicIMEJar` Build indic IME 'icuindicime.jar' jar file
* `info` Display the build environment information
* `init` Initialize the environment for build and test. May require internet access.
* `jar` Build ICU4J runtime library jar files
* `jarDemos` Build ICU4J demo jar file
* `jdktzCheck` Run the standard ICU4J test suite with JDK TimeZone
* `langdata` Build language data classes
* `localespi` Build Locale SPI classes
* `localespi-tests` Build Locale SPI tests
* `localespiCheck` Run the ICU4J Locale SPI test suite
* `main` Build ICU4J runtime library classes
* `packaging-tests` Build packaging tests
* `packagingCheck` Run packaging tests
* `perf-tests` Build performance test classes
* `regiondata` Build region data classes
* `release` Build all ICU4J release files for distribution
* `releaseBinaries` Build ICU4J binary files for distribution
* `releaseCLDR` Build release files for CLDR tooling
* `releaseDocs` Build ICU4J API reference doc jar file for distribution
* `releaseSourceArchiveTgz` Build ICU4J source release archive (.tgz)
* `releaseSourceArchiveZip` Build ICU4J source release archive (.zip)
* `releaseSrcJars` Build ICU4J src jar files for distribution
* `releaseVer` Build all ICU4J release files for distribution with versioned file names
* `runTest` Run the standard ICU4J test suite without calling any other build targets
* `samples` Build sample classes
* `secure` (Deprecated)Build ICU4J API and test classes for running the ICU4J test suite with Java security manager enabled
* `secureCheck` Run the secure (applet-like) ICU4J test suite
* `test-framework` Build test framework classes
* `tests` Build ICU4J test classes
* `timeZoneCheck` Run the complete test for TimeZoneRoundTripAll
* `tools` Build tool classes
* `translit` Build translit classes
* `translit-tests` Build translit tests
* `translitCheck` Run the ICU4J Translit test suite
* `translitIMEJar` Build transliterator IME 'icutransime.jar' jar file
* `xliff` Build xliff converter tool
Default target: main
The typical usage is `ant check`, which will build main ICU4J libraries and
run the standard unit test suite.
For running ant you may need to set up some environment variables first. For
example, on Windows:
```
set ANT_HOME=C:\\ant\\apache-ant-1.7.1
set JAVA_HOME=C:\\Program Files\\Java\\jdk1.5.0_07
set PATH=%JAVA_HOME%\\bin;%ANT_HOME%\\bin;%PATH%
```
## Test arguments and running just one test or the tests of just one test class
You can pass arguments to the test system by using the 'testclass' and
'testnames' variables and the 'checkTest' target. For example:
|Command Line|Meaning|
|------------|--------|
|`ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript'` | Runs all the tests in test class 'TestUScript'.|
|`ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript' -Dtestnames='TestNewCode,TestHasScript'` | Runs the tests `TestNewCode` and `TestHasScript` in test class `TestUScript`. |
|`ant checkTest -Dtestnames='TestNewCode,TestHasScript'` | Error: test class not specified.|
|`ant checkTest` | Runs the standard ICU4J test suite (same as 'ant check').|
The JUnit-generated test result reports are in out/junit-results/checkTest. Go
into the `html/` subdirectory and load `index.html` into a browser.
## Generating Test Code Coverage Report
[#10513](http://bugs.icu-project.org/trac/ticket/10513) added code coverage
target "coverageJaCoCo" in the ICU4J ant build.xml. To run the target:
1. Download JaCoCo library from [EclEmma
site](http://eclemma.org/jacoco/index.html).
2. Extract library files to your local system - e.g. `C:\jacoco-0.7.6`
3. Set environment variable JACOCO_DIR pointing to the directory where JaCoCo
files are extracted - e.g. `set JACOCO_DIR=C:\jacoco-0.7.6`
4. Set up ICU4J ant build environment.
5. Run the ant target "coverageJaCoCo" in the top-level ICU4J build.xml
Following output report files will be generated in /out/jacoco directory.
* report.csv
* report.xml
* report_html.zip
## Building ICU4J API Reference Document with JCite
Since ICU4J 49M2, JCite (Java Source Code Citation System) is integrated into
ICU4J documentation build. To build the API documentation for public release,
you must use JCite for embedding some coding examples in the API documentation.
To set up the environment:
1. <http://arrenbrecht.ch/jcite/>Download JCite binary (you need 1.13.0+ for JDK 7 support) from
* Note that JCite no longer is available for download from the official
web site, which links to Google Code, which was closed down in 2016.
* The Internet Archive has a copy of the last version of JCite found on
Google Code before it was closed down:
[jcite-1.13.0-bin.zip](https://web.archive.org/web/20160710183051/http://jcite.googlecode.com/files/jcite-1.13.0-bin.zip)
2. Extract JCite file to your local system - e.g. `C:\jcite-1.13.0`
3. Set environment variable `JCITE_DIR` pointing to the directory where JCite
files are extracted. - e.g. `set JCITE_DIR=C:\jcite-1.13.0`
4. Set up ICU4J ant build environment.
5. Run the ant target "docs" in the top-level ICU4J build.xml
6. If the build (on Linux) fails because package com.sun.javadoc is not found
then set the JAVA_HOME environment variable to point to `<path>/java/jdk`. The
Javadoc package is in `<path>/java/jdk/lib/tools.jar`.
*Note: The ant target "docs" checks if `JCITE_DIR` is defined or not. If not
defined, it will build ICU4J API docs without JCite. In this case, JCite taglet
"{@.jcite ....}" won't be resolved and the embedded tag is left unchanged in the
output files.*
## Build and test ICU4J Eclipse Plugin
Building Eclipse ICU4J plugin
1. Download and install the latest Eclipse release from
<http://www.eclipse.org/> (The latest stable milestone is desired, but the
latest official release should be OK).
2. cd to `<icu4j root>` directory, and make sure `$ ant releaseVer` runs clean.
3. cd to` <icu4j root>/eclipse-build` directory.
4. Copy `build-local.properties.template` to `build-local.properties`, edit the
properties files
* eclipse.home pointing to the directory where the latest Eclipse version
is installed (the directory contains configuration, dropins, features,
p2 and others)
* java.rt - see the explanation in the properties file
5. Run the default ant target - $ ant The output ICU4J plugin jar file is
included in `<icu4j
root>/eclipse-build/out/projects/ICU4J.com.ibm.icu/com.ibm.icu-com.ibm.icu.zip`
Plugin integration test
1. Backup Eclipse installation (if you want to keep it - just copy the entire
Eclipse installation folder)
2. Delete ICU4J plugin included in Eclipse installation -
`<eclipse>/plugins/com.ibm.icu_XX.Y.Z.vYYYYMMDD-HHMM.jar` XX.YY.Z is the ICU
version, and YYYYMMDD-HHMM is build date. For example,
com.ibm.icu_58.2.0.v20170418-1837.jar
3. Copy the new ICU4J plugin jar file built by previous steps (e.g.
com.ibm.icu_61.1.0.v20180502.jar) to the same folder.
4. Search a text "`com.ibm.icu"` in files under `<eclipse>/features`. The RCP
feature has a dependency on the ICU plugin and its `feature.xml` (e.g.
`<eclipse>/features/org.eclipse.e4.rcp_1.6.2.v20171129-0543/feature.xml`)
contains the dependent plugin information. Replace just version attribute to
match the version built by above steps. You can leave size attributes
unchanged. The current ICU build script does not append hour/minute in
plugin jar file, so the version format is XX.Y.Z.vYYYYMMDD.
` <plugin`
` id="com.ibm.icu"`
` download-size="11775"`
` install-size="26242"`
` version="58.2.0.v20170418-1837" -> "61.1.0.v20180502" `
` unpack="false"/>`
5. Open
`<eclipse>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info`
in a text editor, and update the line including com.ibm.icu plugin
information.
```
com.ibm.icu,58.2.0.v20170418-1837,plugins/com.ibm.icu_58.2.0.v20170418-1837.jar,4,false
```
then becomes ->
```
com.ibm.icu,**61.1.0.v20190502**,plugins/com.ibm.icu_**61.1.0.v20190502**.jar,4,false
```
6. Make sure Eclipse can successfully starts with no errors. If ICU4J plug-in
is not successfully loaded, Eclipse IDE won't start.
ICU4J plugin test - Note: This is currently broken
<http://bugs.icu-project.org/trac/ticket/13072>
1. Start the Eclipse (with new ICU4J plugin), and create a new workspace.
2. Import existing Eclipse project from `<icu4jroot>/eclipse-build/out/projects/com.ibm.icu.tests`
3. Run the project as JUnit Plug-in Test.
## Building ICU4J Release Files
See [Release Build](../../../processes/release/tasks/release-build.md)
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,290 @@
---
layout: default
title: Eclipse Setup for Java Developers
grand_parent: Setup for Contributors
parent: Java Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Eclipse Setup for Java Developers Using Ant
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
ICU4J source layout was changed after 4.2. There are several ways to set up the ICU4J development environment.
*If you want to use Eclipse, you should create a new clean workspace first.*
## Java Language Level
Eclipse typically requires a newer Java version than what we can depend on for
ICU4J. If you don't do the following, you run the risk of calling Java library
APIs that are newer than ICU4J's Java version, and you cause runtime exceptions
for people who use the older version.
Currently (as of 2023-sep / ICU 73), ICU4J is on Java 8 (and Eclipse 4.28/2023-06
requires Java 17).
(Note: localespi/localespi-tests may use a different Java version from ICU4J
proper.)
1. Check if you already have an older JRE or a JDK for the minimum version
required for ICU4J.
* A JRE (runtime environment, no compiler) is sufficient.
* If you don't have one yet, then install one (OpenJDK or Oracle).
2. Select \[Window\] - \[Preferences\] *(On Mac, this is \[Eclipse -
Preferences\])*
3. Navigate the preferences tree to Java/Installed JREs/Execution Environments
4. On the left, Execution Enviornments: Select J2SE-1.8
5. On the right, Compatible JREs, if there is no old-version Java 8 JRE:
1. Go up one tree level to Java/Installed JREs.
2. Click "Add..." and select "Standard VM" as JRE type.
3. Click "Directory..." and find the location of your old-version JRE (or
JDK) on your system
* Linux tip: When you install an OpenJDK, look for it in /usr/lib/jvm/
4. You can leave the detected settings as is - Click "Finish", then Click
"OK" in Installed JREs (or "Apply" the modified settings as you navigate
away from here).
5. Go back down in the tree to Java/Installed JREs/Execution Environments.
6. On the right, Compatible JREs, you should now see your old-version JRE
6. The matching-old-version JRE should have a "\[perfect match\]" suffix.
Select it for "JavaSE-1.8" on the left.
## Other Settings
1. ~~Turn on warnings about resource leaks. Preferences>Java>Compiler>Errors/Warnings>\[filter on leak\], set both "Resource leak" and "Potential resource leak" to "Warning".~~
(ICU project files were updated to include these settings, so this has no
effects 2015-03-11)
## Import ICU4J from the file system
(Recommended)
In <icu workspace root>/icu4j remember to run "ant init" first. You might run
"ant check" as well for good measure.
If you check out ICU4J source from the repository using an external client
(usually command-line git clone), the new instruction is not much different. You
just follow the steps below -
1. File/Import...
2. Select General/Existing Projects into Workspace
3. Select root directory: Browse to <icu svn workspace root>/icu4j, which will
show a number of projects.
4. Deselect the following projects (i.e., do not import them). These are not
needed for normal ICU development (and would require installing further
prerequisite libraries to get them to build).
* com.ibm.\* (Eclipse plug-in)
* icu4j-localespi\* (more plug-in)
* icu4j-build-tools
* icu4j-packaging-tests
5. Click Finish.
6. Wait for Eclipse to build the projects.
## Obsolete: Import ICU4J using the [Subversive](http://www.eclipse.org/subversive/) SVN plugin
Subversive is the standard SVN plugin for Eclipse 3.4+. If you have
[subversive](http://www.eclipse.org/subversive/) installed/configured on your
Eclipse environment, you can directly check out these 8 projects from the SVN
repository directory. (It looks this does not work well with
"[subclipse](http://www.eclipse.org/subversive/)")
#### Installing Subversive (Eclipse 3.6 or later)
1. Select \[Help\] - \[Install New Software...\] from menu
2. Select the appropriate Eclipse update site in "Work with:" field - for
example, select "Indigo - http://download.eclipse.org/releases/indigo" for
Eclipse 3.7.x and hit enter key.
3. Expand "Collaboration" and check "Subversive SVN Team Provider
(Incubation)", then click "Next >". Confirm the item selected in the next
screen, then click "Next >" again, then accept license terms in the next
screen and click "Finish". After the installation, click "Restart Now" to
restart Eclipse.
4. Select \[Window\] - \[Preferences\] to open Preferences. Expand Team on the
left pane and click SVN. It will open "Subversive Connector Discovery".
Select one from the list. **Note: Some people (including myself) are
experiencing a problem with SVNKit 1.3.5. If you want to use SVNKit, use
1.3.3 instead (2011-10-24 yoshito)** Restart Eclipse.
### Installing Subversive (Old)
1. Goto <http://www.eclipse.org/subversive/downloads.php>
2. Goto "latest release" on that page
3. Copy the update site, eg
"<http://download.eclipse.org/technology/subversive/0.7/update-site/> "
4. Go to Eclipse, then Help > Install New Software...
5. Into "Work with...", paste the update site.
6. Set the checkbox on Plug-ins. Hit Next and Finish until you are done.
Restart Eclipse.
7. Start Eclipse. It will ask for the connectors. Select all the SVN kits and
install. Restart Eclipse.
### Importing ICU4J
1. File - Import
2. Select "Project from SVN" under "SVN", Next
3. In the General Tab, set URL to:
svn+ssh://source.icu-project.org/repos/icu/icu4j, and set your User name:
XXXXXX
4. In the SSH Settings, fill-in proper authentication information. (port 922,
your ssh key (eg icu-project-key) and passphrase..)
5. If the connection is properly established, it opens next dialog "Select
Resource". Set URL to be:
svn+ssh://source.icu-project.org/repos/icu/icu4j/trunk/main - then click
Finish
6. The next dialog "Check Out As" should have 4 options indicating how to check
out. Select the second option "Find projects in the children of the selected
resource" - click Finish
7. It takes a while to locate projects. The next dialog shows a batch of
projects -
1. You may want to deselect localespi and localespi-tests.
2. Click Finish (that means, "Check out as a projects into workspace" is
selected)
8. After these projects are imported into the workspace, open Java perspective.
You might notice there are modification marker (">") displayed for the
projects. This is caused by build output directory created in each project's
workspace. To resolve this issue, you can go to Window - Preferences, then
select Team - Ignore Resources, then Add Pattern "out" (which is build
output directory used by these projects). You may need to restart Eclipse
after adding the new pattern.
**Note:** With the instruction above, you may see Eclipse errors when you open
ant build.xml in each project, such as "Target @build-all does not exist in this
project". This is because the import operation above flatten the original SVN
directory structure and files referenced via ${share.dir} does not work well. To
resolve the issue, you need to override the property by importing
locations-eclipse.properties globally. See the following steps to configure the
override.
1. From Eclipse menu, select \[Window\] - \[Preferences\]
2. Select "Ant" - "Runtime" on the left in the Preferences dialog
3. Open "Properties" tab
4. Under "Global property files", click "Add Files..."
5. Select icu4j-shared project in the list, then select
build/locations-eclipse.properties
6. Click OK - OK, to save the configuration.
## Another method using Eclipse SVN plugin (Subversive and Subclipse)
1. File - New - Other... then, select "Repository Location" under "SVN"
1. General Tab
1. URL - svn+ssh://source.icu-project.org/repos/icu/icu4j
2. User name: <yourname>
3. Password: <leave empty>
2. SSH Settings
1. Port: 922
2. Private key: <browse to your ssh private key>
3. Passphrase: <your passphrase>
3. Finish
2. Open SVN Repositories perspective (Window>Open Perspective>SVN Repository
Exploring) and expand the repository location you added above.
3. Navigate to trunk
4. Right click and select "Check Out" - this may take a few minutes.
5. File - Import and select "Existing Projects into Workspace" under "General"
6. Select root directory - navigate to "main" directory under your workspace
location where the source files were checked out (for example,
C:\\eclipse_ws\\icu4j\\trunk\\main)
7. You should see 10 projects including icu4j-charset, icu4j-charset-tests,
icu4j-core.... (number of projects might be changed in future)
1. All of them should be selected
2. **Important**: unclick "copy projects into Workspace"
3. Click Finish to import all
8. Back in the Java perspective, you should see the new projects.
9. For this time, projects are associated with SVN workspace. If you see the
modification marker (">") displayed for the projects, configure your
workspace to ignore pattern "out" (See step 7 in b-2 above).
10. From the command line, run "ant init" in the top level "main" (for example,
C:\\eclipse_ws\\icu4j\\trunk\\main)
## Testing & Debugging
### Run All Tests
To run all of the main tests, do the following:
**58 or later**
* "ant check" from the command line?
**53-57**
* Select icu4j-testall project in package explorer
* Right Click > Run As > Java Application
**52 or before**
* In icu4j-test-testframework, open com.ibm.icu.dev.test.TestAll
* RightClick>Run As>Java Application...
* It will fail, but create a Run Configuration
* RightClick>Run Configuration...
* Change the name to "TestAll - ICU4J"
* Click on Arguments, and set to "-n -t"
* Click on Classpath>User Entries>Add Projects...
* Select all of your ICU projects but **except icu4j-localespi and
icu4j-localespi-test**, and Add, eg:
* icu4j-charset
* icu4j-charset-tests
* ...
* Now Run.
### Run specific tests
#### 58 or later
* Right click on a test package (for example `com.ibm.icu.dev.test.rbbi` in
the **icu4j-core-tests** project), or an entire test source directory (such
as src in the **icu4j-core-tests** project) and choose **Run As->JUnit
Test**
* For test coverage, install EclEmma (below) and use **Coverage As** instead
of **Run As**.
### Test in Eclipse with ICU4J from jar files
You can manually create an Eclipse Run Configuration that doesn't include any of
the directories but all of the JAR files:
<http://stackoverflow.com/questions/1732259/eclipse-how-to-debug-a-java-program-as-a-jar-file>
### Test Coverage (53 or later)
* Install EclEmma plug-in. The installation instruction is found in [the
EclEmma site page](http://www.eclemma.org/installation.html).
* Run all tests once as described in the above section once.
* For the menu, select "Run" > "Coverage..." to open "Coverage Configurations"
window.
* Go to "Coverage" tab and uncheck all test projects (icu4j-\*-tests,
icu4j-test-framework, icu4j-testall) to exclude test codes from coverage
analysis.
* Click "Coverage" to run the all tests with coverage analysis enabled. After
the text execution, coverage report displayed in "Coverage" view.
* After running coverage, source lines are highlighted in different colors
depending on coverage level. Too remove the highlights, click "Remove All
Sessions" icon below (which also delete the coverage results).
![image](Capture.png)
* If you want to run coverage again, you can just right click on icu4j-testall
project and select "Coverage As" > "Java Application"
## Branching
* // Needs review
To Create the Branch
* Modify
* To merge, use Team>Merge. Pick Start from Copy.
To Merge a Branch
* ...
+15
View File
@@ -0,0 +1,15 @@
---
layout: default
title: Java Setup
parent: Setup for Contributors
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Java Setup
@@ -0,0 +1,39 @@
---
layout: default
title: Java Profiling and Monitoring tools
grand_parent: Setup for Contributors
parent: Java Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Java Profiling and Monitoring tools
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
There are many Java development tools available for analyzing Java application
run time performance. Eclipse has a set of plug-ins called TPTP which provides
Java application profiling/monitoring framework. However, TPTP is very slow and
I experienced frequent crash while profiling ICU4J codes. For ICU4J development,
I recommend several tools described below.
## VisualVM
VisualVM is available as a separate download since JDK 9. You can download the latest
version from here - <https://visualvm.github.io/download.html>
There is an Eclipse plug-in, which allow you to launch VisualVM when you run a
Java app on Eclipse. You can monitor CPU usage of the Java app, Memory usage
(heap/permgen), classes loaded, etc in GUI. You can also get basic profiling
information, such as CPU usage by class, memory allocations and generate heap
dump, force GC etc.
+267
View File
@@ -0,0 +1,267 @@
---
layout: default
title: Maven Setup for Java
grand_parent: Setup for Contributors
parent: Java Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Maven Setup for Java
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
Maven is a standard build tool in the Java ecosystem with a very well-defined
preferred way to organize the directory structure and execute builds.
Thus, many IDEs for Java will have some level of support for Maven.
The command line invocation is still, of course, the standard of truth for the build.
## Installation
Install Maven from your OS package manager.
The minimum version is 3.2.5 as of ICU 74,
although this may change.
See the `<ICU>/icu4j/pom.xml` root POM file's maven-enforcer-plugin
for the current minimum version.
The Maven page lists [system requirements](https://maven.apache.org/download.cgi),
which includes a minimum of JDK 8 as of ICU 74.
## Maven multi-module projects
ICU4J's codebase is structured as a "multi-module" Maven project.
In other words, the Maven project is divided into submodules that have dependencies on each other.
Multi-module projects are not uncommon in Maven over the several years,
yet the support for them by Maven is not complete.
Commonly-found instructions to use Maven at the command line
are usually designed for simple "single-module" Maven projects.
In such cases, the command names correspond intuitively to their function:
`mvn test` for running unit tests, `mvn package` for creating jar files, etc.
However, multi-module projects have the tradeoff between time and complexity:
running `mvn test` at the root recompiles all the sources
even if a module's sources are all unchanged,
which takes longer than it otherwise could.
The alternative is to always instruct Maven to compile and locally cache the artifact
for each submodule,
which speeds up tasks by avoiding duplicate compilation and testing effort,
but also changes the distinct Maven commands
`mvn {test, integration-test, ...}`
all into
`mvn install`
that are instead differentiated by appropriate options.
The instructions in this page for command line usage will choose,
from the 2 alternatives above,
the option that consistently uses `mvn install` for all Maven tasks.
Note that this choice should not affect IDEs with well working native Maven support like IntelliJ and Eclipse.
See the "IDE Setup" section for more details on how IDEs handle Maven projects differently than
the standard command line style usage of Maven.
## IDE Setup
Users of IDEs should familiarize themselves with the information about how to use Maven at
the command line,
which also includes information about Maven builds.
> :point_right: **Note**: In most IDEs, whenever the Maven configurations change (`pom.xml` files),
you will need to refresh your IDE project using the IDE's Maven plugin/functionality.
Most IDEs represent user settings for different codebases via an IDE-specific notion
usually called "project" or "workspace".
The IDE's project/workspace is a separate construct from the Maven configurations for the codebase.
Therefore, creating a new project for an existing codebase is done by "importing" the codebase,
in which the IDE creates the project/workspace settings files.
If you pull updates to the upstream ICU codebase codebase that result in changes to Maven settings,
then the IDE behavior may be behind until you update your IDE project accordingly.
### IntelliJ
IntelliJ does a good job of understanding multi-module Maven projects,
including the non-standard configuration here.
It also recognizes the customized locations of source code files and test code files in the configuration here.
To import into IntelliJ:
1. In IntelliJ, open a new project.
a. Recent versions of IntelliJ provide a dialog box on startup to select a project. Click the "Open" button.)
2. Select the root `pom.xml` in ICU4J (ex: `<ICU>/icu4j/pom.xml`)
3. That's it. Note: IntelliJ will take a few minutes to do a one-time indexing of the new source code.
Navigating the source code files between main code and test code, and running tests individually or for an entire module,
work as they do normally in IntelliJ.
> :point_right: **Note**: Currently, Maven cannot build the entire project due to settings for `tools/utilities-for-cldr`. To work around this so that `Build > Build Project` works: in the "Project" toolbar, navigate to the `tools/utilities-for-cldr` folder, right click for the contextual menu, then `Maven > Ignore Projects`.
>
> When this workaround is no longer needed, the project can be reenabled by: `View > Tool Windows > Maven`, then expand "International Components for Unicode (ICU)", right click on `utilities-for-cldr`, then select `Unignore Projects`.
### Eclipse
[Eclipse's Maven plugin](https://eclipse.dev/m2e/)
works reasonably well and can support the import of a multi-module Maven project.
These instructions have not yet verified Eclipse's handling of the import of the ICU4J using a Maven build.
### VS Code
VS Code's support of Maven projects is not as robust as IntelliJ's when it comes to the non-standard file layout for sources and tests.
The Maven support comes from the standard Java extension (which depends on the standard Maven extension) from the extension marketplace.
Source and test code files are not recognized properly, and it is not clear how to execute the tests.
However, a workaround exists for those who want to use VS Code as their preferred editor and still execute commands to recompile or run tests.
The workaround relies on invoking the Maven commands in a shell, and using a VS Code extension to create shortcuts within the IDE to invoke those commands.
The extension is [Command Runner](https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner).
Next, create a VS Code workspace (File > Open Folder...) at the ICU4J root at `<ICU>/icu4j`.
Then edit your settings for your VS Code workspace for ICU4J (this is the file at `<ICU>/icu4j/.vscode/settings.json`)
by adding this section to the settings:
```jsonnet
{
//...
"command-runner.commands": {
// The following commands assume your VS Code workspace is rooted at `<ICU_ROOT>/icu4j`. If not,
// then adjust accordingly.
"core > all > test": "cd ${workspaceFolder}; mvn -am -pl main/core install",
"core > number > test": "cd ${workspaceFolder}; mvn -am -pl main/core test -Dtest=\"com/ibm/icu/dev/test/number/*,com/ibm/icu/dev/impl/number/*\" -Dsurefire.failIfNoSpecifiedTests=false",
"core > text > test": "cd ${workspaceFolder}; mvn -am -pl main/core test -Dtest=\"com.ibm.icu.dev.test.text.*\" -Dsurefire.failIfNoSpecifiedTests=false",
"charset > test": "cd ${workspaceFolder}; mvn -am -pl main/charset test",
"common_tests > integration test": "cd ${workspaceFolder}; mvn -am -pl main/localespi test",
}
//...
}
```
As the extension's documentation describes, there are multiple ways to open up the palette of command shortcuts.
One way is to hit Ctrl/Cmd+Shift+P, then type "Run Command", then hit enter.
Another way is to right-click the background of any editor pane.
After the palette appears, you can choose which Maven build target to execute.
## Usage at the command line
Maven divides its concept of a build into a "lifecycle" of a linear sequence of steps, called "phases".
These phases correspond to common good practice tasks of a project, and they have a predefined order.
Each phase can only begin if all of the previous phases have finished successfully.
The sequence of phases include ... `compile` ... `test` ... `package` ... `integration-test` ... `verify` ... `install` ... `deploy`.
In a simple Maven project, the phases also serve as default build targets.
However, as mentioned above,
ICU4J is structured as a multi-module Maven project.
The instructions here for command line Maven usage will take the approach of using the `install` target
for all tasks.
Options can be used to control whether tests are executed, and which ones.
### Testing
To only execute a command within a submodule of the project, from the root, use the `-am -pl <projectlist>` syntax like this:
```
mvn install -am -pl main/core
```
where `<projectlist>` is a comma-separated list of names of the subfolders which contain the submodule configuration pom.xml files.
If you want to run only a specific test(s), use the `-Dtest="<test>"` option, where `<test>` can be a test name, a class name / package prefix, or a comma-separate list of them.
#### Run unit tests
The `test` target will only run unit tests (excludes integration tests). Ex:
```
mvn install -am -pl main/core -DskipITs
```
#### Run all tests (integration and unit tests)
All tests (unit tests and integration tests) will run by default.
```
mvn install -am -pl main/core
```
#### Run a single test
```
mvn install -Dtest="ULocaleTest" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
```
or
```
mvn install -Dtest="com.ibm.icu.dev.test.util.ULocaleTest" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
```
#### Run a single method in a single test
```
mvn install -Dtest="ULocaleTest#TestGetAvailableByType" -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
```
#### Run multiple tests
You can use regular expression patterns and comma-separate lists,
such as:
```
mvn install -Dtest="RBBI*" -Dsurefire.failIfNoSpecifiedTests=false
mvn install -Dtest="*Locale*" -Dsurefire.failIfNoSpecifiedTests=false
```
or
```
mvn install -Dtest="*Locale*,RBBI*" -Dsurefire.failIfNoSpecifiedTests=false
```
If you want to run tests according to the package structure of the classes,
then you should use the filesystem notation for the test files in the regular expression expansion.
Therefore, this syntax will not work:
`mvn install -Dtest="com.ibm.icu.dev.test.util.*" -Dsurefire.failIfNoSpecifiedTests=false`.
Instead, you want to use this syntax:
```
mvn install -Dtest="com/ibm/icu/dev/test/util/*" -Dsurefire.failIfNoSpecifiedTests=false
```
#### Run in exhaustive mode
Some tests in ICU are configured to run only when "exhaustive mode" is enabled.
Exhaustive mode enables long running tests that would otherwise not run,
or would run far fewer iterations.
Exhaustive mode is configured through the system property `ICU.exhaustive`.
`ICU.exhaustive` takes an integer value from 0 to 10 such that,
when greater than 5,
will trigger some tests to run in exhaustive mode.
See `TestFmwk.java` for more details,
and `ExhaustiveNumberTest.java` for an example of a test using it.
```
mvn install -DICU.exhaustive=10
```
#### Skip tests
If you want to skip tests, add the options:
```
-DskipTests -DskipITs
```
The first option specifies skipping unit tests,
and the second option specifies skipping integration tests.
## More info on Maven
To learn more about the details of Maven not covered above,
start by reading the [*Maven by Example* book](https://books.sonatype.com/mvnex-book/reference/index.html),
which gives an overview of Maven.
For more details on a specific topic,
refer to the [*Maven: Complete Reference* book](https://books.sonatype.com/mvnref-book/reference/index.html).
+87
View File
@@ -0,0 +1,87 @@
---
layout: default
title: Local tooling configs for git and Github
grand_parent: Setup for Contributors
parent: Source Code Setup
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Local tooling configs for git and Github
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## git difftool & mergetool
The `git diff` command prints changes to stdout, normally to the terminal
screen.
Set up a visual diff and merge program for use with `git difftool` and `git
mergetool`.
Changes in binary files do not show well in common diff tools and can take a
long time for them to compute visual diffs.
This is easily avoided using the -d option: `git difftool -d`
This shows all changed files in the diff program, and you can view and skip
files there as appropriate.
### Linux example
[stackoverflow/.../setting-up-and-using-meld-as-your-git-difftool-and-mergetool](https://stackoverflow.com/questions/34119866/setting-up-and-using-meld-as-your-git-difftool-and-mergetool)
#### Linux meld
`gedit ~/.gitconfig` →
```
[diff]
    tool = meld
[difftool]
    prompt = false
[difftool "meld"]
    cmd = meld "$LOCAL" "$REMOTE"
[merge]
    tool = meld
[mergetool "meld"]
    cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
```
## Auto-link from GitHub to Jira tickets
GitHub itself does not linkify text like "ICU-23456" to point to the Jira
ticket. You can get links via browser extensions.
### Chrome Jira HotLinker
Install the [Jira
HotLinker](https://chrome.google.com/webstore/detail/jira-hotlinker/lbifpcpomdegljfpfhgfcjdabbeallhk)
from the Chrome Web Store.
Configuration Options:
* Jira instance url: https://unicode-org.atlassian.net/
* Locations: https://github.com/
### Safari extension from SRL
<https://github.com/unicode-org/icu-jira-safari>
### Firefox extension from JefGen
Install from the Mozilla Firefox Add-ons site:
<https://addons.mozilla.org/en-US/firefox/addon/github-jira-issue-linkifier/>
Source:
<https://github.com/jefgen/github-jira-linkifier-webextension>
+161
View File
@@ -0,0 +1,161 @@
---
layout: default
title: Source Code Setup
parent: Setup for Contributors
has_children: true
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Source Code Setup
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
> Announcement 07/16/2018: The ICU source code repository has been migrated from
> Subversion to Git, and is now hosted on GitHub.
## Quick Start
You can view ICU source code online: <https://github.com/unicode-org/icu>
***Make sure you have git lfs installed.*** See the following section.
For read-only usage, create a local clone:
```
git clone https://github.com/unicode-org/icu.git
```
or
```
git clone git@github.com:unicode-org/icu.git
```
This will check out a new directory `icu` which contains **icu4c** and
**icu4j** subdirectories as detailed below.
*For ICU development*, do *not* work directly with the Unicode ICU `main` branch!
See the [git for ICU Developers](../../userguide/dev/gitdev) page instead.
For cloning from your own fork, replace `unicode-org` with your GitHub user
name.
**For fetching just the files for an ICU release tag**, you can use a shallow
clone:
```
git clone https://github.com/unicode-org/icu.git --depth=1 --branch=release-63-1
```
If you already have a clone of the ICU repository, you can add and extract
release files like this:
```
mkdir /tmp/extracted-icu  # or wherever you want to extract to
cd  local-git-repo-top-level-dir
git fetch upstream
git tag --list "*63*"  # List tags relevant to ICU 63, e.g., release-63-1
git archive release-63-1 | tar -x -C /tmp/extracted-icu
```
## Detailed Instructions
### Prerequisites: Git and Git LFS
(Note: you do not need a [GitHub](http://github.com) *account* to download the
ICU source code. However, you might want such an account to be able to
contribute to ICU.)
* Install a **git client**
* <https://git-scm.com/downloads>
* Linux: `sudo apt install git`
* Install **git-lfs** if your git client does not already have LFS support
(ICU uses git Large File Storage to store large binary content such as
\*.jar files.)
* <https://git-lfs.github.com/>
* See also
<https://help.github.com/articles/installing-git-large-file-storage/>
* Linux: `sudo apt install git-lfs`
* MacOS: Consider using Homebrew or MacPorts.
* The command `git lfs version` will indicate if LFS is installed.
* Setup git LFS for your local user account once on each machine:
* `git lfs install --skip-repo`
### Working with git
There are many resources available to help you work with git, here are a few:
* <https://git-scm.com/> - the homepage of the git project
* <https://help.github.com/> - GitHub’s help page
* <https://try.github.io/> - Resources to learn Git
Want to contribute back to ICU? See
[How to contribute](../../userguide/processes/contribute.md).
## Repository Layout
The top level
[README.md](https://github.com/unicode-org/icu#international-components-for-unicode)
contains the latest information about the repository’s layout. Currently:
* **icu4c**/ ICU for C/C++
* **icu4j**/ ICU for Java
* **tools**/ Tools
* **vendor**/ Vendor dependencies (copied here for reference)
### Tags and Branches
The repository is **tagged** with different release versions of ICU.
For example,
[release-55-1](https://github.com/unicode-org/icu/tree/release-55-1) is the tag
which corresponds to version 55.1 of ICU (for both C and J).
Branches in the main fork are used for maintenance branches of ICU.
For example,
[maint/maint-61](https://github.com/unicode-org/icu/tree/maint/maint-61) is a
branch containing the latest maintenance work on the 61.x line of ICU.
There are other tags and branches which may be cleaned up/deleted at any time.
* branches/tags/releases from [before the icu4c and icu4j trees were
merged](https://unicode-org.atlassian.net/browse/ICU-12800) - items prefixed
with "icu-" are for icu4c, and "icu4j-" for icu4j, etc.
* old personal work branches (with a person's username, such as **andy/6910**)
* long running shared feature branches (In general, feature work is done on
personal forks of the repository.)
See also the [Tips (for developers)](repository/tips/index.md) subpage.
## A Bit of History
ICU was first open sourced in 1999 using CVS and Jitterbug. The source files
were imported from other source control systems internal to IBM at that time.
The ICU project moved to using a Subversion source code repository and a Trac
bug database on Nov 30, 2006. These replace our original CVS source code
repository and Jitterbug bug data base. All history from the older systems has
been migrated into the new, so there should normally be no need to refer back to
Jitterbug or CVS.
In July 2018, the ICU project [moved
again](http://blog.unicode.org/2018/07/icu-moves-to-github-and-jira.html), this
time from svn to git on GitHub, and from trac to Atlassian Cloud Jira. Many
tools and much effort was involved in migration and testing. There is a
[detailed blog post](https://srl295.github.io/2018/07/02/icu-infra/) on the
topic (not an official ICU-TC document!) for those interested in the technical
details of this move.
-23
View File
@@ -1,23 +0,0 @@
<!--- © 2020 and later: Unicode, Inc. and others. --->
<!--- License & terms of use: http://www.unicode.org/copyright.html --->
# Configuring VS Code for ICU4C
- Create a `.vscode` folder in icu4c/source
- Copy the `tasks.json`, `launch.json` and `c_cpp_properties.json` files into
the `.vscode` folder.
- To test only specific test targets, specify them under `args` in
`launch.json`.
- To adjust the parallelism when building, adjust the `args` in `tasks.json`.
- `-l20` tells VSCode to not launch jobs if the system load average is above
20 (note that the [system load
average](https://en.wikipedia.org/wiki/Load_(computing)) is *not* a CPU
usage percentage).
- `-j24` limits the number of jobs launched in parallel to 24. The system
load average takes a while to respond, reducing this number helps the
initial bad system performance when a new build is launched.
NOTE:
Run the
[`./runConfigureICU` command](https://unicode-org.github.io/icu/userguide/icufaq)
before building `icu4c` from VSCode.
+8
View File
@@ -21,6 +21,14 @@ includes details that go beyond the C, C++, and Java API docs (and avoids some d
This is the new home of the User Guide (since 2020 August).
## ICU Site
The official ICU Site is located at <https://icu.unicode.org>.
It is the official landing page for the ICU project.
Some of the pages from the ICU Site have been migrated here.
The migrated sections and pages from the ICU Site are visible in the navigation bar of this site below the "ICU Site" section heading.
## ICU team member pages
Other documentation pages here are written by and for team members.
+565
View File
@@ -0,0 +1,565 @@
---
layout: default
title: CLDR-ICU integration (including ICU4C data to ICU4J)
parent: Release & Milestone Tasks
grand_parent: Contributors
nav_order: 115
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
© 2010-2014: International Business Machines Corporation and others.
All Rights Reserved.
-->
# CLDR-ICU integration (including ICU4C data to ICU4J)
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
# Intro and setup
These instructions describe how to regenerate ICU4C locale and linguistic data from CLDR,
and then how to convert that ICU4 data for ICU4J (data jars and maven resources).
They apply to CLDR 44 / ICU 74 and later.
To use these instructions just for generating ICU4J data from ICU4C, you only need to use
steps 1, 8, and 12 in the Process section.
The full process requires local copies of
* CLDR (the source of most of the data, and some Java tools)
* The complete ICU source tree, including:
* tools: includes the LdmlConverter build tool and associated config files
* icu4c: the target for converted CLDR data, and source for ICU4J data; includes tests for the converted data
* icu4j: the target for updated data jars; includes tests for the converted data
For an official CLDR data integration into ICU, these should be clean, freshly
checked-out. For released CLDR sources, an alternative to checking out sources
for a given version is downloading the zipped sources for the common (core.zip)
and tools (tools.zip) directory subtrees from the Data column in
[CLDR Releases/Downloads](https://cldr.unicode.org/index/downloads)
Besides a standard JDK, the process also requires [ant](https://ant.apache.org) and
[maven](https://maven.apache.org) plus the xml-apis.jar from the
[Apache xalan package](https://xalan.apache.org/xalan-j/downloads.html) _(Is this
latter requirement still true?)_. You will also need to have performed the
[CLDR Maven setup](http://cldr.unicode.org/development/maven) (non-Eclipse version).
Notes:
* Enough things can (and will) fail in this process that it is best to
run the commands separately from an interactive shell. They should all
copy and paste without problems.
* It is often useful to save logs of the output of many of the steps in this
process. The commands below save them to a NOTES directory.
* If you are adding or removing locales, or specific kinds of locale data,
there are some xml files in the ICU sources that need to be updated (these xml
files are used in addition to the CLDR files as inputs to the CLDR data build
process for ICU):
* The primary file to edit for adding/removing locales and/or collation and
rbnf data is<br>
`$TOOLS_ROOT/cldr/cldr-to-icu/build-icu-data.xml`.
* There are some files in `icu4c/source/data/xml/` that may need editing for
certain additions. This is especially true for brkitr additions; however there
are rbnf files there that add some rules. The collation files there mainly
hook up the UCA collation rules in `icu4c/data/unidata/UCARules.txt` to the
collation data. To process these files, certain CLDR dtds are copied over to
ICU.
For an official CLDR data integration into ICU, there are some additional
considerations:
* Don't commit anything in ICU sources (and possibly any changes in CLDR
sources, depending on their nature) until you have finished testing and
resolving build issues and test failures for both ICU4C and ICU4J.
* After everything is committed, you will need to tag the cldr and cldr-staging
sources that ended up being used for the integration (see process below).
# Environment variables
There are several environment variables that need to be defined.
1. Java-, ant-, and maven-related variables
* `JAVA_HOME`: Path to JDK (a directory, containing e.g. `bin/java`, `bin/javac`,
etc.); on many systems this can be set using the output of `/usr/libexec/java_home`.
* `ANT_OPTS`: You may want to set `-Xmx8192m` to give Java more memory; otherwise
it may run out of heap.
* `MAVEN_ARGS`: You may want to set `--no-transfer-progress` to reduce the noise
from the download progress.
2. CLDR-related variables
* `CLDR_DIR`: This is the path to the to root of standard CLDR sources, below
which are the common and tools directories.
* `CLDR_TMP_DIR`: Parent of temporary CLDR production data. Defaults to
`$CLDR_DIR/../cldr-aux` (sibling to `CLDR_DIR`).
> **NOTE:** As of CLDR 36 and 37, the GenerateProductionData tool no longer
generates data by default into `$CLDR_TMP_DIR/production`; instead it
generates data into `$CLDR_DIR/../cldr-staging/production` (though there is
a command-line option to override this). However the rest of the build still
assumes that the generated data is in `$CLDR_TMP_DIR/production`.
So `CLDR_TMP_DIR` must be defined to be `CLDR_DIR/../cldr-staging`.
3. ICU-related variables
* `ICU4C_DIR`: Path to root of ICU4C sources, below which is the source dir.
* `ICU4J_ROOT`: Path to root of ICU4J sources, below which is the main dir.
* `TOOLS_ROOT`: Path to root of ICU tools directory, below which are (e.g.) the
cldr and unicodetools dirs.
# Process
## 1 Environment variables
1a. Java, ant, and maven variables, adjust for your system
```
export JAVA_HOME=/usr/libexec/java_home
export ANT_OPTS="-Xmx8192m"
export MAVEN_ARGS="--no-transfer-progress"
```
1b. CLDR variables, adjust for your setup; with cygwin it might be e.g.
```
CLDR_DIR=`cygpath -wp /build/cldr`
```
Note that for cldr-staging we do not use personal forks, we commit directly.
```
export CLDR_DIR=$HOME/cldr-myfork
export CLDR_TMP_DIR=$HOME/cldr-staging
export CLDR_DATA_DIR=$HOME/cldr-staging/production
```
1c. ICU variables
```
export ICU4C_DIR=$HOME/icu-myfork/icu4c
export ICU4J_ROOT=$HOME/icu-myfork/icu4j
export TOOLS_ROOT=$HOME/icu-myfork/tools
```
1d. Directory for logs/notes (create if does not exist)
```
export NOTES=...(some directory)...
mkdir -p $NOTES
```
1e. The name of the icu data directory for Java (for example `icudt74b`)
```
export ICU_DATA_VER=icudt(version)b
```
## 2 Initial builds of ICU4C and ICU4J
2a. Configure ICU4C, build and test without new data first, to verify that
there are no pre-existing errors, and to build some tools needed for later
steps. Here `<platform>` is the runConfigureICU code for the platform you
are building on, e.g. Linux, MacOSX, Cygwin.
(optionally build with debug enabled)
```
cd $ICU4C_DIR/source
./runConfigureICU [--enable-debug] <platform>
make clean
make check 2>&1 | tee $NOTES/icu4c-oldData-makeCheck.txt
```
2b. Now with ICU4J, build and test without new data first, to verify that
there are no pre-existing errors (or at least to have the pre-existing errors
as a base for comparison):
```
cd $ICU4J_ROOT
mvn clean
mvn verify 2>&1 | tee $NOTES/icu4j-oldData-mvnCheck.txt
```
## 3 Make pre-adjustments
3a. Copy latest relevant CLDR dtds to ICU
```
cp -p $CLDR_DIR/common/dtd/ldml.dtd $ICU4C_DIR/source/data/dtd/cldr/common/dtd/
cp -p $CLDR_DIR/common/dtd/ldmlICU.dtd $ICU4C_DIR/source/data/dtd/cldr/common/dtd/
```
3b. Update the cldr-icu tooling to use the latest tagged version of ICU
```
open $TOOLS_ROOT/cldr/cldr-to-icu/pom.xml
```
(search for `icu4j-for-cldr` and update to the latest tagged version per instructions)
3c. Update the build for any new icu version, added locales, etc.
```
open $TOOLS_ROOT/cldr/cldr-to-icu/build-icu-data.xml
```
(update icuVersion, icuDataVersion if necessary; update lists of locales to include if necessary)
3d. If there are new data types or variants in CLDR, you may need to update the
files that specify mapping of CLDR data to ICU rseources:
```
open $TOOLS_ROOT/cldr/cldr-to-icu/src/main/resources/ldml2icu_locale.txt
open $TOOLS_ROOT/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt
```
## 4 Build and install CLDR jar
See `$TOOLS_ROOT/cldr/lib/README.txt` for more information on the CLDR
jar and the `install-cldr-jars.sh` script.
```
cd $TOOLS_ROOT/cldr
ant install-cldr-libs
```
## 5 Generate CLDR production data and convert for ICU
5a. Generate the CLDR production data.
This process uses ant with ICU4C's `data/build.xml`
* Running `ant cleanprod` is necessary to clean out the production data directory
(usually `$CLDR_TMP_DIR/production`), required if any CLDR data has changed.
* Running `ant setup` is not required, but it will print useful errors to
debug issues with your path when it fails.
```
cd $ICU4C_DIR/source/data
ant cleanprod
ant setup
ant proddata 2>&1 | tee $NOTES/cldr-newData-proddataLog.txt
```
> Note, for CLDR development, at this point tests are sometimes run on the
production data, see
[BRS: Run tests on production data](https://cldr.unicode.org/development/cldr-big-red-switch/brs-run-tests-on-production-data)
5b. Build the new ICU4C data files.
These include .txt files and .py files. These new files will replace whatever was
already present in the ICU4C sources. This process uses the `LdmlConverter` in
`$TOOLS_ROOT/cldr/cldr-to-icu/`; see `$TOOLS_ROOT/cldr/cldr-to-icu/README.txt`.
* This process will take several minutes, during most of which there will be no log
output (so do not assume nothing is happening). Keep a log so you can investigate
anything that looks suspicious.
* Note that `ant clean` should _not_ be run before this. The `build-icu-data.xml` process
will automatically run its own "clean" step to delete files it cannot determine to
be ones that it would generate, except for pasts listed in `<retain>` elements such as
`coll/de__PHONEBOOK.txt`, `coll/de_.txt`, etc.
* Before running ant to regenerate the data, make any necessary changes to the
build-icu-data.xml file, such as adding new locales etc.
```
cd $TOOLS_ROOT/cldr/cldr-to-icu
ant -f build-icu-data.xml -DcldrDataDir="$CLDR_TMP_DIR/production" | tee $NOTES/cldr-newData-builddataLog.txt
```
5c. Update the CLDR testData files needed by ICU4C/J tests, ensuring
they are representative of the newest CLDR data.
```
cd $TOOLS_ROOT/cldr
ant copy-cldr-testdata
```
5d. NOP
(This step has been subsumed into 5c above)
5e. For now, manually re-add the `lstm` entries in `data/brkitr/root.txt`
```
open $ICU4C_DIR/source/data/brkitr/root.txt
```
Paste the following block after the dictionaries block and before the final closing '}':
```
lstm{
Thai{"Thai_graphclust_model4_heavy.res"}
Mymr{"Burmese_graphclust_model5_heavy.res"}
}
```
## 6 Check the results
Check which data files have modifications, which have been added or removed
(if there are no changes, you may not need to proceed further). Make sure the
list seems reasonable. You may want to save logs, and possibly examine them...
```
cd $ICU4C_DIR/..
git status
git status > $NOTES/gitStatusDelta-data.txt
git diff > $NOTES/gitDiffDelta-data.txt
open $NOTES/gitDiffDelta-data.txt
```
6a. You may also want to check which files were modified in CLDR production data:
```
cd $CLDR_TMP_DIR
git status
git status > $NOTES/gitStatusDelta-staging.txt
git diff > $NOTES/gitDiffDelta-staging.txt
```
## 7 Fix data generation errors
Look for evident errors in the list of file changes, or in the file diffs.
Fixing them may entail modifying CLDR source data or `TOOLS_ROOT` config files or
tooling.
## 8 Rebuild ICU4C with new data, run tests
8a. Re-run configure and make clean, necessary to handle any files added or deleted:
```
cd $ICU4C_DIR/source
./runConfigureICU [--enable-debug] <platform>
make clean
```
8b. Do the rebuild, keeping a log as before:
```
make check 2>&1 | tee $NOTES/icu4c-newData-makeCheck.txt
```
To re-run a specific test if necessary when fixing bugs; for example:
```
cd test/intltest
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./intltest -e -G format/NumberTest/NumberPermutationTest
cd ../..
cd test/cintltst
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./cintltst /tsformat/ccaltst
cd ../../..
```
## 9 Investigate and fix make check test case failures
The first run processing new CLDR data from the Survey Tool can result in thousands
of failures (in many cases, one CLDR data fix can resolve hundreds of test failures).
If the error is caused by bad CLDR data, then file a CLDR bug (or use the existing BRS
ticket under which you are performing the integration, if you have one), fix the data,
and regenerate from step 4.
If the data is OK , other sources of failure can include:
* Problems with the CLDR-ICU conversion process (pehaps some locale data is not getting
converted properly; go back to step 3, adjust and repeat from there.
* Problems with ICU library code that may not be using new resources properly. Fix and
repeat from step 8.
* Problems in which ICU test cases need to be updated to match CLDR changes. Fix and
repeat from step 8. Some special cases of this include:
* If there are new resource types or new attribute values for existing resource types,
you will need to update `icu4c/test/testdata/structLocale.txt` (otherwise
`/tsutil/cldrtest/TestLocaleStructure` may fail).
## 10 Running ICU4C tests in exhaustive mode.
Exhautive tests should always be run for a CLDR-ICU integration PR before it is merged.
Once you have a PR, you can do this for both C and J as part of the pre-merge CI tests
by adding the following as a comment in the pull request:<br>
`/azp run CI-Exhaustive` (the exhaustive tests are not run automatically on every PR).
The following instructions run the ICU4C exhaustive tests locally (which you may want to do
before even committing changes, or which may be necessary to diagnose failures in the
CI tests:
```
cd $ICU4C_DIR/source
export INTLTEST_OPTS="-e"
export CINTLTST_OPTS="-e"
make check 2>&1 | tee $NOTES/icu4c-newData-makeCheckEx.txt
```
## 11 Investigate and fix ICU4C exhaustive test case failures
Again, investigate each failure, fixing CLDR data or ICU test cases as
appropriate, and repeating from step 4 or 8 as appropriate.
## 12 Transfer the ICU4C data to ICU4J
12a. You need to reconfigure ICU4C to include the unicore data.
```
cd $ICU4C_DIR/source
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ./runConfigureICU <platform>
```
12b. Rebuild the data with the new config setting, then create the ICU4J data jar.
```
cd $ICU4C_DIR/source/data
make clean
make -j -l2.5
make icu4j-data-install
```
12c. Create the test data jar
```
cd $ICU4C_DIR/source/test/testdata
make icu4j-data-install
```
12d. Update the extracted {main, test} data files in the Maven build
```
cd $ICU4J_ROOT
./extract-data-files.sh
```
## 13 Rebuild ICU4J with new data, run tests
13a. Run the tests using the maven build
```
cd $ICU4J_ROOT
mvn clean
mvn install 2>&1 | tee $NOTES/icu4j-newData-mvnCheck.txt
```
It is possible to re-run a specific test class or method if necessary when fixing bugs.
For example (using artifactId, full class name, test all methods):
```
mvn install -pl :core -Dtest=com.ibm.icu.dev.test.util.LocaleBuilderTest
```
or (example of using module path, class name, one method):
```
mvn install -pl main/common_tests -Dtest=MeasureUnitTest#TestGreek
```
13b. Optionally run the tests in exhautive mode
Optionally run before committing changes, or run to diagnose failures from
running exhastive CI tests in the PR using `/azp run CI-Exhaustive`:
```
cd $ICU4J_ROOT
mvn install -DICU.exhaustive=10 2>&1 | tee $NOTES/icu4j-newData-mvnCheckEx.txt
```
Running a specific test is the same as above:
```
mvn install --pl :core -DICU.exhaustive=10 -Dtest=ExhaustiveNumberTest
```
## 14 Investigate and fix maven check test failures
Fix test cases and repeat from step 13, or fix CLDR data and repeat from
step 4, as appropriate, until there are no more failures in ICU4C or ICU4J.
Note that certain data changes and related test failures may require the
rebuilding of other kinds of data and/or code. For example:
### Updating MeasureUnit code and tests
If you see a failure such as
```
MeasureUnitTest testCLDRUnitAvailability Failure (MeasureUnitTest.java:3410) : Unit present in CLDR but not available via constant in MeasureUnit: speed-beaufort
```
then you will need to update the C and J library and test code for new measurement
units, see the procedure at
[Updating MeasureUnit with new CLDR data](https://unicode-org.github.io/icu/processes/release/tasks/updating-measure-unit.html)
### Updating plurals test data
Changes to plurals data may cause failures in e.g. the following:
```
com.ibm.icu.dev.test.format.PluralRulesTest (TestLocales)
```
To address these requires updating the LOCALE_SNAPSHOT data in
```
$ICU4J_ROOT/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/PluralRulesTest.java
```
by modifying the TestLocales() test there to run `generateLOCALE_SNAPSHOT()` and
then copying in the updated data.
## 15 Check the ICU file changes and commit
```
cd $ICU4C_DIR/source
make clean
cd $ICU4J_ROOT
mvn clean
cd ..
git status
```
Then `git add` or `git rm` files as necessary. Record the changes, commit and push.
```
git status > $NOTES/gitStatusDelta-newData-afterAdd.txt
git commit -m 'ICU-nnnnn CLDR release-nn-stage to ICU main'
git push origin ICU-nnnnn-branchname
```
## 16 commit cldr-staging and tag
(Only for an official integration from CLDR git repositories)
16a. Check cldr-staging changes, and commit
```
cd $CLDR_TMP_DIR
git status
```
Then `git add` or `git rm` files as necessary. Record the changes, commit and push.
```
git status > $NOTES/gitStatusDelta-production-afterAdd.txt
git commit -m 'CLDR-nnnnn production data corresponding to CLDR release-nn-stage'
git push origin main
```
(usually for cldr-staging we just work with the main branch)
16b. Update cldr-staging and tag
(There may be other cldr-staging changes unrelated to production data, such as charts
or spec; we want to include them in the tag, so pull first, but log to see what the
chnages are first)
```
cd $CLDR_TMP_DIR
git pull
git log
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag production data corresponding to CLDR release-nn-stage"
git push --tags
```
## 17 tag cldr
(Only for an official integration from CLDR git repositories)
We need to tag the main cldr repository. If $CLDR_DIR represents that repository,
this is easy:
```
cd $CLDR_DIR
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag CLDR release-nn-stage"
git push --tags
```
However if $CLDR_DIR represents your personal fork or a branch from it, you need to
figure out what commit hash yo have integrated, and tag that hash in the main repo.
```
cd $CLDR_DIR
git log
```
Note the latest commit hash hhhhhhhh...
Then switch to the main repo, update it, and tag the appropriate hash (making sure
it is in that repo!):
```
cd $HOME/cldr
git pull
git log
git tag -a "release-nn-stage" -m "CLDR-nnnnn: tag CLDR release-nn-stage" hhhhhhhh...
git push --tags
```
## 18 Pubish the cldr tags in github
You should publish the cldr and cldr-staging tags in github.
For cldr, go to [unicode-org/cldr/tags](https://github.com/unicode-org/cldr/tags)
and click on the tag you just created. Click on the "Create release from tag" button
at the upper right. Set release title to be the same as the tag. Click the checkbox
for "Set as a pre-release" for all but the final release. For the description, see
what was done for earlier tags; it should reference the download page for the release.
When you are all ready, click the "Publish release" button.
For cldr-staging, go to [unicode-org/cldr-staging/tags](https://github.com/unicode-org/cldr-staging/tags)
and do something similar.
@@ -0,0 +1,47 @@
---
layout: default
title: Maintenance Release Procedure
parent: Release & Milestone Tasks
grand_parent: Contributors
nav_order: 75
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Maintenance Release Procedure
When a critical problem is found in ICU libraries, we try to fix the problem in
the latest development stream first. If there is a demand for the fix in a past
release, an ICU project developer may escalate the fix to be integrated in the
release to the ICU project management committee. Once the committee approved to
merge the fix into back level stream, the developer can merge the bug fix back
to the past release suggested by the committee. This merge activity must be
tracked by maintenance release place holder tickets and the developer should
provide original ticket number and description as the response in each
maintenance ticket. These fixes are automatically included in a future ICU
maintenance release.
## Place Holder Ticket
Once a major version of ICU library is released, we create maintenance release
place holder tickets for the major release (one for C, one for J). The ticket
should have subject: "ICU4\[C|J\] m.n.X". For example, after ICU 4.8 release, we
create two tickets - "ICU4C 4.8.X" and "ICU4J 4.8.X". These tickets must use the
target milestone - "maintenance-release".
## Maintenance Release
When the ICU project committee agree on releasing a new maintenance release, the
corresponding place holder ticket will be promoted to a real maintenance release
task ticket. This is done by following steps.
* Create the new actual maintenance release milestone (e.g. 4.8.1)
* Change the place holder ticket's subject to the actual version (e.g. "ICU4C
4.8.X" -> "ICU4C 4.8.1")
* Retarget the place holder ticket to the actual release (e.g.
"maintenance-release" -> "4.8.1")
* Create a new place holder ticket for future release (e.g. new ticket "ICU4C
4.8.X", milestone: "maintenance-release")
+47 -38
View File
@@ -49,7 +49,7 @@ License & terms of use: http://www.unicode.org/copyright.html
5. make doc
6. Follow instructions in
[tools/release/java/readme.txt](https://htmlpreview.github.io/?https://github.com/unicode-org/icu/blob/main/tools/release/java/readme.txt)
to generate API status change report.
to generate the API status change report.
7. Make sure that ICU headers work with U_HIDE_DRAFT_API and other such
switches.
8. Verify that U_DRAFT and U_STABLE match the @draft and @stable tags (same for
@@ -71,11 +71,11 @@ compatibility](https://unicode-org.github.io/icu/userguide/icu/design#icu-api-co
On ICU4J, run
[com.ibm.icu.dev.tool.docs.CheckTags](https://github.com/unicode-org/icu/blob/main/icu4j/tools/build/src/com/ibm/icu/dev/tool/docs/CheckTags.java)
(see file for instructions). This requires a JDK with javadoc available. The
(see file for instructions). This requires a JDK with javadoc available, i.e, JDK8. The
tool will need to change to reflect the release number to search for.
To check the API status changes, run the ant target "apireport" to generate the
report since the previous official release.
To check the API status changes, run the script `releases_tools/api_reports.sh` to generate the
report of updates since the previous official release. The resulting file is found in target/icu4j_compare_XX_YY.html.
Make sure **@internal APIs** are also marked as @deprecated:
@@ -116,28 +116,27 @@ Andy's method (from email 2019-sep-05):
### **ICU4J**
1. Create a new GitHub branch.
2. Run next ant target: `$ ant draftAPIsTSV`
3. This **ant** target generates a tab-separated values file at
icu4j/out/draftAPIs.tsv.
4. Import the TSV file to Google spread sheet - for example, [ICU4J 61 Draft
2. In directory icu/icu4j, run this script: `releases_tools/api_reports.sh`
3. This script generates a tab-separated values file at target/draftAPIs.tsv.
4. Import the TSV file to Google spread sheet - for example, [ICU4J 74 Draft
API
Promotion](https://docs.google.com/spreadsheets/d/135RDyY6cWKBBvNuVE9ne8HfsItZu_CvLh47hKjr3UqM/edit#gid=1384666589).
* Create the spreadsheet in the shared ***ICU Projects*** folder.
5. Review all APIs introduced in 2 releases ago or older. For example, 59 or
older for ICU 61 release.
5. Review all APIs introduced in 2 releases ago or older. For example, 72 or
older for ICU 74 release.
* Any API added 2 or more releases ago is a candidate for promotion.
* Newer APIs should be left in @draft state.
6. Check each API entry has a corresponding approved API proposal. For example,
[ICU 59 API proposal
[ICU 72 API proposal
status](https://docs.google.com/document/d/12dHTG3e9WXb7C1Xdc2bcXE0BK8f6IoufoUAPcz4ZT2I/edit).
Note: An API proposal might have been created before the API proposal doc
version, so you may need to look at older version of API proposal status
doc.
7. Mark APIs proposed for promotion, and add note in the spread sheet.
8. Update API comments in ICU4J source code. In this case, @draft is replaced
with @stable (do not change ICU version, for example, "@draft ICU 59" will
be changed to "@stable ICU 59").
9. Run next ant target to generate an API change report html: `$ ant apireport`
with @stable (do not change ICU version, for example, "@draft ICU 72" will
be changed to "@stable ICU 72").
9. Now, rerun target to generate an API change report html: `releases_tools/api_reports.sh`.
10. Review the report, sent the report file and the link of the spread sheet to
ICU technical committee members for review.
11. Once ICU TC approves the proposed change, create a pull request (PR), wait
@@ -166,10 +165,12 @@ This work is done in the root of icu4j:
1. Make sure JAVA_HOME is set to JDK 8. This report creation fails with JDK 11.
For example, in Linux:
* `export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64`
2. Then run ant task "clean" and "apireport" at <icu4j_root>:
* `ant clean apireport`
2. Now in `<icu4j_root>`, create a change report:
* `mvn clean`
* `releases_tools/api_reports.sh`
* # Note that some errors may be shown. This is normal.
3. Above will produce API change report file
<code><icu4j_root>/<b>out</b>/icu4j_compare_xxx_yyy.html</code>
`<icu4j_root>/<b>target</b>/icu4j_compare_xxx_yyy.html`
4. Make sure there are any new doc tag errors are reported. (As of ICU 4.4,
ArabicShaping constants do not have proper tags - otherwise, clean)
5. Copy generated report file to `<icu4j_root>/APIChangeReport.html` and check
@@ -179,11 +180,6 @@ Once official release version is shipped, we need to keep API signature
information file for next iteration. This is not done for milestone releases,
only after the final official release.
1. Run ant task "gatherapi" at <icu4j_root>
2. Above will produce API signature information file
<icu4j_root>/out/icu4jxx.api2.gz
3. Copy icu4jxxapi2.gz to <icu4j_root>/tools/build and add it to the repository
---
## Check in API signature data file (ICU4J)
@@ -192,11 +188,12 @@ Once APIs are frozen for a reference release, we should check in the API
signature data file into the repository. The data file will be used for future
API change report.
1. Run ant task "gatherapi" at <icu4j_root>
2. The output file icu4j<ver>.api3.gz is created in <icu4j_root>/out directory.
3. Copy the output .gz file to <icu4j_root>/tools directory and check in the
1. Run `releases_tools/api_reports.sh` at `<icu4j_root>`
2. Resolve any warnings before proceeding.
3. The output file `icu4j<ver>.api3.gz` is created in `<icu4j_root>/out` directory.
4. Copy the output .gz file to `<icu4j_root>/tools/build` directory and check in the
file to the repository.
4. You may delete very old versions of the API signature files. Keeping 10
5. You may delete very old versions of the API signature files. Keeping 10
versions to the latest should be good enough.
Note: This task is only necessary for reference releases, because we won't
@@ -311,7 +308,7 @@ and make sure ICU4J adequately covers the JDK API for the classes we replicate.
---
## Build API documentations
## Build API documentation
### **ICU4C**
@@ -329,8 +326,11 @@ javadoc files. Create icu4c-X_X_X-docs.zip
3. The generated API docs are in <path>/icu4c/source/doc/html/<br>
`cd <path>/icu4c/source/doc/html/`
4. Create a zip file, e.g.,<br>
`tar cvfz /tmp/icu4c641.tar.gz * # '641' needs to be replaced by the respective release label.`
5. ~~Upload this zip file to the GitHub release page. For the live API docs, see below.~~
`tar cvfz /tmp/icu4c72rc.tar.gz * # Note: label the file apropriately for the release.
5. Edit [README.md in icu-docs](https://github.com/unicode-org/icu-docs/blob/main/README.md).
6. Update the table under "API docs" at the top of README.md with the new version in column "C" in row "Dev" for the release candidate or "Released" for the final release.
7. Add the updated README.md to the pull request with the new API documentation.
#### Create a PR for ICU4C docs using the docs zip file
@@ -340,25 +340,29 @@ javadoc files. Create icu4c-X_X_X-docs.zip
b. Create and switch to a feature branch based of the latest `main`. Ex: `git checkout -b ICU-<TICKET-NUMBER>`.
c. Copy the zip file into your local copy of icu-docs into `apidoc/released/icu4c`
(or `apidoc/dev/icu4c` if not a release)
c. Go to the directory for the version of interest, either
`apidoc/dev/icu4c` (release candicate) or `apidoc/released/icu4c`
(general release.)
d. Unzip the file, replacing all documentation. Ex: `tar xvfz /tmp/icu4c641.tar.gz`
d. Be sure that you are in the right directory. Then, remove all the files
in this directory, e.g., `rm -rf *`. (Remember "git restore" is a good friend!)
e. Unzip the tar file from above, replacing all documentation. Ex: `tar xvfz /tmp/icu4c72rc.tar.gz`
e. Remove the zip file
e. Remove the zip file if it's in the folder.
f. `git add .`
f. `git add .`. Note that this may remove some old files. That's correct behavior.
g. `git commit -m "ICU-<TICKET-NUMBER> Update ICU4C API reference docs for
h. `git commit -m "ICU-<TICKET-NUMBER> Update ICU4C API reference docs for
XX.Y"`<br>
Example: [ICU-21546 Update ICU4C API reference docs for 69.1](https://github.com/unicode-org/icu-docs/pull/25)
h. `git push origin ICU-<TICKET-NUMBER>`
i. `git push origin ICU-<TICKET-NUMBER>`
i. Create Pull Request from your personal github fork of icu-docs from your newly-pushed branch `ICU-<TICKET-NUMBER>` with a destination of
j. Create Pull Request from your personal github fork of icu-docs from your newly-pushed branch `ICU-<TICKET-NUMBER>` with a destination of
the `unicode-org/icu-docs` repo's `main` branch
j. Request review
k. Request a review and submit the PR when approved.
Note: This is also referenced below [Upload API documentations](docs.md#upload-api-documentations) for how to make the API docs public.
@@ -396,6 +400,11 @@ See [Upload API documentations](docs.md#upload-api-documentations) below for how
See <https://unicode-org.github.io/icu-docs/HOWTO-Update.html> for instructions
to upload to <https://unicode-org.github.io/icu-docs/>
#### Update table of API docs:
1. Edit [README.md in icu-docs](https://github.com/unicode-org/icu-docs/blob/main/README.md).
2. Update the table under "API docs" at the top of README.md with the new version in column "J" in row "Dev" for the release candidate or "Released" for the final release.
3. Add the updated README.md to the pull request with the new API documentation.
### Update the Readme.html for GA
If there are any last second changes:
+66 -12
View File
@@ -343,6 +343,7 @@ automated as part of Travis CI.**</span>
---
## Test uconfig.h variations
This test is performed automatically by a GitHub Action for each pull request.
Test ICU completely, and run the header test (above) with:
@@ -392,13 +393,16 @@ The automated build system should have a machine that sets both
## Test UCONFIG_NO_CONVERSION
Note: Since ICU 73, this test has been included in the Github Actions Continuous Integration jobs.
These instructions explain how to run the test manually.
Make sure that the ICU4C common and i18n libraries build with
UCONFIG_NO_CONVERSION set to 1. We cannot do this as part of "Test uconfig.h
variations" because the test suites cannot be built like this, but the library
code must support it.
The simplest is to take an ICU4C workspace, modify uconfig.h *==temporarily==*
by changing the value of UCONFIG_NO_CONVERSION to 1, and do "make -j 6" (not
by changing the value of UCONFIG_NO_CONVERSION to 1, and do "make -j -l2.5" (not
"make check" or "make tests"). Verify that the stubdata, common & i18n libraries
build fine; layout should build too but toolutil will fail, that's expected.
@@ -417,7 +421,7 @@ Linux,
```sh
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1"
make -j6 check
make -j -l2.5 check
```
Any problems will show up as compilation or test errors.
@@ -443,7 +447,7 @@ show as build failures.
```sh
CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0" ./runConfigureICU Linux
make clean
make -j12 check
make -j -l2.5 check
```
## ~~Test ICU_USE_THREADS=0 \[Obsolete\]~~
@@ -469,6 +473,10 @@ make check
## Test ICU4C Samples and Demos
### Windows build and test
Note: Since ICU 73, this task has been included in the Azure DevOps Pipeline which is triggered automatically upon merging with main/maint* branches.
These instructions explain how to run the tests manually.
To build the ICU4C samples on Windows with Visual Studio, use the following
steps:
@@ -489,6 +497,29 @@ steps:
To test the sample programs, run the "source\\samples\\all\\samplecheck.bat"
script for each configuration, and ensure that they are successful.
### Linux /Unix build and test
To build and test ICU4C samples:
This test is performed automatically by a GitHub Action for each pull request.
* In icu4c/source, run the configuration "./runConfigure Linux" (or appropriate system)
* Build and install ICU4C.
* Set PATH to include the bin directory of the installed ICU4c.
* Set LD_LIBRARY_PATH to include the libs directory on the installed ICU4c.
```
cd icu4c/source
cd samples
# To clean all the test binaries
make clean-samples-recursive
# To rebuild them all
make all-samples-recursive
# To run all tests serially
make check-samples-recursive
```
## **Test ICU4C Demos via Docker**
See <https://github.com/unicode-org/icu-demos/blob/main/icu-kube/README.md>
@@ -510,8 +541,8 @@ demo.
```sh
$ cd icu4j
$ ant jarDemos
$ java -jar icu4jdemos.jar
$ mvn install -am -pl demos -DskipTests -DskipITs
$ mvn exec:exec -pl demos
```
Above command invokes GUI demo applications. As such it has to connect to a
@@ -521,9 +552,32 @@ which it is executed instead of in a ssh shell.
The demos include calendar, charset detection, holidays, RBNF and
transliterator. Check if each application is working OK.
To check ICU4J samples, open Eclipse workspace and import icu4j-samples project
from directory <icu4j_root>/samples. Make sure these sample code has no build
issues. Also run sample code with main and see if each sample code runs.
### ICU4J Samples
ICU4J samples are located in directory <icu4j_root>/samples. Check that:
* The build succeeds.
* Each sample runs, giving results appropriate for the sample.
To check ICU4J samples, you may use the command line to build and then run each:
```sh
$ cd icu4j
$ mvn install -am -pl samples -DskipTests -DskipITs
# Get the list of samples with `main` methods, and execute to test.
$ classes=`grep -r "void main" samples/src/ -l | ruby -lane 'file=$_; m = file.match(/src\/main\/java\/(.*)\.java$/); puts m[1];' | tr '/' '.'`
$ for class in $classes; do echo $class; mvn exec:java -pl samples -Dexec.mainClass="$class"; echo "Press enter to continue"; read; done
```
To use Eclipse, do the following:
* Open Eclipse workspace
* import icu4j-samples project
* Build the project
* In package explorer, right-click on "Run as"
* Pick "Java application"
* Choose a sample
* Verify that the sample runs and that output appears in the console window.
---
@@ -532,14 +586,14 @@ issues. Also run sample code with main and see if each sample code runs.
For ICU4J,
```sh
$ ant exhaustiveCheck
$ mvn install -DICU.exhaustive=10
```
For ICU4C, testing with an optimized build will help reduce the elapsed time
required for the tests to complete.
```sh
$ make -j6 check-exhaustive
$ make -j -l2.5 check-exhaustive
```
---
@@ -551,7 +605,7 @@ tests. These instructions run the sanitizer on the entire test suite. The clang
compiler is required.
```sh
$ CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux --disable-renaming
$ CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux/clang --disable-renaming
$ make clean
$ make -j6 check
$ make -j -l2.5 check
```
-1
View File
@@ -2,7 +2,6 @@
layout: default
title: Release & Milestone Tasks
parent: Contributors
nav_order: 10
has_children: true
---
+29 -19
View File
@@ -148,7 +148,7 @@ Using an in-source build on Linux:
```sh
cd icu4c/source
./runConfigureICU Linux
make -j2 check
make -j -l2.5 check
rm lib/libicudata.so*
cp -P stubdata/libicudata.so* lib/
cd test/intltest
@@ -176,6 +176,9 @@ now, this task is not required for ICU4J.
## Verify that ICU4C tests pass without collation rule strings
Note: Since ICU 73, this test has been included in the Github Actions Continuous Integration jobs.
These instructions explain how to run the test manually.
***ICU4C 53 and later***
Background: [ICU-10636](https://unicode-org.atlassian.net/browse/ICU-10636)
@@ -238,7 +241,7 @@ see ticket [ICU-10636](https://unicode-org.atlassian.net/browse/ICU-10636).
### Run the tests with data-errors-as-warnings
`INTLTEST_OPTS=-w CINTLTST_OPTS=-w make -j5 check`
`INTLTEST_OPTS=-w CINTLTST_OPTS=-w make -j -l2.5 check`
See that they pass, or fix them to pass. See ticket #10636 test code changes for
examples.
@@ -249,13 +252,18 @@ examples.
*Only available since ICU 54.*
#### With ICU 64 and later:
### With ICU 70 and later:
This test is performed automatically via a post-merge GHA check,
based on the following instructions for ICU 64+.
### With ICU 64 and later:
* Reconfigure ICU4C with
<code><b>ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data</b>
./runConfigureICU Linux</code> or similar
* Should be little-endian for coverage
* Clean and build ICU4C: `make -j6 check`
* Clean and build ICU4C: `make -j -l2.5 check`
* Make a clean directory for testing
* Find the .data file in the build output area, e.g.,
`icu4c/source/data/out/tmp/icudt64l.dat`
@@ -268,7 +276,7 @@ examples.
* If you get very many test failures, double-check that you enabled
unicore data in the ICU4C build (see first step).
#### With ICU 55 through ICU 63:
### With ICU 55 through ICU 63:
* Rebuild ICU4C with <code>make <b>INCLUDE_UNI_CORE_DATA=1</b> check</code> or
similar, and provide a path only for the .dat file.
@@ -283,7 +291,7 @@ examples.
* The configuration option sets the `ICUConfig.properties` data path
* Verify that all tests pass.
#### ICU 54 method:
### ICU 54 method:
In `icu4j-core/src/com/ibm/icu/ICUConfig.properties` set
`com.ibm.icu.impl.ICUBinary.dataPath` to a list of paths with all of the ICU4C
@@ -392,6 +400,8 @@ option. When it's not available, you would do the following:
---
## Run the environment tests
This test is performed automatically by a GitHub Action once per week. We can also run it manually by visiting
[GHA EnvTest Action page](https://github.com/unicode-org/icu/actions/workflows/icu_envtest.yml) then click on the "Run workflow v" drop down on the right side of the screen
Run
[environmentTest.sh](https://github.com/unicode-org/icu/blob/main/tools/release/c/environmentTest.sh)
@@ -421,9 +431,9 @@ To run manually, on a Linux system with clang,
```sh
cd icu4c/source
CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux
CPPFLAGS=-fsanitize=thread LDFLAGS=-fsanitize=thread ./runConfigureICU --enable-debug --disable-release Linux/clang
make clean
make -j6 check
make -j -l2.5 check
```
Errors are displayed at the point they occur, and stop further testing.
@@ -439,9 +449,9 @@ To run manually, on a Linux system with clang,
```sh
cd icu4c/source
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU --enable-debug --disable-release Linux
CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address ./runConfigureICU --enable-debug --disable-release Linux/clang
make clean
make -j6 check
make -j -l2.5 check
```
Memory leaks are summarized at the end. Other errors are displayed at the point
@@ -457,12 +467,12 @@ version of ICU. When we prepare a new release, the serialization compatibility
test data should be created and checked in for future testing. This task is
usually done just before publishing release candidate.
1. Run regular ICU4J unit tests - `ant check`
2. Make sure the unit tests pass successfully.
3. Run - `ant serialTestData`
4. Copy a folder with ICU version (e.g. ICU_61.1) generated under <icu4j
root>/out/serialTestData to <icu4j
root>/main/tests/core/src/com/ibm/icu/dev/test/serializable/data.
5. You may delete older serialization test data from the directory (but keep
the oldest one - ICU_3.6).
6. Run `ant check` again before committing the changes.
1. Run regular ICU4J unit tests `mvn verify` and make sure all tests pass successfully.
2. Run `releases_tools/serial_test_data.sh` from `icu4j` directory.
3. The new ICU serialization test data folder with version number (e.g. `ICU_75.1`)
is generated under `icu4j/target/serialTestData`. (**Note**: The version number in the output
folder name comes from `ICU_VERSION` in `VersionInfo.java`. If the version number is still one
for SNAPSHOT, such as `75.0.1`, you should update `ICU_VERSION` first.)
4. Copy the serialization data folder to `icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data`.
5. Delete the oldest serialization test data after ICU 3.6 (do not delete ICU_3.6) from the directory.
6. Run regular ICU4J unit tests `mvn verify` again.
@@ -39,7 +39,7 @@ and use it for future testing.
2. The target generates test data and runs some serialization test cases.
3. Once you confirm the test runs clean, copy
`out/serialTestData/ICU_<version>` to
`main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
`main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
---
+61 -31
View File
@@ -18,7 +18,7 @@ License & terms of use: http://www.unicode.org/copyright.html
{: .no_toc .text-delta }
1. TOC
{:toc}
{:toc}OnlineDemosHowToUpdate
---
@@ -33,11 +33,11 @@ merged in from the trunk.
... to the ICU project site.
Build the icuapps module following the README's. Update code and/or docs as
needed. "Reference" platforms for icuapps are: RedHat Linux and win32. On Linux,
icuapps is built against the "make install "'ed ICU. So, run ICU4C's configure
Build the icu-demos module following the README's. Update code and/or docs as
needed. "Reference" platforms for icu-demos are: RedHat Linux and win32. On Linux,
icu-demos is built against the "make install "'ed ICU. So, run ICU4C's configure
with --prefix=/some/where pointing to where ICU4C should be installed, and also
follow icuapps's README.
follow icu-demos's README.
Install the new locale explorer and other demos/samples onto the public demo
hosting site.
@@ -102,23 +102,23 @@ Use the GitHub GUI to create both the "release" and the "tag" at the same time:
<https://github.com/unicode-org/icu/releases/new>
Fill in the tag name, such as "release-63-rc" or "release-63-1", and make the
target the "maint/maint-xx" branch (such as maint/maint-63).
Set the title to "ICU 63 RC" or "ICU 63.1". Fill in the description using the
1. Fill in the tag name, such as `release-63-rc` or `release-63-1`, and make the
target the "maint/maint-xx" branch (such as `maint/maint-63`).
1. Set the title to `ICU 63 RC` or `ICU 63.1`.
1. Fill in the description using the
text from the announcement email. (You can also look at previous releases and
possibly re-use some of the generic text, such as links to the API docs, etc.)
Your screen should look like this:
![image](maint-63-rc-screenshot.png)
For the release candidate tag, please check the box that says "Pre-Release".
We no longer need to add the note about Git LFS files, as GitHub now includes
them in the auto-generated .zip downloads.
Click the "Publish Release" button to make the tag.
1. Your screen should look like this:
![image](maint-63-rc-screenshot.png)
1. Check the box that says "Set as a pre-release".
1. Click the "Publish Release" button to make the tag.
1. Additional step only for the GA release:
After completing the step above to mark the release as "pre-release",
the second step is to wait for the day of the official announcement of the release,
and then to edit the Github release entry's settings.
1. The first Github release settings change should uncheck the "Set as a pre-release" checkbox,
which has the effect of converting the release into a regular release.
1. The next settings change should check the box that says "Set as the latest release".
Note: The "latest" tag is no longer updated. It was agreed by the ICU-TC to be
deleted around the 64.2 time-frame, as it doesn't work well with with Git. (You
@@ -127,6 +127,9 @@ repository, they might have something different for the "latest" tag).
A possible future alternative might be a sym-link folder, or HTTP redirect that
points to the latest release.
We no longer need to add the note about Git LFS files, as GitHub now includes
them in the auto-generated .zip downloads.
#### Maintenance release
Create the maintenance release tag from the maintenance branch, as above.
@@ -146,13 +149,13 @@ copy that to tags/release-4-8. Specify the source revision explicitly via -r so
that you don't inadvertently pick up an unexpected changeset. Make sure that the
trunk at the source revision is good.~~
~~We do not tag the data & icuapps trees. Steven Loomis writes on 2011-may-23:~~
~~We do not tag the data & icu-demos trees. Steven Loomis writes on 2011-may-23:~~
> ~~My thought had been (in the CVS days) to take a 'snapshot' of these items.
> However, in SVN all you need is a date or a revision number (such as
> r30140).~~
> ~~So, probably, we don't need to tag these two (icuapps or data).~~
> ~~So, probably, we don't need to tag these two (idu-demos or data).~~
> ~~Tools are more important because those tools are actually used in the
> release.~~
@@ -258,6 +261,7 @@ $ git clone https://github.com/unicode-org/icu-docker.git
$ cd icu-docker/src
$ git clone --branch release-64-rc --depth 1 https://github.com/unicode-org/icu.git
$ cd icu
$ git lfs install --local
$ git lfs fetch
$ git lfs checkout
$ cd ../..
@@ -283,7 +287,7 @@ run \`make dist\`.
* Manual process:
* Build with MSVC x64 Release. (See the ICU
[readme.html](https://github.com/unicode-org/icu/blob/main/icu4c/readme.html)
[readme.html](https://github.com/unicode-org/icu/main/blob/icu4c/readme.html)
file for details).
* Open a command prompt.
```
@@ -356,11 +360,21 @@ run \`make dist\`.
This step publishes pre-processed Unicode property data, which may be ingested by downstream clients such as ICU4X.
* Using the output from the build bots:
* Navigate to the Azure Pipelines artifacts as described in the previous section
* Download the files named *icuexportdata_uprops_full.zip* and *icuexportdata_uprops_sample.zip*
* Navigate to the Azure Pipeline `C: Create Artifacts from icuexportdata` and download its single artifact (`icuexportdata_output`)
* Unzip the file
* Rename the `icuexportdata_tag-goes-here.zip` file to the correct tag (replacing slashes with dashes)
### Signing archives and creating checksums:
#### Step 0. PGP keys:
Use your own personal PGP key. Make sure that at least one other member of the
ICU-TC has signed your key (so that there's an established chain-of-trust
through which your key can be verified). Make sure that your signed public key
is included in the `KEYS` file in the root of the ICU repository, so that users
of ICU can easily find it there (and won't have to search random keyservers for
it), see instructions in that file on how to update it.
#### Step 1. PGP files:
Sign all archives created above with your own personal PGP key. This creates a
@@ -440,11 +454,27 @@ the new ICU version.
## Update online demos
Update online demos/tools to the latest version:
These are the online demos/tools that need to be updated to the latest version.
* Be sure to verify that the deployed version is publicly available.
Note that updating ICU4C demos online requires Gcloud access.
### ICU4C demos
* [Run ICU4C demos](https://icu4c-demos.unicode.org/icu-bin/idnbrowser)
* [Demo described here](https://github.com/unicode-org/icu-demos/blob/main/README.md)
* [Building and deploying from GCloud](https://github.com/unicode-org/icu-demos//blob/main/README.md)
### ICU4J demos
* [Run ICU4J online demos](https://icu4j-demos.unicode.org/icu4jweb/)
* [Information on the Java demos and samples](https://icu.unicode.org/home/icu4j-demos)
* [Instructions for building and deploying updates](https://github.com/unicode-org/icu-demos/blob/main/icu4jweb/README.md)
* ICU demos (eg <https://icu4c-demos.unicode.org/icu-bin/idnbrowser>)
* CLDR Survey tool (eg <http://unicode.org/cldr/apps/about.jsp>)
* Unicode Utilities (eg <http://unicode.org/cldr/utility/character.jsp>)
### Online information update
@@ -506,9 +536,9 @@ Jira.
## Update readme
Update [ICU4C
readme.html](https://github.com/unicode-org/icu/blob/main/icu4c/readme.html)
readme.html](https://github.com/unicode-org/icu/main/icu4c/readme.html)
and [ICU4J
readme.html](https://github.com/unicode-org/icu/blob/main/icu4j/readme.html)
readme.html](https://github.com/unicode-org/icu/main/icu4j/readme.html)
before every milestone (GA / RC / Milestone-N). Make sure the following items
are up to date.
@@ -44,7 +44,7 @@ After syncing CLDR data with ICU do the following. This documentation assumes
that you are updating the MeasureUnit clases for ICU 68.
* Check out
$GIT_ROOT/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
$GIT_ROOT/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java
* Open MeasureUnitTest.java.
* Find the `testZZZ` test, its code should all be commented out. This test will
execute last and will run the desired code.
@@ -57,7 +57,7 @@ that you are updating the MeasureUnit clases for ICU 68.
* Change `testZZZ` to run `generateConstants(“68”); // ICU 68.`
* Run MeasureUnitTest.java, copy the generated code (see instructions above).
* Open MeasureUnit.java:
$GIT_ROOT/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
$GIT_ROOT/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java
* Look for line containing:
`// Start generated MeasureUnit constants`
+133 -12
View File
@@ -73,15 +73,13 @@ Edit icuver.txt directly.
1. The instructions for updating the version number are in
[icu4c/source/common/unicode/uvernum.h](https://github.com/unicode-org/icu/blob/main/icu4c/source/common/unicode/uvernum.h).
2. [icu4c/source/stubdata/stubdata.vcxproj](https://github.com/unicode-org/icu/blob/main/icu4c/source/stubdata/stubdata.vcxproj)
and
[icu4c/source/data/makedata.mak](https://github.com/unicode-org/icu/blob/main/icu4c/source/data/makedata.mak)
may also need to updated with the correct version for icudt.
3. After uvernum.h is updated, the Windows project files should be updated by
running the UNIX makefile target '**update-windows-makefiles**' in
icu/source.
* You will need to rerun "./configure" first though before you can run the
command "make update-windows-makefiles".
2. [icu4c/source/data/makedata.mak](https://github.com/unicode-org/icu/blob/main/icu4c/source/data/makedata.mak)
also needs to be updated with the correct version for `U_ICUDATA_NAME` (icudt).
3. After `uvernum.h` is updated, the file [Build.Windows.IcuVersion.props](https://github.com/unicode-org/icu/blob/main/icu4c/source/allinone/Build.Windows.IcuVersion.props) should be updated.
This can be done by hand, or by running the UNIX makefile target '**update-windows-makefiles**'
in `icu4c/source`.
* You will need to rerun "`./configure`" first though before you can run the
command "`make update-windows-makefiles`".
* Note: You can use MSYS+MinGW to run the UNIX makefile on Windows
platforms as well.
4. As well, the ICU4C "configure" script should be updated so that it reflects
@@ -94,6 +92,122 @@ Edit icuver.txt directly.
### ICU4J
#### Since ICU 74
Changing the version for Java starting with ICU 74 requires a few steps:
1. [icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java)
There is a static block starting at line 501 (as of 54.1) in the source file.
Update the `ICU_VERSION` value, where the first three arguments represent the
major, minor, and patch versions of a semantic version.
Use the `getInstance(<major>, 0, 1, 0)` as the version during pre-release development,
and use `getInstance(<major>, 1, 0, 0)` to indicate a GA release version.
See the section on "ICU Version Number" for the version numbers to use during the BRS tasks for
each phase of the release process.
<pre>
/**
* Initialize versions only after MAP_ has been created
*/
static {
UNICODE_1_0 = getInstance(1, 0, 0, 0);
UNICODE_1_0_1 = getInstance(1, 0, 1, 0);
UNICODE_1_1_0 = getInstance(1, 1, 0, 0);
UNICODE_1_1_5 = getInstance(1, 1, 5, 0);
UNICODE_2_0 = getInstance(2, 0, 0, 0);
UNICODE_2_1_2 = getInstance(2, 1, 2, 0);
UNICODE_2_1_5 = getInstance(2, 1, 5, 0);
UNICODE_2_1_8 = getInstance(2, 1, 8, 0);
UNICODE_2_1_9 = getInstance(2, 1, 9, 0);
UNICODE_3_0 = getInstance(3, 0, 0, 0);
UNICODE_3_0_1 = getInstance(3, 0, 1, 0);
UNICODE_3_1_0 = getInstance(3, 1, 0, 0);
UNICODE_3_1_1 = getInstance(3, 1, 1, 0);
UNICODE_3_2 = getInstance(3, 2, 0, 0);
UNICODE_4_0 = getInstance(4, 0, 0, 0);
UNICODE_4_0_1 = getInstance(4, 0, 1, 0);
UNICODE_4_1 = getInstance(4, 1, 0, 0);
UNICODE_5_0 = getInstance(5, 0, 0, 0);
UNICODE_5_1 = getInstance(5, 1, 0, 0);
UNICODE_5_2 = getInstance(5, 2, 0, 0);
UNICODE_6_0 = getInstance(6, 0, 0, 0);
UNICODE_6_1 = getInstance(6, 1, 0, 0);
UNICODE_6_2 = getInstance(6, 2, 0, 0);
UNICODE_6_3 = getInstance(6, 3, 0, 0);
UNICODE_7_0 = getInstance(7, 0, 0, 0);
<b>
ICU_VERSION = getInstance(74, 1, 0, 0);
ICU_DATA_VERSION = ICU_VERSION;</b>
UNICODE_VERSION = UNICODE_7_0;
UCOL_RUNTIME_VERSION = getInstance(8);
UCOL_BUILDER_VERSION = getInstance(9);
UCOL_TAILORINGS_VERSION = getInstance(1);
}
</pre>
In the same file, starting at line 164 (as of 54.1) -
<pre>
/**
* Data version string for ICU's internal data.
* Used for appending to data path (e.g. icudt43b)
* @internal
* @deprecated This API is ICU internal only.
*/
@Deprecated
public static final String <b>ICU_DATA_VERSION_PATH = "74b";</b>
</pre>
2. When creating the final release of a major ICU version,
or a point release (minor version update on a maintenance branch),
update the Maven project version for ICU4J at the root (`icu4j/pom.xml`) and all of the submodules
with the following Maven command.
The command requires a version number string that follows the typical Java / Maven version number conventions.
The following examples illustrate the version numbers to use during and after the ICU 74 release:
* For an ICU major version change's final release, use: `74.1`
* On the `main` branch in the commit after the commit from which the release branch was cut,
use: `75.0.1-SNAPSHOT`
* For a point release (ICU minor version change), use: `74.2`
* On the maintenance branch (ex: `maint/maint-74`) in the commit after the commit creating the point release, use: `74.2.1-SNAPSHOT`
**Note:** for the public-facing Maven version number, we only use the major and minor versions of
the semantic version. In other words, we use version `74.1`, not `74.1.0`.
With the proper new version number, run the following Maven command to update the version numbers
throughout all of the ICU4J `pom.xml` build files.
```
mvn versions:set -DnewVersion=74.1 -DgenerateBackupPoms=false
```
3. Immediately after creating the final release of a major ICU version, update the value that represents just the major version number of the semantic version. To do this, update the value of the ICU `icu.major.version` property in the root Maven pom.xml file at `icu4j/pom.xml`.
This can be done by running the following command:
```
mvn versions:set-property -DnewVersion=74 -Dproperty=icu.major.version
```
This should happen at the same time and along with the work in the previous step for the version number
when the version number is updated on `main` in the commit after the release/maintanence branch is cut.
In other words, the above `versions:set-property` step should be executed at the same time
`mvn versions:set -DnewVersion=74.0.1-SNAPSHOT` is executed.
4. Update the following variables in `icu4j/releases_tools/shared.sh`
* `artifact_version` - The version used in the Maven `pom.xml` files. You can alternatively produce this value by running `mvn help:evaluate -Dexpression=project.version -q -DforceStdout`.
* `github_rel_version` - The version used in the name of the GitHub downloadable artifacts. For example "73_2" or "74rc".
* `api_report_version` - The major version of the new version. Change during RC BRS.
* `api_report_prev_version` - The major version of the previous version. Change during RC BRS.
#### Until ICU 73 (inclusive)
Since ICU4J 4.6, you can quickly check the current version information by
running jar main in icu4j.jar. For example,
@@ -148,9 +262,16 @@ For updating ICU version numbers, follow the steps below.
number such as "60.1" for official releases, "61.1-SNAPSHOT" until 61.1
release, after 60.1.
3. [icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java)
3. [icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java)
There is a static block starting at line 501 (as of 54.1) in the source file -
There is a static block starting at line 501 (as of 54.1) in the source file.
Update the `ICU_VERSION` value, where the first three arguments represent the
major, minor, and patch versions of a semantic version.
Use the `getInstance(major, 0, 1, 0)` as the version during pre-release development,
and use `getInstance(major, 1, 0, 0)` to indicate a GA release version.
See the section on "ICU Version Number" for the version numbers to use during the BRS tasks for
each phase of the release process.
<pre>
/**
@@ -272,7 +393,7 @@ For updating ICU version numbers, follow the steps below.
example, see
[tags/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties](http://source.icu-project.org/repos/icu/tags/icu4j/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties).
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DebugUtilities.java)
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/DebugUtilities.java)
This file is automatically generated when data is generated for ICU4J. The
ICU4C version number string should be check to ensure that the correct
+4 -19
View File
@@ -113,7 +113,7 @@ These rules will match "`abc`", "`hello_world`", `"hi-there"`,
They will not match "`-abc`", "`multiple__joiners`", "`tail-`"
A full match is composed of pieces or submatches, possibly from different rules,
with adjacent submatches linked by at least one overlapping character.
with adjacent submatches linked by one overlapping character.
In the example below, matching "`hello_world`",
@@ -206,15 +206,6 @@ Chaining into a rule can be dis-allowed by beginning that rule with a '`^`'. Rul
so marked can begin a match after a preceding boundary or at the start of text,
but cannot extend a match via chaining from another rule.
~~The !!LBCMNoChain; statement modifies chaining behavior by preventing chaining
from one rule to another from occurring on any character whose Line Break
property is Combining Mark. This option is subject to change or removal, and
should not be used in general. Within ICU, it is used only with the line break
rules. We hope to replace it with something more general.~~
> :point_right: **Note**: `!!LBCMNoChain` is deprecated, and will be removed
> completely from a future version of ICU.
## Rule Status Values
Break rules can be tagged with a number, which is called the *rule status*.
@@ -293,7 +284,6 @@ See, for example, this snippet from the [line break rules](https://github.com/un
| ~~`!!reverse`~~ | ~~*[deprecated]* The rules that follow are for reverse iteration. No longer needed; any rules in a Reverse rule section are ignored.~~ |
| ~~`!!safe_forward`~~ | ~~*[deprecated]* The rules that follow are for safe forward iteration. No longer needed; any rules in such a section are ignored.~~ |
| ~~`!!safe_reverse`~~ | ~~*[deprecated]* The rules that follow are for safe reverse iteration. No longer needed; any rules in such a section are ignored.~~ |
| ~~`!!LBCMNoChain`~~ | ~~*[deprecated]* Disable chaining when the overlap character matches `\p{Line_Break=Combining_Mark}`~~ |
## Rule Syntax
@@ -377,22 +367,17 @@ Here is the syntax for the boundary rules. (The EBNF Syntax is given below.)
exclamation `!`. This syntax is deprecated, and will be removed from a
future version of ICU.
2. `!!LBCMNoChain` was a global option that specified that characters with the
line break property of "Combining Character" would not participate in rule
chaining. This option was always considered internal, is deprecated and will
be removed from a future version of ICU.
3. Naked rule characters. Plain text, in the context of a rule, is treated as
2. Naked rule characters. Plain text, in the context of a rule, is treated as
literal text to be matched, much like normal regular expressions. This turns
out to be very error prone, has been the source of bugs in released versions
of ICU, and is not useful in implementing normal text boundary rules. A
future version will reject literal text that is not escaped.
4. Exact reverse rules and safe forward rules: planned changes to the break
3. Exact reverse rules and safe forward rules: planned changes to the break
engine implementation will remove the need for exact reverse rules and safe
forward rules.
5. `{bof}` and `{eof}`, appearing within `[`sets`]`, match the beginning or ending of
4. `{bof}` and `{eof}`, appearing within `[`sets`]`, match the beginning or ending of
the input text, respectively. This is an internal (not documented) feature
that will probably be removed in a future version of ICU. They are currently
used by the standard rules for word, line and sentence breaking. An
+4 -4
View File
@@ -350,10 +350,10 @@ UBool isWholeWord(BreakIterator& wordBrk,
int32_t start,
int32_t end) {
if (s.isEmpty())
return FALSE;
return false;
wordBrk.setText(s);
if (!wordBrk.isBoundary(start))
return FALSE;
return false;
return wordBrk.isBoundary(end);
}
```
@@ -367,10 +367,10 @@ UBool isWholeWord(UBreakIterator* wordBrk,
int32_t start,
int32_t end,
UErrorCode* err) {
UBool result = FALSE;
UBool result = false;
if (wordBrk == NULL || s == NULL) {
*err = U_ILLEGAL_ARGUMENT_ERROR;
return FALSE;
return false;
}
ubrk_setText(wordBrk, s, sLen, err);
if (U_SUCCESS(*err)) {
@@ -232,7 +232,7 @@ It has been replaced by the maxVariable option.
- `[normalization on]`
Turns on or off the UCOL_NORMALIZATION_MODE attribute.
If set to on, a quick check and neccessary normalization will be performed.
If set to on, a quick check and necessary normalization will be performed.
#### strength
- `[strength 1]`
+14 -14
View File
@@ -53,7 +53,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
UCollator *myCollator = 0;
if (U_FAILURE(*status))
{
return FALSE;
return false;
}
u_uastrcpy(source, "This is a test.");
u_uastrcpy(target, "THIS IS A TEST.");
@@ -63,7 +63,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
/*Report the error with display name... */
fprintf(stderr,
"Failed to create the collator for : \"%s\"\n", dispName);
return FALSE;
return false;
}
result = ucol_strcoll(myCollator, source, u_strlen(source), target, u_strlen(target));
/* result is 1, secondary differences only for ignorable space characters*/
@@ -71,7 +71,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
{
fprintf(stderr,
"Comparing two strings with only secondary differences in C failed.\n");
return FALSE;
return false;
}
/* To compare them with just primary differences */
ucol_setStrength(myCollator, UCOL_PRIMARY);
@@ -81,7 +81,7 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
{
fprintf(stderr,
"Comparing two strings with no differences in C failed.\n");
return FALSE;
return false;
}
/* Now, do the same comparison with keys */
@@ -93,10 +93,10 @@ UBool collateWithLocaleInC(const char* locale, UErrorCode *status)
{
fprintf(stderr,
"Comparing two strings with sort keys in C failed.\n");
return FALSE;
return false;
}
ucol_close(myCollator);
return TRUE;
return true;
}
```
@@ -122,7 +122,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
Collator *myCollator = 0;
if (U_FAILURE(status))
{
return FALSE;
return false;
}
myCollator = Collator::createInstance(locale, status);
if (U_FAILURE(status)){
@@ -130,7 +130,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
/*Report the error with display name... */
fprintf(stderr,
"%s: Failed to create the collator for : \"%s\"\n", dispName);
return FALSE;
return false;
}
result = myCollator->compare(source, target);
/* result is 1, secondary differences only for ignorable space characters*/
@@ -138,7 +138,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
{
fprintf(stderr,
"Comparing two strings with only secondary differences in C failed.\n");
return FALSE;
return false;
}
/* To compare them with just primary differences */
myCollator->setStrength(Collator::PRIMARY);
@@ -148,7 +148,7 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
{
fprintf(stderr,
"Comparing two strings with no differences in C failed.\n");
return FALSE;
return false;
}
/* Now, do the same comparison with keys */
myCollator->getCollationKey(source, sourceKey, status);
@@ -160,10 +160,10 @@ UBool collateWithLocaleInCPP(const Locale& locale, UErrorCode& status)
{
fprintf(stderr,
"%s: Comparing two strings with sort keys in C failed.\n");
return FALSE;
return false;
}
delete myCollator;
return TRUE;
return true;
}
```
@@ -175,7 +175,7 @@ int main()
{
UErrorCode status = U_ZERO_ERROR;
fprintf(stdout, "\n");
if (collateWithLocaleInCPP(Locale("en", "US"), status) != TRUE)
if (collateWithLocaleInCPP(Locale("en", "US"), status) != true)
{
fprintf(stderr,
"Collate with locale in C++ failed.\n");
@@ -185,7 +185,7 @@ int main()
}
status = U_ZERO_ERROR;
fprintf(stdout, "\n");
if (collateWithLocaleInC("en_US", &status) != TRUE)
if (collateWithLocaleInC("en_US", &status) != true)
{
fprintf(stderr,
"%s: Collate with locale in C failed.\n");
+5 -5
View File
@@ -350,7 +350,7 @@ UConverter* newCnv = ucnv_safeClone(oldCnv, 0, &bufferSize, &err)
3. In conversions to Unicode from Multi-byte encodings or conversions from
Unicode involving surrogates, if (a) only a partial byte sequence is
retrieved from the source buffer, (b) the "flush" parameter is set to "TRUE"
retrieved from the source buffer, (b) the "flush" parameter is set to "true"
and (c) the end of source is reached, then the callback is called with
`U_TRUNCATED_CHAR_FOUND`.
@@ -368,7 +368,7 @@ calling:
direction.
The converters are reset implicitly when the conversion functions are called
with the "flush" parameter set to "TRUE" and the source is consumed.
with the "flush" parameter set to "true" and the source is consumed.
### Error
@@ -774,12 +774,12 @@ can be used.
In such a scenario, the inner write does not occur unless a buffer overflow
occurs OR 'flush' is true. So, the 'write' and resetting of the target and
targetLimit pointers would only happen
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == TRUE)`
`if (err == U_BUFFER_OVERFLOW_ERROR || flush == true)`
The flush parameter on each conversion call should be set to FALSE, until the
The flush parameter on each conversion call should be set to false, until the
conversion call is called for the last time for the buffer. This is because the
conversion is stateful. On the last conversion call, the flush parameter should
be set to TRUE. More details are mentioned in the API reference in
be set to true. More details are mentioned in the API reference in
[ucnv.h](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
### 4. Pre-flighting
+1 -1
View File
@@ -256,7 +256,7 @@ static char buffer[BUFFER_SIZE] = {....};
int32_t inputLength = ... // length of the input text
UErrorCode status = U_ZERO_ERROR;
ucsdet_setText(csd, buffer, inputLength, &status);
ucsdet_enableInputFilter(csd, TRUE);
ucsdet_enableInputFilter(csd, true);
ucm = ucsdet_detect(csd, &status);
```
+1 -1
View File
@@ -141,7 +141,7 @@ Unicode.
references](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucnv_8h.html) .
7. For data exchange (rather than pure display), turn off fallback
mappings: `ucnv_setFallback(cnv, FALSE)`;
mappings: `ucnv_setFallback(cnv, false)`;
8. For some text formats, especially XML and HTML, it is possible to set an
"escape callback" function that turns unmappable Unicode code points
+2 -2
View File
@@ -76,7 +76,7 @@ of classes. This protocol includes:
* A programmatic ID, for example, "America/Los_Angeles". This ID is used to
call up a specific real-world time zone. It corresponds to the IDs defined
in the [IANA Time Zone datbase](https://www.iana.org/time-zones) used by UNIX
in the [IANA Time Zone database](https://www.iana.org/time-zones) used by UNIX
and other systems, and has the format continent/city or ocean/city.
* A raw offset. This is the difference, in milliseconds, between a time zone's
standard time and GMT. Positive raw offsets are east of Greenwich.
@@ -245,7 +245,7 @@ sources for general information on building ICU.
### Update the time zone data for ICU4J
The [ICU4J Time Zone Update Update
The [ICU4J Time Zone Update
Utility](https://icu.unicode.org/download/icutzu) automates the process of
updating ICU4J jar files with the latest time zone data. Instructions for use
are [here](https://htmlpreview.github.io/?https://github.com/unicode-org/icu-data/blob/main/tzdata/tzu/readme.html).
+178
View File
@@ -0,0 +1,178 @@
---
layout: default
title: Continuous Integration
parent: Contributors
---
# Continuous Integration
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
<!--
© 2024 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
ICU is tested thoroughly through a variety of tests
(unit tests, integration tests, exhaustive tests, fuzzer tests).
Many tests are specific to ICU4C or ICU4J individually,
using the language specific testing setups tools
(ex: ICU4C's C++ `intltest` and C `cintltest` for unit tests,
ICU4J's unit tests in JUnit).
ICU uses Continuous Integration systems to run these tests automatically for each new code contribution,
and upon each update to a future contribution under development
(that is: for each [successful Pull Request merge, and upon a new push of new git commits to a Pull Request](../gitdev.md)).
ICU has 2 systems configured to run Continuous Integration testing:
* Github Actions
* Azure Pipelines
Continuous Integration systems can also be used to regularly and automatically run other tasks besides testing.
ICU uses a CI workflow to automatically publish changes to its User Guide that is hosted on Github Pages.
## General ICU Settings for CI
### Automated Testing Enforcement
The value of automated testing isn't fully realized unless its enforcement is also automatic.
Individual tests can be configured in the ICU Github repository:
1. "Settings" tab for [`unicode-org/icu`](https://github.com/unicode-org/icu/)
2. "Branches"
3. "Branch protection rules"
4. Choose one of the rule sets and click "Edit". ***Note: all rule sets should be changed in the same way***
5. Ensure that "Require status checks to pass before merging" is enabled
6. Underneath that enabled checkbox, the table "Status checks that are required." lists the currently enabled tests ("checks") that must pass before a Pull Request can be merged to the branch
7. If a new test (check) needs to be added, use the search box above the table and type the display name of the check, then click on it in the drop down list to add it to the table of required checks.
## Github Actions
ICU uses [Github Actions](https://github.com/features/actions) to run unit tests, environment tests, deployments of the User Guide, etc.
### Workflow files
Workflow files are in YAML form stored at `.github/workflows/`.
### UI Dashboard
All workflow instances/runs show up in the ["Actions" tab](https://github.com/unicode-org/icu/actions) of the repository,
using the display name that was set for the workflow.
All of the runs can be filtered by the Workflow name and/or by the Pull Request (via the Branch filter).
Each PR will show the status of the current/latest run of each job in the "Checks" section of the Pull Request's main page (Conversation tab),
with special details and logs being navigable in the Checks tab.
### Configuration
#### Jobs
Jobs can be added, removed, and edited merely by editing the YAML workflow files.
#### Conditional Triggers
Workflow files can be conditionally triggered based on many factors.
A few of the useful factors:
* whether the trigger event is a push to a pull request, or the merge of a pull request, or a manual request
* the name of the originating branch for the trigger event
* whether the files modified in a pull request belong to certain file paths
ICU uses the file path matching condition to run ICU4J or ICU4C tests respectively only when their corresponding directories `icu4j` and `icu4c` contain file changes.
Thus, there is a separate workflow for ICU4J and ICU4C,
each with its own separate set of trigger conditions based on their corresponding file paths.
User Guide deployments are similarly run conditionally only when the `docs` directory has changed.
Some tests that are commonly needed or cross boundaries of concern are always run.
Some long-running tests are run once a week using a cronjob-like schedule trigger.
Some workflows exist to interact with the Github Actions platform,
such as keeping the cache alive for Maven artifacts due to the [noticeable flakiness that PRs face](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) without the cache.
Because of a [cache eviction policy](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy), which affects any subsequent PRs until they are merged,
it is easier to keep the cache alive in an automated way using a cronjob-like schedule trigger whose repetition period is shorter than the eviction period.
### Caveats
Github branch protection rules are not capable of appropriately handling jobs from a conditionally triggered workflow.
In other words, we cannot currently configure the required checks to include a job from the ICU4J workflow,
because if a PR does not include ICU4J code changes,
the workflow will not run and Github is not capable of ignoring the check in that scenario. Furthermore, workflow conditional triggers can only be triggered at the workflow level, not the job level.
Open Source users can now access machines with [at least 4 cores available per job](https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/).
## Azure Pipelines
ICU also uses [Azure Pipelines](https://azure.microsoft.com/en-us/products/devops/pipelines) to run CI jobs.
### Workflow files
Workflow files are in YAML form stored at `.ci-builds/`.
### UI Dashboard
All Azure piplines show up in the
[Azure Piplines ICU project dashboard](https://dev.azure.com/ms/icu/),
specifically in the
[Pipelines page](https://dev.azure.com/ms/icu/_build).
After clicking on a specific pipeline,
all of the instances/runs for that pipeline appear.
All of the runs can be filtered in the Branch filter by the destination branch name (ex: `main`) or the PR number (ex: `2874`).
### Configuration
#### Initial Setup with Github.
The upstream Github repo needs to be connected to Azure Pipelines in order for Azure Pipelines to listen for and trigger new pipelines based on events occuring in Github,
and to return the status back to Github.
This configuration is started by ensuring that the upstream ICU repo `unicode-org/icu` has the Azure Pipelines 3rd party app installed from the Github Marketplace.
Once installed, the app will appear in the repo's Github "Settings" page under "Integrations" > "Github Apps".
In order to configure a newly pipeline in Azure using the Github app for Azure Pipelines, you must do:
1. Create and check-in a new YAML file in the icu repo at `.ci-builds/`
2. In the repo settings, go to "Github Apps"
3. In the Installed GitHub Apps section, click option to configure "Azure Pipelines".
4. A page to update Azure Pipeline's repository access apears next. Click on "Update access".
5. Next a page to authenticate with your Microsoft credentials appear. Sign in with Microsoft credentials.
6. Select ADO org as `ms` and project as `icu`, click on continue.
7. After authentication from Azure and Github, you come to the new pipeline wizard.
8. Select repo as `unicode-org/icu` and select "Existing Azure Pipelines YAML file" and choose the yaml file created in step #1
9. Review YAML file and click save. You will find a new pipeline created with name `unicode-org.icu`. Rename it to a more appropriate name
***The pipline should now run as per the YAML rules and would be visible from Github settings for branch protection.***
#### Jobs
Jobs can be added, removed, and edited merely by editing the YAML workflow files.
The syntax for Azure Pipelines workflows is very similar to Github Actions, including the YAML format.
However, there are noteworthy differences in functionality and the expression of equivalent configurations aross the systems and syntaxes.
#### Conditional Triggers
Conditional triggers can be configured for Azure Pipelines similarly to Github Actions.
Note: The triggers for merges to a branch (ex: `main`) may need to be duplicated into a separate trigger section for Pull Requests because they seem to be handled differently.
### Caveats
In order to set up a pipeline, a person must simultaneously have access to the Azure Pipelines project for ICU and to the Github ICU repository.
If an Azure Pipeline only has one job,
that job might not be shown on a PR's main page within the list of all of the running CI checks.
There will only be an entry with the pipeline name in the list of checks.
However, if an Azure Pipeline has multiple jobs,
then each of the constituent jobs of the pipeline will be represent in the list of checks,
in addition to an entry for the pipeline itself.
+2 -2
View File
@@ -1,7 +1,6 @@
---
layout: default
title: Coding Guidelines
nav_order: 1
parent: Contributors
---
<!--
@@ -460,6 +459,7 @@ Starting with ICU 68 (2020q4), we no longer define these in public header files
(unless `U_DEFINE_FALSE_AND_TRUE`=1),
in order to avoid name collisions with code outside ICU defining enum constants and similar
with these names.
Starting with ICU 72 (2022q4), we no longer use these anywhere in ICU.
Instead, the versions of the C and C++ standards we require now do define type `bool`
and values `false` & `true`, and we and our users can use these values.
@@ -540,7 +540,7 @@ u_formatMessage(...);
```
> :point_right: **Note**: The `U_CAPI`/`U_DEPRECATED` and `U_EXPORT2` qualifiers
> are required for both the declaration and the definiton of *exported C and
> are required for both the declaration and the definition of *exported C and
> static C++ functions*. Use `U_CAPI` (or `U_DEPRECATED`) before and `U_EXPORT2`
> after the return type of *exported C and static C++ functions*.
>
-137
View File
@@ -1,137 +0,0 @@
---
layout: default
title: Contributions
nav_order: 4
parent: Contributors
---
<!--
© 2020 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Contributions to the ICU library
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
## Why Contribute?
ICU is an open source library that is a de-facto industry standard for
internationalization libraries. Our goal is to provide top of the line i18n
support on all widely used platforms. By contributing your code to the ICU
library, you will get the benefit of continuing improvement by the ICU team and
the community, as well as testing and multi-platform portability. In addition,
it saves you from having to re-merge your own additions into ICU each time you
upgrade to a new ICU release.
## Current Process
See <https://icu.unicode.org/processes/contribute>.
## Historical
### Legal Issues ICU 1.8.1-57
The following process was in place up to ICU 57, when the old ICU license was
used.
### Old Process
In order for your code to be contributed, you need to assign to IBM joint
copyright ownership in the contribution. You retain joint ownership in the
contribution without restriction. (For the complete set of terms, please see the
forms mentioned below.)
The sections below describe two processes, for one-time and ongoing
contributors. In either case, please complete the form(s) electronically and
send it/them to IBM for review. After review by IBM, please print and sign the
form(s), send it/them by mail, and send the code. The code will then be
evaluated.
Please consult a legal representative if you do not understand the implications
of the copyright assignment.
### One-Time Contributors
If you would like to make a contribution only once or infrequently, please use
the *Joint Copyright Assignment - One-time Contribution* form.
(<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment.rtf>).
The contribution will be identified by a bug ID which is unique to the
contribution and entered into the form. Therefore, please make sure that there
is an appropriate bug (or Request For Enhancement) in the ICU bug database, or
submit one.
The code contribution will be checked into a special part of the ICU source code
repository and evaluated. The ICU team may request updates, for example for
better conformance with the ICU [design](../design.md) principles,
[coding](codingguidelines.md) and testing guidelines, or performance. (See also
the Requirements (§) above.) Such updates can be contributed without exchanging
another form: An ICU team member commits related materials into the ICU source
code repository using the same bug ID that was entered into the copyright
assignment form.
### Ongoing Contributors
If you are interested in making frequent contributions to ICU, then the ICU
Project Management Committee may agree to invite you as an ongoing contributor.
Ongoing contributors may be individuals but are more typically expected to be
companies with one or more people ("authors") writing different parts of one or
more contributions.
In this case, the relationship between the contributor and the ICU team is much
closer: One or more authors belonging to the contributor will have commit access
to the ICU source code repository. With this direct access come additional
responsibilities including an understanding that the contributor will work to
follow the technical Requirements (§) above for contributions, and agreement to
adhere to the terms of the copyright assignment forms for all future
contributions.
The process for ongoing contributors involves two types of forms: Initially, and
only once, an ongoing contributor submits a *Joint Copyright Assignment by
Ongoing Contributor* form, agreeing to essentially the same terms as in the
one-time contributor form, for all future contributions. (See the form at
<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment_ongoing.rtf>).
The contributor must also send another form, *Addendum to Joint Copyright
Assignment by Ongoing Contributor: Authors*, for the initial set and each
addition of authors to ICU contributions, **before** any contributions from
these authors are committed into the ICU source code repository. (Only new,
additional authors need to be listed on each such form.) The contributor agrees
to ensure that all of these authors agree to adhere to the terms of the
associated *Joint Copyright Assignment by Ongoing Contributor Agreement*. (See
the Authors Addendum form at
<https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/Copyright_Assignment_authors.rtf>).
Some of an ongoing contributor's authors will have commit access to the ICU
source code repository. Their committer IDs need to be established before
completing the Authors Addendum form, so that these committer IDs can be entered
there. (The committer IDs should be activated only after the form is received.)
Committer authors commit materials directly into the appropriate parts of the
ICU source code repository. Contributions from an ongoing contributor are
identified by their association with the contributor's committer IDs.
### Previous Contributions
All previous "one-off" contributions from non-IBM sources to ICU are listed on
the code contributions page in ICU's source code repository. The page contains
links to the softcopies of the Joint Copyright Assignment forms. See
<https://htmlpreview.github.io/?https://github.com/unicode-org/icu-docs/blob/main/legal/contributions/code_contributions.html>
In addition, the following non-IBM companies are registered as Ongoing
Contributors:
* Apple
* Google
See the repository folder that contains the contributions page for the full set
of softcopies of contributor agreements including one-off contributions,
ongoing-contributor agreements and author-addendum documents to
ongoing-contributor agreements:
<https://github.com/unicode-org/icu-docs/tree/main/legal/contributions>
-1
View File
@@ -1,7 +1,6 @@
---
layout: default
title: User Guide Editing
nav_order: 5
parent: Contributors
---
<!--
@@ -1,22 +1,37 @@
---
layout: default
title: Developing Fuzzer Targets for ICU APIs
parent: Contributors
---
# Developing Fuzzer Targets for ICU APIs
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
<!--
© 2019 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
Developing Fuzzer Targets for ICU APIs
======================================
This documents describes how to develop a [fuzzer](https://opensource.google.com/projects/oss-fuzz)
target for an ICU API and its integration into the ICU build process.
### Directory and naming conventions
## Directory and naming conventions
Fuzzer targets are exclusively in directory
[`source/test/fuzzer/`](https://github.com/unicode-org/icu/tree/main/icu4c/source/test/fuzzer)
and end with `_fuzzer.cpp`. Only files with such ending are recognized and executed as fuzzer
targets by the OSS-Fuzz system.
### General structure of a fuzzer target
## General structure of a fuzzer target
As a minimum, a fuzzer target contains the function
@@ -69,7 +84,7 @@ constructor. The code interprets the fuzzer data as UnicodeString and passes it
And that is all. Specific error handling or return value verification is not required because the
fuzzer will detect all memory issues by means of memory/address sanitizer findings.
### Makefile.in changes
## Makefile.in changes
ICU fuzzer targets are built and executed by the OSS-Fuzz project. On side of ICU they are compiled
to assure that the code is syntactically correct and, as a sanity check, executed in the most basic
@@ -81,14 +96,14 @@ The new fuzzer target will then be built and executed as part of a normal ICU4C
that each fuzzer target becomes executable on its own. As such it is linked with the code in
`fuzzer_driver.cpp`, which contains the `main()` function.
### Fuzzer seed corpus
## Fuzzer seed corpus
Any fuzzer seed data for a fuzzer target goes into a file with name `<fuzzer_target>_seed_corpus.txt`.
In many cases the input parameter of the ICU API under test is of type `UnicodeString`, in case
of which the seed data should be in UTF-16 format. As an example,see
[collator_rulebased_fuzzer_seed_corpus.txt](https://github.com/unicode-org/icu/blob/main/icu4c/source/test/fuzzer/collator_rulebased_fuzzer_seed_corpus.txt).
### Guidelines and tips
## Guidelines and tips
* Leave all randomness to the fuzzer. If a random selection of any kind is needed (e.g., of a
locale), then use bytes from the fuzzer data to make the selection
@@ -97,7 +112,7 @@ of which the seed data should be in UTF-16 format. As an example,see
under test requires a Unicode string then make sure that the seed data is in UTF-16 encoding.
This can be achieved with e.g. the 'iconv' command or using an editor that saves text in UTF-16.
### How to locally reproduce fuzzer findings
## How to locally reproduce fuzzer findings
At this time reproduction of fuzzer findings requires Docker installed on the local machine and the
OSS-Fuzz project downloaded in a local git client.
+606
View File
@@ -0,0 +1,606 @@
---
layout: default
title: git and Github for ICU Developers
parent: Contributors
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# git and Github for ICU Developers
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
For git & git lfs installation see the [Source Code Setup](../../devsetup/source/)
page.
For setup with language compilers and IDEs, see the [Setup for Contributors](../../devsetup/source/) page
and its subpages.
## Overview
ICU development is on GitHub, in the **main** branch of the git repository.
<https://github.com/unicode-org/icu>
In preparation for a release, we create a maintenance branch, such as
[maint/maint-62](https://github.com/unicode-org/icu/tree/maint/maint-62) for ICU
62 and its maintenance releases.
For each release we create a release tag.
[releases/tag/release-62-1](https://github.com/unicode-org/icu/releases/tag/release-62-1)
(GitHub project page > Releases > Tags > select one; a Release is a Tag with
metadata.)
There are additional branches that you can ignore. Some are old development
branches.
Also, when you edit a file directly on the GitHub source browser (for docs: API
comments, or .md/.html/.txt), it creates a branch for your pull request. Make
sure to delete this branch when you are done.
## Development
We do *not* develop directly on the main repository. Do *not* clone from
there to commit and push back into the main repository.
Instead, use the GitHub UI (top right) to create a fork of the repository in
your own GitHub account. Then clone that to your local machine. You need only
one fork for all of your ICU work.
```
mkdir -p icu/mine/src
git clone git@github.com:markusicu/icu.git icu/mine/src
cd icu/mine/src
```
You should be in the **main** branch of your fork's clone.
Do *not* do any development in your own **main** branch either! That would
lead to messy merging with the upstream **main** branch.
Instead, create a new branch in your local clone for each piece of work. You
need a separate branch for each pull request. More on that later.
```
git checkout -b mybranchname
```
Now you are in a new development branch in your local git repo. Confirm with
`git status`. Change stuff. Do `git status` again, use `git add` for staging and
`git commit -m 'ICU-23456 what I changed'` to commit, or use `git commit -a -m 'ICU-23456 what I changed'` if you want to commit everything that git status
shows as changed.
For looking at changes, you should set up a visual diff program for use with
`git difftool`. See the [Setup: git difftool & mergetool](../../devsetup/source/gittooling.md) page.
For new files: Remember to add the appropriate copyright lines. Copy from a file
of the same type, and set the copyright year to the current year (that is, the
year you are creating the file).
You should have a Jira ticket for each line of work. (See [Submitting ICU Bugs and Feature Requests](https://icu.unicode.org/bugs) and [ICU Ticket Life cycle](https://icu.unicode.org/processes/ticket-lifecycle).) You can have multiple pull
requests per ticket. Each pull request needs a ticket in Accepted state.
Always prefix your commit statements with the Jira ticket number using this
pattern (including the space after the number; note: no colon):
`**ICU-23456** what I changed`
Local commits are only on your local machine. If your local disk crashes, your
changes are gone. `git push` your commits to your GitHub fork.
**Tips for Branches**
Shane
[recommends](https://blog.sffc.xyz/post/185195398930/why-you-should-use-git-pull-ff-only)
setting the default behavior of `git pull` to `--ff-only`. Shane also
[prevents](https://stackoverflow.com/a/40465455/1407170) local commits to the
**main** branch via *.git/hooks/pre-commit*. These two measures make it easier
to do the right thing in Git.
## Trivial changes
For trivial changes, such as small fixes in API docs or text files, it is ok to
edit the file in the GitHub GUI, in the main unicode-org/icu repository.
You still need a Jira ticket.
Once you are done editing, the GUI lets you create a branch and a commit right
in the main repository. Use the usual **ICU-23456** what I changed pattern
for the commit message.
Pull request, review, merge as usual, see the next section.
*Remember to delete your branch after merging.*
## Review & commit to Unicode main
When you are ready for code review, go to your GitHub page and your ICU fork.
Select your dev branch (Branch drop-down on the left, search for your branch).
Click "New pull request" next to the Branch button, or "Pull request" on the
right near "Compare". *Make sure it compares with unicode-org/icu main on the
left and your own fork's dev branch on the right*.
Prefix the title of your pull request with the Jira ticket number, same format
as for a commit.
Follow the rest of the checklist in the PR template.
Set the PR assignee to your main reviewer. You may add more people as reviewers,
but there is normally just one assignee. Be somewhat judicious with additional
reviewers: Don't just add them because they were recommended by GitHub.
Nice to have: Optionally set the Jira ticket reviewer field for documentation.
Still possible to close the ticket if the field is empty.
Watch the PR status for build failures and other issues.
A PR reviewer (at least the assignee) should look to see if the PR does what the
ticket says.
Respond to review feedback. Make changes on your local machine, commit, push to
your fork. The GitHub PR will update automatically for your additional commits.
Try to not rebase, squash, or force-push until the reviewer gives you a green
light.
*You should normally squash multiple commits into one in your fork before
merging (after the reviewer is satisfied)*. For multiple commits, the reviewer
should first respond with something like "lgtm please squash" but not yet
GitHub-approve; after squashing, they should check that the changes are the
same, and then GitHub-approve. A bot will respond to the PR confirming whether
the squash succeeded without changing the file contents.
If you squash, since you are rewriting the commit message anyway, please append
the pull request number to the first line of the updated message, using the
format "` (#199)`".
When you squash, please keep the parent hash (sha) the same so that the squash
is nothing more than a squash. If you change the parent hash, you may also be
pulling in other people's changes, and it may be harder for the reviewer to
verify that the squash was done correctly.
### Options on how to squash
#### Option 1: Use the online PR commit checker bot
Please note: this makes the
change in your remote branch but not in your local branch. Click the "Details"
link in the GitHub status, which brings you to a page with a summary of your PR.
Find the "Squash..." button. Sign in using your GitHub account, and follow the
flow to squash your branch.
Warning: do not `git pull` after you use the remote tool! If you subsequently need
to update your local branch to the squash commit, you need to fetch and reset:
```
git fetch origin BRANCHNAME
git checkout BRANCHNAME
git reset origin/BRANCHNAME
```
#### Option 2: Use git rebase
This works as long as you have no merge commits with
conflicts in your history. Plenty of examples:
* <https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing>
* <https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit>
* <https://blog.carbonfive.com/2017/08/28/always-squash-and-rebase-your-git-commits/>
* <http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html>
* <https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec>
* Several other options:
<https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git>
#### Option 3: Use git merge
This is a little tricker but works even if you have
merge commits with conflicts. Assuming your feature branch is called BRANCHNAME:
```
# Make sure your branch is up-to-date with main and that the tests pass:
git checkout BRANCHNAME
git merge main
git push
# At this point, wait for an LGTM from a reviewer before proceeding.
# Once confirmed, make your squash commit in a new temp branch.
# NOTE: In the first line, make sure to checkout the same sha as
# you most recently merged into your branch!
git checkout main
git checkout -b temp
git merge --squash BRANCHNAME
git commit
# Point your branch to the squash commit, and there should be no dirty files:
git checkout BRANCHNAME
git reset temp
git status  # should be empty! If it's not, you didn't check out the right sha.
# Push your squash commit and clean up:
git push -f
git branch -d temp
```
#### Option 4: Amend a small commit
When making code review changes on a small PR, you can amend your
previous commit rather than making a new commit. Instead of running "git
commit", just run "git commit --amend". You will need to force-push. The PR bot
will post a link for the reviewer to see the changes from your old commit to
your new commit.
Once the reviewer(s) has/have approved your (squashed) changes:
* If you are an ICU team member with main repo write access:
* Merge your commits into the Unicode main.
* We almost always want to "rebase and merge" the commits. We normally
want them pre-squashed for a simple, clean change history. We rarely
want to permanently keep intermediate commits.
* (For ICU 63 we used "squash merge" but ended up with some ill-formed
commit messages. "Rebase and merge" lets us review the commit
messages before merging.)
* After you click the Merge button, if you don't use "rebase and merge"
(although normally you should...), make sure that the commit message
includes the "ICU-23456 " prefix, and add a suffix like " (#65)" with
the pull request number (if it's not there already).
* Known limitation: We won't have the PR number in the commit
message(s) when using the recommended "rebase and merge" -- unless
you manually amend the commit message(s) and add it.
* You should probably check the box for deleting your dev branch after
merging.
* Remember one branch per PR. You can create multiple branches & PRs per
ticket.
* If this was the last commit to finish work on the ticket, then go to
Jira and close the ticket as Fixed.
* You can optionally have someone (probably the same person as your PR
assignee) review the ticket as well, but that's not normally necessary.
* (We normally use ticket reviews for non-code changes, such as a
non-coding task or a web site update for the User Guide etc.)
* Otherwise:
* The PR assignee should be an ICU team member, and they are responsible
both for reviewing and for merging your PR, and then also for closing
the ticket.
## Merge conflicts
When someone else has made changes that conflict with yours, then you can't
merge as is. (The GitHub pull request page will tell you if there is a
conflict.)
You need to update your fork's **main** via your local clone, rebase your local
dev branch with that, resolve conflicts as you go, and force-push to your fork.
As easy as it is in GitHub to *create* a fork, you would think that it would be
a simple button-click to *update* your fork's **main** with commits on the
Unicode **main**. If you find a way to do this, please update this section.
Switch to your local **main**.
```
git checkout main
```
### Pull from upstream
Pull updates from the Unicode main (rather than a vanilla `git pull` which
pulls form your out-of-date fork), push to your fork's main.
*Norbert’s version:*
```
git pull git@github.com:unicode-org/icu.git
git push
```
*Andy’s version:*
Once per local git repo, set up an additional "remote". Something like the
following, but this may be incomplete!
```
git remote add upstream https://github.com/unicode-org/icu.git
git pull upstream main
git push origin main
```
*Andy's Version, take 2:*
Set the local main to track the upstream (unicode-org) main instead of your
fork's main (orign). Your fork's main is effectively out of the loop.
```
# one time setup
git branch -u upstream/main
# subsequent pulls from upstream (unicode.org) main
git pull
```
### Resolve conflicts
There are two ways to do this. You can rebase, or you can create a merge commit.
The advantage of rebase is that it makes it somewhat easier to squash later on.
The advantage of creating a merge commit is that you don't have to force-push,
so it makes it easier to work across different workstations, you are less likely
to get something wrong, and it makes it easier for the reviewer because GitHub
keeps track of comment history better when shas don't change.
#### Option 1: Merge
Switch to your dev branch, then merge in main. I like to use
the --no-commit option:
```
git checkout mybranchname
git merge main --no-commit
```
If you have conflicts, resolve them. Then, review the merge commit. It should
have all changes from main that were not yet on your branch. If it looks good,
commit the merge. You can push the merge commit without having to use -f.
```
git commit
git push
```
#### Option 2: Rebase
First switch back to your dev branch (without the -b option
which is for creating a new branch).
```
git checkout mybranchname
```
Then rebase, which reapplies your branch changes on top of the new main commits.
```
git rebase main
```
Sometimes you need to manually resolve conflicts. Follow the instructions git
prints or look for help...
If it had stopped and you are done resolving conflicts, continue rebasing.
```
git rebase --continue
```
You might get conflicts at several stages; resolve & continue until done.
When done, push to your GitHub fork. You need to force-push after rebasing.
```
git push -f
```
## Update your fork
Once in a while, you should update your fork's main with changes from the
Unicode main, so that you don't fall too far behind and your new changes don't
create unnecessary merge conflicts.
Go to your local main, pull commits from the Unicode main, and push to your
GitHub fork. See the "Merge conflicts" section above for details. If you don't
have a current dev branch, you can skip the rebasing.
## Committing to Maintenance Branch
Follow these steps for adding a commit to a maintenance branch.
The process is different between when we are between RC and GA and when we are
after GA.
### Between RC and GA
When working on a commit that you know at the time of
authorship to be a candidate for the maintenance branch, write the commit and
send the PR directly against the maintenance branch. All commits on the maint
branch will be merged *from maint to main* as a BRS task (see the next section).
Check out the current maint branch:
```
git fetch upstream maint/maint-64
git checkout maint/maint-64
```
Next, make a local branch off of the maint branch. For example, to use the
branch name "ICU-12345-maint-64", you can do:
```
git checkout -b ICU-12345-maint-64
```
Now, write your change and send it for review. Open your PR against the maint
branch.
### After GA
Write the commit against the main branch, and send your own
cherry-pick commits to put it on the desired maint branches.
Update your local main from the Unicode main (see above). Otherwise your git
workspace won't recognize the commits you are trying to cherry-pick.
Make a note of the SHA hash/ID of your commit on the main branch. You will use
this later when cherry-picking into the maint branch.
* The commit ID is listed on the pull request page.
* You can use git log to see the SHA once your change is on main.
* You can look at the commit history on GitHub too.
Next, checkout the maintenance branch locally. For example, for the ICU 63
maintenance branch:
```
git fetch upstream maint/maint-64
git checkout maint/maint-64
```
Next, make a local branch off of the maint branch. This new branch will be used
for your cherry-pick.
For example, to use the branch name "ICU-12345-maint-64", you can do:
```
git checkout -b ICU-12345-maint-64
```
Next, cherry-pick the commit(s) you want to apply to the maintenance branch.
(Note: If you only have one commit to merge to the maint branch then you would
only have one command below).
```
git cherry-pick 7d99ba4
git cherry-pick e578f3f
...
```
This creates **new** commits directly onto your local branch.
Look at the output from each of these commands to double-check that you got the
intended commits.
Finally, push your branch to your fork (should be "origin"), and open a PR into
the Unicode ICU branch maint/maint-64.
```
git push -u your-fork ICU-12345-maint-64
```
The reviewer of the PR has the following special responsibilities:
1. Don't approve the PR unless ICU-TC has agreed that this should be a
maintenance fix.
2. Make sure that the PR is targeting the correct branch in the Unicode ICU
repro. (ex: maint/maint-64 ).
3. Make sure that the PR includes all commits associated with the fix, which
was already approved for main.
4. Use "Rebase and merge".
## Checking for Missing Commits (BRS Task)
It is not hard to accidentally make a commit against main that should have been
against maint. As a BRS task before tagging, you should check the list of
commits that are on main but not maint and make sure of them belong on
maint.
To get the list, run:
```
git fetch upstream
git cherry -v upstream/maint/maint-64 upstream/main
```
Commits prefixed with "+" are on main but not on the specified maint branch.
Commits prefixed with "-" are present on both branches.
Send the list to the team and discuss in the weekly meeting if there are any
problems.
## Merging from Maint to Main (BRS Task)
Merging from the maint branch to main might be as easy as opening a pull
request, without having to touch the command line. However, if there are merge
conflicts, more work will need to be done.
**The Easy Way (No Merge Conflicts):** Open a pull request on GitHub from the
maint branch to main. If it says there are no merge conflicts, congratulations!
Use a new ticket number for the PR (it is suggested to NOT use the main BRS
ticket). The new ticket should have the next release as its fix version, because
the merge commit used to pull the commits from maint to main will be in the next
release but not the current release.
You may need to add "DISABLE_JIRA_ISSUE_MATCH=true" and/or
"ALLOW_MANY_COMMITS=true" to the PR description to silence errors coming from
the Unicode bot.
You should use a MERGE COMMIT to merge from maint to main, NOT REBASE MERGE as
is normally recommended. You will need to go into the admin panel on GitHub,
enable merge commits, perform your merge commit, and then disable merge commits
again from the admin panel. When making your merge commit, remember to use the
correct commit message syntax: prefix the merge commit message with ICU-#####,
the new ticket number you created above.
**The Hard Way (Merge Conflicts):** At the end of the day, the goal is that main
should share the maint branch's history. This is done using merge commits. What
follows is an example of how to create merge commits that retain full branch
history.
Create a new branch based on the tag you want to merge:
```
git fetch upstream
git checkout main
git checkout -b 64-merge-branch  # use any name you like
```
*If you already have this branch from a previous release tag*, you could either
use a new branch, or merge the latest main into your branch:
```
git checkout 64-merge-branch
# DANGER: Please make sure your workspace is clean before proceeding!
# If it's not, you might sneak in unreviewed changes.
git merge --no-commit main
git commit -am "ICU-##### Merge tag 'main' into 64-merge-branch"
```
Now, merge in maint:
```
# DANGER: Please make sure your workspace is clean before proceeding!
# If it's not, you might sneak in unreviewed changes.
git merge --no-commit upstream/maint/maint-39
```
After running the final line, you will have the opportunity to resolve merge
conflicts. If the conflict is in a large binary file like the ICU4J data jar
files, you may need to re-generate them.
Remember to prefix your commit message with the ticket number:
```
git commit -am "ICU-##### Merge branch 'maint/maint-39' into 64-merge-branch"
git push -u origin 64-merge-branch
```
As in the Easy Way, you may need to add `DISABLE_JIRA_ISSUE_MATCH=true` and/or
`ALLOW_MANY_COMMITS=true` to the PR description to silence errors coming from
the Unicode bot.
Send the PR off for review. As in the Easy Way, **you should use the MERGE COMMIT option in GitHub to land the PR!!**
## Requesting an Exhaustive Test run on a Pull-Request (PR)
The ICU4C and ICU4J Exhaustive Tests run on the main branch after a pull-request
has been submitted. They do not run on pull-requests by default as they take 1-2
hours to run.
However, you can manually request the CI builds to run the exhaustive tests on a
PR by commenting with the following text:
```
/azp run CI-Exhaustive
```
This will trigger the test run on the PR. This is covered more in a separate
[document](https://docs.google.com/document/d/1kmcFFUozpWah_y7dk_Inlw_BIq3vG3-ZR2A28tIiXJc/edit?usp=sharing).
+1 -1
View File
@@ -1,7 +1,7 @@
---
layout: default
title: Contributors
nav_order: 1800
nav_order: 9000
has_children: true
---
<!--
+68
View File
@@ -0,0 +1,68 @@
---
layout: default
title: Skipping Known Test Failures
parent: Contributors
---
<!--
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
# Skipping Known Test Failures (logKnownIssue)
If you need a test to be disabled temporarily, call `logKnownIssue`. The method
is defined as below:
```java
/**
* Log the known issue.
* This method returns true unless -prop:logKnownIssue=no is specified
* in the argument list.
*
* @param ticket A ticket number string. For an ICU ticket, use numeric
characters only,
* such as "10245". For a CLDR ticket, use prefix "cldrbug:" followed by ticket
number,
* such as "cldrbug:5013".
* @param comment Additional comment, or null
* @return true unless -prop:logKnownIssue=no is specified in the test command
line argument.
*/
public boolean logKnownIssue(String ticket, String comment)
```
Below is an example:
```java
if (logKnownIssue("1234", "New data is not integrated yet.")) {
return;
}
// test code below
```
By default, logKnownIssue returns true and emit a log line including the link to
the ticket and the comment.
When `-prop:logKnownIssue=no` is specified as a command line argument,
`logKnownIssue()` returns false, so you can temporary enable a test code skipped
by logKnownIssue.
Before ICU4J 52, we used to use isICUVersionBefore() method like below. The test
method is still available in the trunk, but developers are suggested to use
logKnownIssue() instead.
```java
if (isICUVersionBefore(50,0,2)) {
return;
}
```
Before ICU4J 49M2, we used to use the style below -
```java
if(skipIfBeforeICU(4, 5, 2)) {
return;
}
```
@@ -1,18 +1,33 @@
---
layout: default
title: Updating ICU's built-in Break Iterator rules
parent: Contributors
---
# Updating ICU's built-in Break Iterator rules
{: .no_toc }
## Contents
{: .no_toc .text-delta }
1. TOC
{:toc}
---
<!--
Copyright (C) 2016 and later: Unicode, Inc. and others.
© 2016 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
Updating ICU's built-in Break Iterator rules
============================================
Here are instructions for updating ICU's built-in break iterator rules, for Grapheme, Word, Line and Sentence breaks.
The ICU rules implement the boundary behavior from Unicode [UAX-14](https://www.unicode.org/reports/tr14/) and [UAX-29](https://www.unicode.org/reports/tr29/), with tailorings from CLDR and some ICU-specific enhancements. ICU rules updates are needed in response to changes from Unicode or CLDR, or for bug fixes. Often ideas for CLDR or UAX updates are prototyped in ICU first, before becoming official.
This is not a cook book process. Familiarity with ICU break iterator behavior and rules is needed. Sets of break rules often interact in subtle and difficult to understand ways. Expect some bumps.
### Have clear specifications for the change.
## Have clear specifications for the change.
The changes will typically come from a proposed update to Unicode UAX 29 or UAX 14,
or from CLDR based tailorings to these specifications.
@@ -21,7 +36,7 @@ As an example, see [CLDR proposal for Extended Indic Grapheme Clusters](https://
Often ICU will implement draft versions of proposed specification updates, to check that they are complete and consistent, and to identify any issues before they are released.
### Files that typically will need to be updated:
## Files that typically will need to be updated:
| File | Contents |
@@ -35,12 +50,12 @@ Often ICU will implement draft versions of proposed specification updates, to ch
|||
| icu/icu4j/...
| .../main/shared/data/icudata.jar | Data jar, includes break rules. Derived from ICU4C.
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
| .../main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
### ICU4C
## ICU4C
The rule updates are done first for ICU4C, and then ported (code changes) or moved (data changes) to ICU4J. This order is easiest because the the break rule source files are part of the ICU4C project, as is the rule builder.
@@ -75,16 +90,16 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
probably means that some earlier change to ICU4C was not fully ported to ICU4J, and this
needs to be resolved before proceeding.
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
Should show no differrence.
Should show no difference.
2. **Run the ICU4C break iterator tests**, and verify that the newly added tests fail as expected.
(We haven't updated the rules yet)
cd icu/icu4c/source
make -j6 check
make -j -l2.5 check
To run just the RBBI Tests (you will be doing this a lot)
@@ -110,7 +125,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
For this example, the rule file is `icu4c/source/data/brkitr/rules/char.txt`.
(If the change is for word or line break, which have multiple rule files for tailorings, only update the root file at this time.)
Start by looking at how existing similar rules are being handled, and also refer to the ICU user guide section on [Break Rules](../userguide/boundaryanalysis/break-rules.md) for an explanation of rule syntax and behavior.
Start by looking at how existing similar rules are being handled, and also refer to the ICU user guide section on [Break Rules](../boundaryanalysis/break-rules) for an explanation of rule syntax and behavior.
The transformation from UAX or CLDR style rules to ICU rules can be non-trivial. Sources of difficulties include:
@@ -118,12 +133,15 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
- ICU rules match a run of text that does not have boundaries in its interior (unless the rule contains a "hard break", represented by a '/'. UAX and CLDR rules, on the other hand, tell whether a single text position is or is not a break, with the rule expressing pre and post context around that position. This transformation is generally not hard, and the ICU form of the rules is often simpler.
In the line break rules, for the most part, rules begin and end with required (non-conditional) characters of some class other than `$CM`. By convention, line break rules never chain on `$CM`. Rules beginning with a combining mark all have the form `^$CM+ $Something`, meaning that they only match at the start of text, that they can't be chained into. This helps keep the overall chaining behavior of the line break rules somewhat easier to understand.
4. **Rebuild the ICU data with the updated rules.**
cd icu4c/source/data
make
This runs the `genbrk` tool. The tool looks for a Unicode signature byte sequence and otherwise assumes the rule files are encoded as UTF-8; in the ICU source tree, rule files are encoded as UTF-8.
5. **Rerun the data-driven test**, `rbbi/TestExtended`. With luck, it may pass. Failures fall into two classes:
- The newly added test failed. Either something is wrong with the test cases, or something is wrong with the rule updates.
@@ -225,14 +243,14 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
As with the main rules, after everything appears to be working, run the rule based monkey test for an extended period of time (with loop=-1).
### ICU4J
## ICU4J
1. **Copy the Data Driven Test File to ICU4J**
Copy the file `rbbitst.txt` from ICU4C to ICU4J, and run the Java test. It should fail until the rules are updated.
cd <top level icu directory>
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
Run the test from Eclipse.
@@ -254,7 +272,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
ICU4C file to port from: `source/test/intltest/rbbitst.cpp`
ICU4J file to port to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
ICU4J file to port to: `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
To conveniently run the individual tests, look for the test functions `TestCharMonkey()`, `TestWordMonkey()`, etc. in `RBBITestMonkey.java`.
@@ -270,9 +288,9 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
ICU4C directory, to copy from: `source/test/testdata/break_rules/`
ICU4J directory, to copy to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/`
ICU4J directory, to copy to: `main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/`
Then rerun the rule based monkey test, in the file `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
Then rerun the rule based monkey test, in the file `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
Run the test(s) for the changed rules for an extended amount of time (with Dloop=-1).
+4 -5
View File
@@ -1,7 +1,6 @@
---
layout: default
title: Custom ICU4C Synchronization
nav_order: 3
parent: Contributors
---
<!--
@@ -203,8 +202,8 @@ static std::condition_variable initCondition;
// function on this thread, or wait for some other thread to complete the initialization.
//
// The actual call to the init function is made inline by template code
// that knows the C++ types involved. This function returns TRUE if
// the inline code needs to invoke the Init function, or FALSE if the initialization
// that knows the C++ types involved. This function returns true if
// the inline code needs to invoke the Init function, or false if the initialization
// has completed on another thread.
//
// UInitOnce::fState values:
@@ -217,7 +216,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
int32_t state = uio.fState;
if (state == 0) {
umtx_storeRelease(uio.fState, 1);
return TRUE; // Caller will next call the init function.
return true; // Caller will next call the init function.
} else {
while (uio.fState == 1) {
// Another thread is currently running the initialization.
@@ -225,7 +224,7 @@ UBool umtx_initImplPreInit(UInitOnce &uio) {
initCondition.wait(initLock);
}
U_ASSERT(uio.fState == 2);
return FALSE;
return false;
}
}
-1
View File
@@ -1,7 +1,6 @@
---
layout: default
title: Synchronization
nav_order: 2
parent: Contributors
---
<!--
+12 -2
View File
@@ -220,9 +220,11 @@ Note that the examples may not reflect current CLDR data.
| `F` | day of week in month | `F` | 2 (2nd Wed in July) |
| `g` | modified julian day | `g` | 2451334 |
| `E` | day of week | `E,` `EE`, or `EEE`<br/>`EEEE`<br/>`EEEEE`<br/>`EEEEEE` | Tue<br/>Tuesday<br/>T<br/>Tu |
| `e` | local day of week<br/>example: if Monday is 1st day, Tuesday is 2nd ) | `e` or `ee`<br/>`eee`<br/>`eeee`<br/>`eeeee`<br/>`eeeeee` | 2<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
| `e` | local day of week<br/>example: if Monday is 1st day, Tuesday is 2nd ) | `e`<br>`ee`<br/>`eee`<br/>`eeee`<br/>`eeeee`<br/>`eeeeee` | 2<br>02<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
| `c` | stand-alone local day of week | `c` or `cc`<br/>`ccc`<br/>`cccc`<br/>`ccccc`<br/>`cccccc` | 2<br/>Tue<br/>Tuesday<br/>T<br/>Tu |
| `a` | am/pm marker | `a` | pm |
| `a` | AM or PM | `a`, `aa`, or `aaa`<br/>`aaaa`<br/>`aaaaa` | PM [abbrev]<br/>PM [wide]<br/>p |
| `b` | am, pm, noon, midnight | `b`, `bb`, or `bbb`<br/>`bbbb`<br/>`bbbbb` | mid.<br/>midnight<br/>md |
| `B` | flexible day periods | `B`, `BB`, or `BBB`<br/>`BBBB`<br/>`BBBBB` | at night [abbrev]<br/>at night [wide]<br/>at night [narrow] |
| `h` | hour in am/pm (1~12) | `h`<br/>`hh` | 7<br/>07 |
| `H` | hour in day (0~23) | `H`<br/>`HH` | 0<br/>00 |
| `k` | hour in day (1~24) | `k`<br/>`kk` | 24<br/>24 |
@@ -340,6 +342,14 @@ patterns for different locales:
| es_ES | `"d 'de' MMMM, H:mm"` | "2 de abril, 17:00" |
| ja_JP | `"M月d日 H:mm"` | "4月2日 17:00" |
A full list of date and time symbols that can be used in skeleton strings
(input to `DateTimePatternGenerator`) can be found in the
[UTS 35 (LDML) Date Field Symbol Table](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
Note: some date time symbols are intended only for use in skeleton strings, and are not intended
to be used in pattern strings (output from `DateTimePatternGenerator`). Such symbols are noted accordingly
in the table.
The most important DateTimePatternGenerator methods are the varieties of
getBestPattern.

Some files were not shown because too many files have changed in this diff Show More