From 32072d0f7d5a42cd718d97c61446f14142c32305 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Wed, 5 Mar 2025 13:49:35 -0800 Subject: [PATCH 01/15] Update fw_icu4c_ci.yml --- .github/workflows/fw_icu4c_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index ecbf5fba0dbe..c4dce36fab02 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -164,7 +164,7 @@ jobs: --dists "xenial focal bionic" \ --arches "amd64" \ --main-package-name "icu-fw" \ - --supported-distros "xenial focal bionic" \ + --supported-distros "noble xenial focal bionic" \ --package-version ${version} \ --preserve-changelog \ --build-in-place @@ -174,7 +174,7 @@ jobs: --dists "xenial focal bionic" \ --arches "amd64" \ --main-package-name "icu-fw" \ - --supported-distros "xenial focal bionic" \ + --supported-distros "noble xenial focal bionic" \ --build-in-place \ --no-upload' From 5fef84be3a0ca919fd2296516a0ce536d72f36f9 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Wed, 5 Mar 2025 15:07:36 -0800 Subject: [PATCH 02/15] Update GitHub Actions to latest versions --- .github/workflows/fw_icu4c_ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index c4dce36fab02..30ba5a5e477c 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -23,7 +23,7 @@ jobs: version: ${{ steps.calc-version.outputs.result }} steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 @@ -47,13 +47,13 @@ jobs: echo "Version ${{ needs.set-version-number.outputs.version }}" - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe (Windows OS) - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 - name: Build ICU 32 bit working-directory: icu4c @@ -89,7 +89,7 @@ jobs: run: msbuild nugetpackage/build/icu4c.proj /t:BuildPackage /p:PkgVersion=${{ needs.set-version-number.outputs.version }} - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: packages path: ./**/*.nupkg @@ -107,7 +107,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 @@ -130,7 +130,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4.2.2 - name: Checkout ci-build-tools run: | @@ -144,7 +144,7 @@ jobs: # TODO more will need done to do this successfully since some files are root readable only - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: /var/lib/schroot/chroots key: icu-debian-package-${{ github.ref_name }} @@ -179,7 +179,7 @@ jobs: --no-upload' - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: linux-packages path: | From a23f1b66b6766134da701fc9755683ec273dfcec Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Wed, 5 Mar 2025 17:45:47 -0800 Subject: [PATCH 03/15] Add noble in a couple more places --- .github/workflows/fw_icu4c_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 30ba5a5e477c..13b6c262ae5d 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -161,7 +161,7 @@ jobs: cd "${WORKSPACE}/" version="${{needs.set-version-number.outputs.version}}${{ env.package_suffix }}" ${CI_SCRIPT_DIR}/bash/make-source \ - --dists "xenial focal bionic" \ + --dists "noble xenial focal bionic" \ --arches "amd64" \ --main-package-name "icu-fw" \ --supported-distros "noble xenial focal bionic" \ @@ -171,7 +171,7 @@ jobs: mv --verbose ../icu-fw* . sudo sbuild-adduser runner sg sbuild '${CI_SCRIPT_DIR}/bash/build-package \ - --dists "xenial focal bionic" \ + --dists "noble xenial focal bionic" \ --arches "amd64" \ --main-package-name "icu-fw" \ --supported-distros "noble xenial focal bionic" \ From c1fc052c81b836ffe33206978290d2817c87ca68 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Thu, 6 Mar 2025 12:15:34 -0800 Subject: [PATCH 04/15] Update .github/workflows/fw_icu4c_ci.yml Co-authored-by: Eberhard Beilharz --- .github/workflows/fw_icu4c_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 13b6c262ae5d..61f601a37dd9 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -174,7 +174,7 @@ jobs: --dists "noble xenial focal bionic" \ --arches "amd64" \ --main-package-name "icu-fw" \ - --supported-distros "noble xenial focal bionic" \ + --supported-distros "noble jammy" \ --build-in-place \ --no-upload' From 2e6d82b56737bc4689ba96aeb6d6fad44a66f7ec Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Thu, 6 Mar 2025 12:15:43 -0800 Subject: [PATCH 05/15] Update .github/workflows/fw_icu4c_ci.yml Co-authored-by: Eberhard Beilharz --- .github/workflows/fw_icu4c_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 61f601a37dd9..8a07c770c0d5 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -161,7 +161,7 @@ jobs: cd "${WORKSPACE}/" version="${{needs.set-version-number.outputs.version}}${{ env.package_suffix }}" ${CI_SCRIPT_DIR}/bash/make-source \ - --dists "noble xenial focal bionic" \ + --dists "noble jammy" \ --arches "amd64" \ --main-package-name "icu-fw" \ --supported-distros "noble xenial focal bionic" \ From f90ca5392509e167134f2810fa71216e0bf71a1b Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Thu, 6 Mar 2025 12:15:51 -0800 Subject: [PATCH 06/15] Update .github/workflows/fw_icu4c_ci.yml Co-authored-by: Eberhard Beilharz --- .github/workflows/fw_icu4c_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 8a07c770c0d5..e592fba154f3 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -164,7 +164,7 @@ jobs: --dists "noble jammy" \ --arches "amd64" \ --main-package-name "icu-fw" \ - --supported-distros "noble xenial focal bionic" \ + --supported-distros "noble jammy" \ --package-version ${version} \ --preserve-changelog \ --build-in-place From cfb1029eb704f4e738fa69e1328082cabceaaef8 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Thu, 6 Mar 2025 12:17:41 -0800 Subject: [PATCH 07/15] Update .github/workflows/fw_icu4c_ci.yml Co-authored-by: Eberhard Beilharz --- .github/workflows/fw_icu4c_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index e592fba154f3..4b74dc1bbcb5 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -171,7 +171,7 @@ jobs: mv --verbose ../icu-fw* . sudo sbuild-adduser runner sg sbuild '${CI_SCRIPT_DIR}/bash/build-package \ - --dists "noble xenial focal bionic" \ + --dists "noble jammy" \ --arches "amd64" \ --main-package-name "icu-fw" \ --supported-distros "noble jammy" \ From cff099c3622e980d23502f7109b93583092dad6d Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Fri, 7 Mar 2025 12:24:04 +0100 Subject: [PATCH 08/15] chore: remove group password It seems that with Ubuntu 24.04 the sbuild group has a password set. This change removes the password so that we can use the `sg sbuild` command without providing a password. --- .github/workflows/fw_icu4c_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 4b74dc1bbcb5..1e517cd32286 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -170,6 +170,7 @@ jobs: --build-in-place mv --verbose ../icu-fw* . sudo sbuild-adduser runner + sudo gpasswd --remove-password sbuild sg sbuild '${CI_SCRIPT_DIR}/bash/build-package \ --dists "noble jammy" \ --arches "amd64" \ From 4293209d8de6e5a46029a82826190268966813c5 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Fri, 7 Mar 2025 09:36:43 -0800 Subject: [PATCH 09/15] Add universe in repository to debian packaging step --- .github/workflows/fw_icu4c_ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 1e517cd32286..7a67356145f9 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -132,6 +132,9 @@ jobs: - name: Checkout uses: actions/checkout@v4.2.2 + - name: Install prerequisites + run: sudo add-apt-repository --component universe + - name: Checkout ci-build-tools run: | set -xueo pipefail @@ -154,6 +157,7 @@ jobs: WORKAREA: /home/runner/work/${{github.event.repository.name}} run: | set -xueo pipefail + sudo add-apt-repository --component universe sudo apt-get install -y devscripts dh-make sendmail sbuild mkdir --verbose --parents ~/.gnupg export WORKSPACE="${WORKAREA}/icu/icu4c" From 0801a38b4eece0ce0a181f8fd9dbdbed180679e5 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Fri, 7 Mar 2025 10:08:36 -0800 Subject: [PATCH 10/15] Update after adding the new repositories --- .github/workflows/fw_icu4c_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 7a67356145f9..9fa44ed16114 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -158,6 +158,7 @@ jobs: run: | set -xueo pipefail sudo add-apt-repository --component universe + sudo apt update sudo apt-get install -y devscripts dh-make sendmail sbuild mkdir --verbose --parents ~/.gnupg export WORKSPACE="${WORKAREA}/icu/icu4c" From 4414f582a7b88d5f0e9a216e61bb4c6a60bb6405 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Fri, 14 Mar 2025 09:32:35 -0700 Subject: [PATCH 11/15] Update after adding in the prerequisites step --- .github/workflows/fw_icu4c_ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 9fa44ed16114..7dfd185d693b 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -133,7 +133,9 @@ jobs: uses: actions/checkout@v4.2.2 - name: Install prerequisites - run: sudo add-apt-repository --component universe + run: | + sudo add-apt-repository --component universe + sudo apt-get update - name: Checkout ci-build-tools run: | @@ -159,7 +161,7 @@ jobs: set -xueo pipefail sudo add-apt-repository --component universe sudo apt update - sudo apt-get install -y devscripts dh-make sendmail sbuild + sudo apt-get install -y ubuntu-dev-tools devscripts dh-make sendmail sbuild mkdir --verbose --parents ~/.gnupg export WORKSPACE="${WORKAREA}/icu/icu4c" export CI_SCRIPT_DIR="${WORKAREA}/ci-builder-scripts" From a23e895951380451f0e9f9010debbf8fbd237ed5 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Mon, 3 Aug 2026 16:44:10 +0700 Subject: [PATCH 12/15] Refresh CI actions and keep noble/jammy packaging. Bump checkout, artifact, cache, and setup-msbuild to current majors and replace deprecated set-output so the noble packaging PR can run on today's runners. Co-authored-by: Cursor --- .github/workflows/fw_icu4c_ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 7dfd185d693b..5e2382deb766 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -23,7 +23,7 @@ jobs: version: ${{ steps.calc-version.outputs.result }} steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -33,7 +33,7 @@ jobs: major=$(grep -oP '.*U_ICU_VERSION_MAJOR_NUM \K.*' icu4c/source/common/unicode/uvernum.h) minor=$(grep -oP '.*U_ICU_VERSION_MINOR_NUM \K.*' icu4c/source/common/unicode/uvernum.h) build=${{ github.run_number }} - echo "::set-output name=result::$major.$minor.$build" + echo "result=$major.$minor.$build" >> "$GITHUB_OUTPUT" win-build-test-package: needs: set-version-number @@ -47,13 +47,13 @@ jobs: echo "Version ${{ needs.set-version-number.outputs.version }}" - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v7 with: fetch-depth: 0 # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe (Windows OS) - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 - name: Build ICU 32 bit working-directory: icu4c @@ -89,7 +89,7 @@ jobs: run: msbuild nugetpackage/build/icu4c.proj /t:BuildPackage /p:PkgVersion=${{ needs.set-version-number.outputs.version }} - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: packages path: ./**/*.nupkg @@ -107,7 +107,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -130,7 +130,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v7 - name: Install prerequisites run: | @@ -145,11 +145,11 @@ jobs: - name: Set experimental Suffix for PR Builds if: github.event_name != 'push' - run: echo "package_suffix=.experimental" >> $GITHUB_ENV + run: echo "package_suffix=.experimental" >> $GITHUB_ENV # TODO more will need done to do this successfully since some files are root readable only - name: Cache - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: /var/lib/schroot/chroots key: icu-debian-package-${{ github.ref_name }} @@ -160,7 +160,7 @@ jobs: run: | set -xueo pipefail sudo add-apt-repository --component universe - sudo apt update + sudo apt-get update sudo apt-get install -y ubuntu-dev-tools devscripts dh-make sendmail sbuild mkdir --verbose --parents ~/.gnupg export WORKSPACE="${WORKAREA}/icu/icu4c" @@ -187,7 +187,7 @@ jobs: --no-upload' - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: linux-packages path: | From 6d3eab3c1471282d48de97ed23f6fb02f83e8a99 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Mon, 3 Aug 2026 16:55:20 +0700 Subject: [PATCH 13/15] Fix debian packaging abort when ~/.gnupg already exists. ci-builder-scripts setup.sh returns non-zero from a set -e guarded test after installing .sbuildrc if the gnupg dir was pre-created. Co-authored-by: Cursor --- .github/workflows/fw_icu4c_ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 5e2382deb766..ae2897cf78f8 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -162,7 +162,6 @@ jobs: sudo add-apt-repository --component universe sudo apt-get update sudo apt-get install -y ubuntu-dev-tools devscripts dh-make sendmail sbuild - mkdir --verbose --parents ~/.gnupg export WORKSPACE="${WORKAREA}/icu/icu4c" export CI_SCRIPT_DIR="${WORKAREA}/ci-builder-scripts" cd "${WORKSPACE}/" @@ -178,6 +177,8 @@ jobs: mv --verbose ../icu-fw* . sudo sbuild-adduser runner sudo gpasswd --remove-password sbuild + # Do not pre-create ~/.gnupg: ci-builder-scripts setup.sh ends with + # `[ ! -d ~/.gnupg ] && mkdir ...` and set -e aborts if the dir exists. sg sbuild '${CI_SCRIPT_DIR}/bash/build-package \ --dists "noble jammy" \ --arches "amd64" \ From 6d6d6f896d7954d6519e23d5c0c5e65963f7e018 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Tue, 4 Aug 2026 09:26:39 +0700 Subject: [PATCH 14/15] Fix FW CI failures from runner drift and multi-distro packaging. Pin Windows builds to windows-2022 to avoid Chinese calendar test failures on Server 2025/VS2026, and build noble/jammy packages separately so setup.sh does not abort on an existing ~/.gnupg. Co-authored-by: Cursor --- .github/workflows/fw_icu4c_ci.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index ae2897cf78f8..7d201f706457 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -39,7 +39,9 @@ jobs: needs: set-version-number strategy: fail-fast: false - runs-on: windows-latest + # Pin to windows-2022: windows-latest is now Server 2025 / VS2026, which + # breaks ICU 70 DataDrivenCalendarTest Chinese calendar month rolls. + runs-on: windows-2022 steps: - name: Verify Version @@ -177,15 +179,21 @@ jobs: mv --verbose ../icu-fw* . sudo sbuild-adduser runner sudo gpasswd --remove-password sbuild - # Do not pre-create ~/.gnupg: ci-builder-scripts setup.sh ends with - # `[ ! -d ~/.gnupg ] && mkdir ...` and set -e aborts if the dir exists. - sg sbuild '${CI_SCRIPT_DIR}/bash/build-package \ - --dists "noble jammy" \ - --arches "amd64" \ - --main-package-name "icu-fw" \ - --supported-distros "noble jammy" \ - --build-in-place \ - --no-upload' + # ci-builder-scripts setup.sh ends checkAndInstallRequirements with + # `[ ! -d ~/.gnupg ] && mkdir ...`. Under set -e that returns 1 when + # ~/.gnupg already exists, so creating a second chroot in one + # build-package invocation aborts. Build one distro at a time and + # clear ~/.gnupg between runs. Do not pre-create ~/.gnupg either. + for dist in noble jammy; do + rm -rf "${HOME}/.gnupg" + sg sbuild "${CI_SCRIPT_DIR}/bash/build-package \ + --dists ${dist} \ + --arches amd64 \ + --main-package-name icu-fw \ + --supported-distros 'noble jammy' \ + --build-in-place \ + --no-upload" + done - name: Upload Artifacts uses: actions/upload-artifact@v7 From 425cf17c0d81fc48efe8a07e13b811388c8c1b9b Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Tue, 4 Aug 2026 10:50:38 +0700 Subject: [PATCH 15/15] Fix ChineseCalendar roll using stale isLeapYear after month-start resolve. handleComputeMonthStart already restored MONTH/IS_LEAP_MONTH but left isLeapYear clobbered, so VS2026 get() paths made month rolls use the wrong year length. Also restore windows-latest now that the root cause is fixed. Co-authored-by: Cursor --- .github/workflows/fw_icu4c_ci.yml | 4 +--- icu4c/source/i18n/chnsecal.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fw_icu4c_ci.yml b/.github/workflows/fw_icu4c_ci.yml index 7d201f706457..07042587af15 100644 --- a/.github/workflows/fw_icu4c_ci.yml +++ b/.github/workflows/fw_icu4c_ci.yml @@ -39,9 +39,7 @@ jobs: needs: set-version-number strategy: fail-fast: false - # Pin to windows-2022: windows-latest is now Server 2025 / VS2026, which - # breaks ICU 70 DataDrivenCalendarTest Chinese calendar month rolls. - runs-on: windows-2022 + runs-on: windows-latest steps: - name: Verify Version diff --git a/icu4c/source/i18n/chnsecal.cpp b/icu4c/source/i18n/chnsecal.cpp index f8fb4a40f142..9512d93dbba0 100644 --- a/icu4c/source/i18n/chnsecal.cpp +++ b/icu4c/source/i18n/chnsecal.cpp @@ -338,9 +338,13 @@ int32_t ChineseCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, U int32_t julianDay = newMoon + kEpochStartAsJulianDay; - // Save fields for later restoration + // Save fields for later restoration. computeChineseFields() also updates + // the isLeapYear member as a side effect; restore that too so callers like + // roll() that depend on leap-year state for the current date are not + // corrupted when get() resolves month starts for other months. int32_t saveMonth = internalGet(UCAL_MONTH); int32_t saveIsLeapMonth = internalGet(UCAL_IS_LEAP_MONTH); + UBool saveIsLeapYear = isLeapYear; // Ignore IS_LEAP_MONTH field if useMonth is false int32_t isLeapMonth = useMonth ? saveIsLeapMonth : 0; @@ -350,7 +354,7 @@ int32_t ChineseCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, U if (U_FAILURE(status)) return 0; - // This will modify the MONTH and IS_LEAP_MONTH fields (only) + // This will modify the MONTH and IS_LEAP_MONTH and isLeapYear fields (only) nonConstThis->computeChineseFields(newMoon, getGregorianYear(), getGregorianMonth(), FALSE); @@ -362,6 +366,7 @@ int32_t ChineseCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, U nonConstThis->internalSet(UCAL_MONTH, saveMonth); nonConstThis->internalSet(UCAL_IS_LEAP_MONTH, saveIsLeapMonth); + nonConstThis->isLeapYear = saveIsLeapYear; return julianDay - 1; }