All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] t: use user-specific utf-8 locale for testing
Date: Thu, 3 Jun 2021 15:27:37 -0400	[thread overview]
Message-ID: <YLktKeMXoZ/6wHqT@coredump.intra.peff.net> (raw)
In-Reply-To: <20210602114646.17463-1-congdanhqx@gmail.com>

On Wed, Jun 02, 2021 at 06:46:46PM +0700, Đoàn Trần Công Danh wrote:

> In some test-cases, utf-8 locale is required. To find such locale,
> we're using the first available UTF-8 locale that returned by
> "locale -a".
> 
> Despite being required by POSIX, locale(1) is unavailable in some
> systems, e.g. Linux with musl libc.  Some of those systems support
> utf-8 locale out of the box.
> 
> However, without "locale -a", we can't guess provided UTF-8 locale.
> 
> Let's give users of those systems an option to have better test
> coverage.

That makes sense. At first I thought this was fixing a test breakage,
and wondered if we should simply be skipping the tests. But after
reading more carefully, we already are doing that, and this is just
allowing those tests to run in more places (you even said so in the last
sentence above, but I missed it, so I am calling it out).

I kind of wonder if trying "C.UTF-8" would be a reasonable fallback so
that people don't even have to set this extra Makefile knob. But I'm not
sure if we have a good way of testing if that locale works (if we can't
find the "locale" binary). So this is probably a reasonable medium
ground.

> ---
>  Makefile                                 |  6 ++++++
>  t/lib-git-svn.sh                         | 15 +++++++++------
>  t/t9100-git-svn-basic.sh                 | 14 +++-----------
>  t/t9115-git-svn-dcommit-funky-renames.sh |  6 +++---
>  t/t9129-git-svn-i18n-commitencoding.sh   |  4 ++--
>  5 files changed, 23 insertions(+), 22 deletions(-)

I think we test musl in our ci builds; should we do something like:

diff --git a/ci/lib.sh b/ci/lib.sh
index d848c036c5..ec67398c18 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -229,6 +229,7 @@ linux-musl)
 	CC=gcc
 	MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes"
 	MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
+	MAKEFLAGS="$MAKEFLAGS GIT_TEST_UTF8_LOCALE=something.UTF-8?"
 	;;
 esac
 

here, too (I don't know what the correct "something" is here; maybe
"C")?

-Peff

  parent reply	other threads:[~2021-06-03 19:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 11:46 [PATCH] t: use user-specific utf-8 locale for testing Đoàn Trần Công Danh
2021-06-02 19:56 ` Taylor Blau
2021-06-08 10:49   ` Ævar Arnfjörð Bjarmason
2021-06-03 19:27 ` Jeff King [this message]
2021-06-04  3:32 ` Bagas Sanjaya
2021-06-04  5:20   ` Đoàn Trần Công Danh
2021-06-06 16:33 ` [PATCH v2] " Đoàn Trần Công Danh
2021-06-06 20:06   ` Torsten Bögershausen
2021-06-07  0:20     ` Junio C Hamano
2021-06-07  0:48 ` [PATCH v3] t: use pre-defined utf-8 locale for testing svn Đoàn Trần Công Danh
2021-06-07  1:01   ` Junio C Hamano
2021-06-07 14:38     ` Torsten Bögershausen
2021-06-07 15:42       ` Đoàn Trần Công Danh
2021-06-08  6:35     ` Jeff King
2021-06-08  6:45       ` Đoàn Trần Công Danh
2021-06-07  1:08 ` [PATCH v4] t: use user-specified " Đoàn Trần Công Danh
2021-06-08  6:38   ` Jeff King
2021-06-08  6:56 ` [PATCH v5] " Đoàn Trần Công Danh
2021-06-08  7:26   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLktKeMXoZ/6wHqT@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.