From eeb07567c545a3dd06774d9d2f92f1365d75eaf9 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 4 Jan 2025 22:06:13 +0900 Subject: [PATCH] Adjust locales --- ci/docker/alpine-linux-3.18-cpp.dockerfile | 3 ++- cpp/src/arrow/compute/kernels/scalar_temporal_test.cc | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ci/docker/alpine-linux-3.18-cpp.dockerfile b/ci/docker/alpine-linux-3.18-cpp.dockerfile index 84b36e5d2a717..60815b7e55d77 100644 --- a/ci/docker/alpine-linux-3.18-cpp.dockerfile +++ b/ci/docker/alpine-linux-3.18-cpp.dockerfile @@ -100,4 +100,5 @@ ENV ARROW_ACERO=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ - PATH=/usr/lib/ccache/:$PATH + MUSL_LOCPATH=/usr/share/i18n/locales/musl \ + PATH=/usr/lib/ccache/bin:$PATH diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal_test.cc b/cpp/src/arrow/compute/kernels/scalar_temporal_test.cc index 8da8c760ea22b..7fc60c0a6ac27 100644 --- a/cpp/src/arrow/compute/kernels/scalar_temporal_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_temporal_test.cc @@ -2154,13 +2154,22 @@ TEST_F(ScalarTemporalTest, StrftimeOtherLocale) { auto options = StrftimeOptions("%d %B %Y %H:%M:%S", "fr_FR.UTF-8"); const char* milliseconds = R"( ["1970-01-01T00:00:59.123", "2021-08-18T15:11:50.456", null])"; +#ifdef ARROW_WITH_MUSL + // musl-locales uses Capital case for month name. + const char* expected = R"( + ["01 Janvier 1970 00:00:59,123", "18 Août 2021 15:11:50,456", null])"; +#else const char* expected = R"( ["01 janvier 1970 00:00:59,123", "18 août 2021 15:11:50,456", null])"; +#endif CheckScalarUnary("strftime", timestamp(TimeUnit::MILLI, "UTC"), milliseconds, utf8(), expected, &options); } TEST_F(ScalarTemporalTest, StrftimeInvalidLocale) { +#ifdef ARROW_WITH_MUSL + GTEST_SKIP() << "musl doesn't report an error for invalid locale"; +#endif #ifdef __EMSCRIPTEN__ GTEST_SKIP() << "Emscripten doesn't build with multiple locales as default"; #endif