Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp8825003pjb; Tue, 1 Oct 2019 04:49:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhCMBgrW6EddvWvv/98xKLcfEW1xYmAr4vhElWh3HoCnVVehr9NVV3dQikVhQ9/B9ZM5p1 X-Received: by 2002:a05:6402:1a4c:: with SMTP id bf12mr25089558edb.277.1569930557495; Tue, 01 Oct 2019 04:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569930557; cv=none; d=google.com; s=arc-20160816; b=jvyl1rgxjepcUixjkl91g7YZzx09R6AvIurRjkeS/z6NLgyVFjl6GG6hA5uvx9g06p kU0ZjQ42KMh4uBM9G7ythLnq9MBxV03DJ9lrwlMzBUtvGusQgEheAPpCQQq8heiYfGQA tNn/TmePGMjRnuEn7NbUdPxpQbHklbViqux9BDXOjb5I6rSBAyLKN/p5kBabzoEmVqNO mdiRtEgjIrmpOGSsUnvIE+T/N3Mk4gW14BPoARcguESWnTfU3mJ/hxQPrSzEjaabYtDv oNid6Vmxn9TsFSPmJbji8mo9O/eAarQYE5Eg1r8T1osRlf8uJmY+a0b3FoEWD3eJGQBj qWnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tHjd4gdm3EYFGi3d7rmzjd8b5ATclswBSBj6pNCCuo4=; b=GSYyAzRtOHRwLPnWVXiuSfaZHxUceDP3raSCBJ4RVkkRbx6ROxA4eUuMec4QKRs1cg lpmTr4VkBLT9Do3Dq9ejlN6HTHsFHo8BRsgw19t8hopKragpbmhoCbO1CCzw1ogOPd8H Znp8nJU2rj/VJMSipOxb77zMYgV2ZtXo0D8kZeJhZQ11Frds2foY3jX4/SRaXxrwbYTU iLiy5YQSh2t6oN1ZQgK9MqHW1Kj05wlvGdo8RsxmbN20wUzMilmtkdT2WTcp+XK5xGAA OqAikrU/QTXZ0YBpnSQFzVEXm+a7/NwIGsk4Q0pij2Op15AzgjsxdGtrgB4utkldPfcr xC1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kfciGDgz; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id va7si8820228ejb.4.2019.10.01.04.48.52; Tue, 01 Oct 2019 04:49:17 -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=@google.com header.s=20161025 header.b=kfciGDgz; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732423AbfJALq6 (ORCPT + 99 others); Tue, 1 Oct 2019 07:46:58 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35842 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbfJALq6 (ORCPT ); Tue, 1 Oct 2019 07:46:58 -0400 Received: by mail-wr1-f66.google.com with SMTP id y19so15124587wrd.3 for ; Tue, 01 Oct 2019 04:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tHjd4gdm3EYFGi3d7rmzjd8b5ATclswBSBj6pNCCuo4=; b=kfciGDgzcbaaC6jbn/MEfpcIelhCq/8Viax15KDJ/dEjFRgs3d6HGdVqnwJ6TP0Nho yEut+/LNh913bWcoyUPFLl4suF6Od4JiwL1grkZnNKZO5JM98REp/0NYVMhmgzsUD/nl Wql9TpKS0HL5O3cuqqI6JEW9qg+QrjmiO44y0nkL60CIr18juoq6MjkocLglse3fDTDr fnz1TKLdHH1lQH8OXSHmWxVZ8cOgvUtjW2hbcFBm3jv0N2E5oLL9KopTlYFU2D0rxgMo JbvmbqiCWEBAY3I0piPM93sixY51FivvPRhfs5GYiiUAc/UF308ADpOu45T41IuSfpSr MEgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tHjd4gdm3EYFGi3d7rmzjd8b5ATclswBSBj6pNCCuo4=; b=q4XTKm6fs5YRc1+oHaJp97wSec7eGtTMu44UVI+MJdLuu/yScwvTBprIh/knTzm4wE CNg27FaJLtwmRM51llYlhgpROHFDiiJZ5R8SXWOf5JPJZn83XdAnHF3AsJKmip1s7KGt nUh4MDZkEvTwpc01JLZy5eh+LaepC6XFSpCfKaM7uBfkJV6kFWeUECY39j3y44lIbbVh O27b+upyXL0H+55n9Sh9U5SRwd3saxVtYySHVdBQuzVaQRlSIsiuGxYyJjO35b1QJ7PT ZTx2x91DvOLs/DSoZ45xAnKfu9wMBtlhFoOJ4wXlY1Hdk6GSwEvejZO+XcSwnme6l1Wi 9Qlw== X-Gm-Message-State: APjAAAUpOETMzIEjbzAJxw6UW/G0zAU7lq4iASgcq4XzS7mDYAfdQ46s a13VyfrMsoRofh1ejCCot2mskA== X-Received: by 2002:adf:f647:: with SMTP id x7mr16224883wrp.379.1569930415118; Tue, 01 Oct 2019 04:46:55 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id f83sm2546641wmf.43.2019.10.01.04.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2019 04:46:54 -0700 (PDT) Date: Tue, 1 Oct 2019 12:46:52 +0100 From: Matthias Maennich To: Masahiro Yamada Cc: Greg Kroah-Hartman , Jessica Yu , Joel Fernandes , Martijn Coenen , Will Deacon , Linux Kernel Mailing List Subject: Re: [PATCH 7/7] nsdeps: make generated patches independent of locale Message-ID: <20191001114652.GD253280@google.com> References: <20190927093603.9140-1-yamada.masahiro@socionext.com> <20190927093603.9140-8-yamada.masahiro@socionext.com> <20190927132726.GB187147@google.com> <20190927181414.GB1804168@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 29, 2019 at 10:30:27AM +0900, Masahiro Yamada wrote: >On Sun, Sep 29, 2019 at 10:18 AM Masahiro Yamada > wrote: >> >> 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=en_US.UTF-8 sort >> > > > >usbcommon >> > > > >usb_common >> > > > >$ { echo usbcommon; echo usb_common; } | LANG=C 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=C" is a conventional way of fixing when a deterministic >> > > > >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 > ${source_file}.tmp >> > > > > offset=$(wc -l ${source_file}.tmp | awk '{print $1;}') >> > > > >- cat $source_file | grep MODULE_IMPORT_NS | sort -u >> ${source_file}.tmp >> > > > >+ cat $source_file | grep MODULE_IMPORT_NS | LANG=C 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=C >> > > >> > > 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? > >I take back this comment. >I actually do not know where you live, or what native language you speak. >It was used to exaggerate things, but It is not important to >the point of discussions. Sorry. Thanks for pointing this out and reminding us! I am not a native English speaker, but often are surrounded by English, especially when programming. Error messages in my native language feel often rather funny than helpful, but I guess this not the case for most translations. Based on that I am ok with your original version of the patch. Cheers, Matthias