From owner-freebsd-current@freebsd.org Tue Jan 5 23:16:02 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8603EA61D22 for ; Tue, 5 Jan 2016 23:16:02 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 51B3F1A41; Tue, 5 Jan 2016 23:16:02 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3E730B805D; Wed, 6 Jan 2016 00:15:59 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 2B61D28494; Wed, 6 Jan 2016 00:15:59 +0100 (CET) Date: Wed, 6 Jan 2016 00:15:59 +0100 From: Jilles Tjoelker To: NGie Cooper Cc: FreeBSD CURRENT , Baptiste Daroussin , Dimitry Andric Subject: Re: Can't run `make universe` on universe11a.freebsd.org and ref11-amd64.freebsd.org (anymore); [shell] globbing is broken [there] Message-ID: <20160105231558.GB17031@stack.nl> References: <091C7193-4EDD-4AE4-AC52-FD62B6934440@gmail.com> <30640BF0-84F3-446D-808E-547B04E9EA53@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <30640BF0-84F3-446D-808E-547B04E9EA53@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 23:16:02 -0000 On Mon, Jan 04, 2016 at 12:08:43PM -0800, NGie Cooper wrote: > > It looks like a libc problem though, because I’ve run into this > > issue with both /bin/sh and bash (my default login shell). I’m not > > sure why this isn’t reproing on my VM (yet). > > This doesn’t repro in universe10a.freebsd.org (another jail on the > > same machine I think…). > > It was working yesterday on ref11-amd64.freebsd.org before the > > system was upgraded (it was running October sources), and wasn’t > > working on universe11a.freebsd.org yesterday (it was running > > December sources yesterday). > delphij@ pointed me in the right direction (thanks :)..). Globbing > expressions seems extremely broken with LANG set to en_US.UTF-8 [at > least]. > $ echo $LANG > en_US.UTF-8 > $ hostname > universe11a.freebsd.org > $ (unset LANG; cd sys/amd64/conf && echo [A-Z0-9]*[A-Z0-9]) > DEFAULTS GENERIC GENERIC-NODEBUG MINIMAL NOTES Traditionally, ranges in bracket expressions like A-Z meant characters that collate between A and Z, inclusive. Although this used to be in POSIX and is widely implemented, it does not make much sense. POSIX.1-2008 leaves ranges undefined in locales other than the POSIX locale. Therefore, it is an option to disable collation for ranges and just compare character codes. The problem started to occur more often with the new collation code, which supports UTF-8 and uses CLDR's different collation order, but strange results from [A-Z] can be encountered in much older versions. Bash behaves similarly to sh, but supports 'shopt -s globasciiranges' to disable collation. In some sense this is strange, an option that needs to be enabled to provide the behaviour most people expect. Alternatively, the pattern could be rewritten to be locale-sensitive: [[:upper:][:digit:]]*[[:upper:][:digit:]] -- Jilles Tjoelker