Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5315928ybn; Sat, 28 Sep 2019 18:22:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5zavcE6l2RYMuIE2e+QTyAHBYtYGkfEYg9H+VMAbLCzeW9wGv9i+lT22sJI0ZlhWn8HVW X-Received: by 2002:a17:906:c738:: with SMTP id fj24mr13923659ejb.255.1569720154569; Sat, 28 Sep 2019 18:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569720154; cv=none; d=google.com; s=arc-20160816; b=o5tBgCAvUc6opaqVAesK6oQhiWpftjwrJbvMnoFLGAIyFayBJFRRJQXFn9eBbNWSpv ulp1CWx0ReVZnA2B+yZgirGKKVw0rAFigKSsik/WmYtZBtAhzy4lMqvewnyOyYosnAdZ Dcev8RK2FmCagpgqG6vG0x5mJCiO5V31DcHDE0/KWU4V1PLFm1vfGPECUEyv/bGR8W0B Lrkmo8QWvh3gLY9e+CcZVpK7AkVpLbq0WB6mVUGTsDjh7H5T48qFp5gNFNJoy/BjFwaW 5XQsfwjU58ZQStPMR75r4up9BQYLQqukSJKCYoLbaIAKdKr+Vq7xUMt2WKbP0TvjCOfT efTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=4yPJLL7texAUDBpAL8Bc7mm5wMMtuhCWLDO+NBR0H1s=; b=vBTqNs580N3YjAyiQlNu8oFX2Y4YH/2qvyeyb7VGf0eKUAtlj4Mn6/Va9dWTdSu4Sw fCLzgAPWPGP5R3tz40c8RBynxQdV/Tb1s/Y9/JhH0IG6wvutQSUmX40WAlGHMEVt7AnA 00cnqoRME8+kcYkZlEvpvVXav8/Q1zvFPgys0Aji8WaliOMVu0aXq09JTp+S2BEzQCVL CWCFCd5t1RY7+500gStAAyPv8EaUFSbtWm7NH7BSBWS+y4UxPnmqjbAw1//sNmJvC8vD fSrVb9DEtLFtmSovUyLhCS2MbTYWTTwFzAdfEAe+2biCQrK+PZ5brJz+vfyXBYLDbagO AtMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RcgKCqBL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f57si4492528ede.78.2019.09.28.18.22.09; Sat, 28 Sep 2019 18:22:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RcgKCqBL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728869AbfI2BTo (ORCPT + 99 others); Sat, 28 Sep 2019 21:19:44 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:25579 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728847AbfI2BTo (ORCPT ); Sat, 28 Sep 2019 21:19:44 -0400 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x8T1JR6K005224 for ; Sun, 29 Sep 2019 10:19:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x8T1JR6K005224 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1569719968; bh=4yPJLL7texAUDBpAL8Bc7mm5wMMtuhCWLDO+NBR0H1s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RcgKCqBLHYW+Ctdonx2TyxJVOHIEjOqQYbJXxlWeF681kL543Fp2ILrZHLSfzV+NB ZwtuPazazw8w+sYZDTDB5CBTk61PAJ0Ys67kRzWXqLGoDmUYsAWtglBWDnjaqHnvYE 5574mJ8W3iEQ0/sv3KURBli8AEJe/1bJkR5Oq3bpq7ghS3gPIg2hEXy+RZnLxtnmo+ thkykifXPxSyNdaQ+W5PsPmiQ7XFT0DX//VOmvRm7GcNyRBMotMxlCuBujJh1mEaU9 5F2RDvCpE+7UrYxveLOCdOta9h6/8JG3ieW9OvMUiFjm6LN1pjRhpGa7Qsu70ROY16 JJv+317wfgcKA== X-Nifty-SrcIP: [209.85.217.48] Received: by mail-vs1-f48.google.com with SMTP id p13so4430792vsr.4 for ; Sat, 28 Sep 2019 18:19:27 -0700 (PDT) X-Gm-Message-State: APjAAAXi+yyn4ZKUoAmIwTtWU0M/4TW7HlLNoy3aO6liStfTDtcuwE8v JrrlIoMA0tD4nQHH4ibCjo3rGyEi0ZoGdcEK4u8= X-Received: by 2002:a67:1a41:: with SMTP id a62mr6724527vsa.54.1569719966560; Sat, 28 Sep 2019 18:19:26 -0700 (PDT) MIME-Version: 1.0 References: <20190927093603.9140-1-yamada.masahiro@socionext.com> <20190927093603.9140-8-yamada.masahiro@socionext.com> <20190927132726.GB187147@google.com> <20190927181414.GB1804168@kroah.com> In-Reply-To: <20190927181414.GB1804168@kroah.com> From: Masahiro Yamada Date: Sun, 29 Sep 2019 10:18:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 7/7] nsdeps: make generated patches independent of locale To: Greg Kroah-Hartman Cc: Matthias Maennich , Jessica Yu , Joel Fernandes , Martijn Coenen , Will Deacon , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 28, 2019 at 3:14 AM Greg Kroah-Hartman wrote: > > On Sat, Sep 28, 2019 at 12:42:28AM +0900, Masahiro Yamada wrote: > > On Fri, Sep 27, 2019 at 10:27 PM Matthias Maennich wrote: > > > > > > On Fri, Sep 27, 2019 at 06:36:03PM +0900, Masahiro Yamada wrote: > > > >scripts/nsdeps automatically generates a patch to add MODULE_IMPORT_= NS > > > >tags, and what is nicer, it sorts the lines alphabetically with the > > > >"sort" command. However, the output from the "sort" command depends > > > >on locale. > > > > > > > >Especially when namespaces contain underscores, the result is > > > >different depending on the locale. > > > > > > > >For example, I got this: > > > > > > > >$ { echo usbcommon; echo usb_common; } | LANG=3Den_US.UTF-8 sort > > > >usbcommon > > > >usb_common > > > >$ { echo usbcommon; echo usb_common; } | LANG=3DC sort > > > >usb_common > > > >usbcommon > > > > > > > >So, this means people might potentially send different patches. > > > > > > > >This kind of issue was reported in the past, for example, > > > >commit f55f2328bb28 ("kbuild: make sorting initramfs contents > > > >independent of locale"). > > > > > > > >Adding "LANG=3DC" is a conventional way of fixing when a determinist= ic > > > >result is desirable. > > > > > > > >Signed-off-by: Masahiro Yamada > > > >--- > > > > > > > > scripts/nsdeps | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > >diff --git a/scripts/nsdeps b/scripts/nsdeps > > > >index 964b7fb8c546..3754dac13b31 100644 > > > >--- a/scripts/nsdeps > > > >+++ b/scripts/nsdeps > > > >@@ -41,7 +41,7 @@ generate_deps() { > > > > for source_file in $mod_source_files; do > > > > sed '/MODULE_IMPORT_NS/Q' $source_file > ${so= urce_file}.tmp > > > > offset=3D$(wc -l ${source_file}.tmp | awk '{p= rint $1;}') > > > >- cat $source_file | grep MODULE_IMPORT_NS | so= rt -u >> ${source_file}.tmp > > > >+ cat $source_file | grep MODULE_IMPORT_NS | LA= NG=3DC sort -u >> ${source_file}.tmp > > > > > > I would prefer to have this set throughout the whole runtime of the > > > script. Otherwise we likely see a followup patch. So, either as an > > > export at the beginning of this file or as part of the command that > > > calls this script. > > > > > > I prefer to keep it close to the locale-dependent code. > > > > > > > > If I move it to somewhere else, I need to add a comment like > > > > # make "sort" command deterministic > > export LANG=3DC > > > > Otherwise, people would have no idea why it is needed. > > A comment is fine, it documents why it is here and it keeps anyone from > having to remember to add it to anything else that changes in here. > > thanks, > > greg k-h Huh, people who live in a country with English as mother tongue cannot understand the i18n because English is the only language in the world? For example, in my locale (ja_JP.UTF-8) I can see messages in Japanese as follows: $ sh scripts/nsdeps cat: /modules.order: =E3=81=9D=E3=81=AE=E3=82=88=E3=81=86=E3=81=AA=E3=83=95= =E3=82=A1=E3=82=A4=E3=83=AB=E3=82=84=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3= =83=88=E3=83=AA=E3=81=AF=E3=81=82=E3=82=8A=E3=81=BE=E3=81=9B=E3=82=93 If I added "LANG=3DC" to the whole of this script, it would forcibly change all the messages into English. $ sh scripts/nsdeps cat: /modules.order: No such file or directory The impact on the locale should be really limited. So, "LANG=3DC" must be placed immediately before the "find" command. Nobody is asking to change log messages into English, and offering what was not asked is just *pushy*. -- Best Regards Masahiro Yamada