Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 May 2026 11:01:11 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        Antoine Brodin <antoine@freebsd.org>
Cc:        src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org,  Mark Johnston <markj@freebsd.org>
Subject:   Re: git: bd15d6ef126e - main - libarchive: Force GNU iconv compatibility on FreeBSD
Message-ID:  <86a4tjykko.fsf@ltc.des.dev>
In-Reply-To: <86eciwx7wg.fsf@ltc.des.dev> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Thu, 28 May 2026 10:20:15 %2B0200")
References:  <6a16eeef.475db.2283bfa4@gitrepo.freebsd.org> <CAALwa8=2idBFeqnW1aDHgcswF4Gr6QQP9S%2BgfcHksD=jAWWaPA@mail.gmail.com> <86eciwx7wg.fsf@ltc.des.dev>

index | next in thread | previous in thread | raw e-mail

Dag-Erling Smørgrav <des@FreeBSD.org> writes:
> Antoine Brodin <antoine@freebsd.org> writes:
> > Could this change break some ports?
> Your logs show that LC_COLLATE is set to C.  It should be set to
> C.UTF-8, or simply not set at all since LANG is already C.UTF-8.

Hmm, this does not appear to be the correct answer.  It looks like the
ports tree is messing with the locale:

    des@crash /usr/ports/devel/py-game% export LANG=C.UTF-8
    des@crash /usr/ports/devel/py-game% export LC_COLLATE=C
    des@crash /usr/ports/devel/py-game% locale             
    LANG=C.UTF-8
    LC_CTYPE="C.UTF-8"
    LC_COLLATE=C
    LC_TIME="C.UTF-8"
    LC_NUMERIC="C.UTF-8"
    LC_MONETARY="C.UTF-8"
    LC_MESSAGES="C.UTF-8"
    LC_ALL=
    des@crash /usr/ports/devel/py-game% tar -xf /usr/ports/distfiles/pygame-2.6.1.tar.gz -C /tmp
    des@crash /usr/ports/devel/py-game% make BATCH= extract       
    ===>  License LGPL21 accepted by the user
    ===>   py311-game-2.6.1_5 depends on file: /usr/local/sbin/pkg - found
    ===> Fetching all distfiles required by py311-game-2.6.1_5 for building
    ===>  Extracting for py311-game-2.6.1_5
    => SHA256 Checksum OK for pygame-2.6.1.tar.gz.
    tar: Pathname can't be converted from UTF-8 to current locale
    tar: Pathname can't be converted from UTF-8 to current locale
    [...]
    des@crash /usr/ports/devel/py-game% cat >/tmp/tar 
    #!/bin/sh
    locale
    exec /usr/bin/tar "$@"
    des@crash /usr/ports/devel/py-game% chmod a+rx /tmp/tar
    des@crash /usr/ports/devel/py-game% make BATCH= extract EXTRACT_CMD=/tmp/tar
    ===>  License LGPL21 accepted by the user
    ===>   py311-game-2.6.1_5 depends on file: /usr/local/sbin/pkg - found
    ===> Fetching all distfiles required by py311-game-2.6.1_5 for building
    ===>  Extracting for py311-game-2.6.1_5
    => SHA256 Checksum OK for pygame-2.6.1.tar.gz.
    LANG=C
    LC_CTYPE="C"
    LC_COLLATE="C"
    LC_TIME="C"
    LC_NUMERIC="C"
    LC_MONETARY="C"
    LC_MESSAGES="C"
    LC_ALL=C
    tar: Pathname can't be converted from UTF-8 to current locale
    tar: Pathname can't be converted from UTF-8 to current locale
    [...]
    des@crash /usr/ports/devel/py-game% cd ../..
    des@crash /usr/ports% grep -w LANG Mk/bsd.port.mk 
    # USE_LOCALE	- LANG and LC_ALL are set to the value of this variable in
    LANG=		C
    .export		LANG LC_ALL
    WRK_ENV+=	LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}

There we have it.  The ports tree should set LANG to C.UTF-8, not C.

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86a4tjykko.fsf>