Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5665683ybn; Sun, 29 Sep 2019 03:15:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8fg0V1EXs4Im1E8c2fwparEV1yj7zloSG1OOPq5OK46yMJ2TkL9nP+mvTEp+E50OoMGnm X-Received: by 2002:a17:906:d79b:: with SMTP id pj27mr5481976ejb.148.1569752141129; Sun, 29 Sep 2019 03:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569752141; cv=none; d=google.com; s=arc-20160816; b=zPgXBCL5ULPNQNFvf74zWYBdcPrOmYOYAjXiJMIMNTooZT4qiVR81ZRuj/RR+VNTke qU9KKjs5KtwWw4Rze07BvS/GAh0usEScR/GoqmThKc8O9EtSd7pzwQizcsUDeeiKBDNs P/CzdN8cLu4Kp9kXmXWkndgiJD3PkadkjgEr/jcf+q0/88Gb0Xq9Skk1ZVTDo7rk168u IcD05Ewtn9dLgnw9ZGy7pawwvht5xMEi0mJeFFzqHk9Yyw2F+9Wr7WrbouId2gYoDE7i d+ZKJfH4ONZLxGHgO31nQNSVjL87jQEgon7+73O5n+2R5YHDouN7j5MVqS38aX2JiSH/ 1LOQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yWhycPrXrSggOefOCllgwC21YTKI9D5IyJNGoEfULJ8=; b=kpHnJtQ3JH6wUg+xqx5lfUCo8SNPsMDeddCLgldrtglRWLh8y5K+PIR2ZLUbl+ziXa OVeGIrQ/Rz7Y/7RDFFNDGlt8Vg8HSFKDcQKKG0+gOdMLdN3tVi7MI8lTl8N7c2MCii/c oMD+DVbqF68oZ9vptGHDuZEWYn/jN9an6JBvzBmYTwX3t+7bAU5UbN27Fwep7LpJbroo psaFNKnzq9Cywgb0Pqf3jJtVjpacQw6HO14cxrhc/glNBfLURfaF6Ceh4Ktrr7mHOSix P9YhzB4o01xTBbWGDbQadrCXn+bAOXrdapXNx3Og5q87eQrrLHeciChpGZoJ5qZugrbF bl3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q4JltL7V; 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 x20si5382741ejb.393.2019.09.29.03.15.16; Sun, 29 Sep 2019 03:15:41 -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=@kernel.org header.s=default header.b=q4JltL7V; 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 S1728998AbfI2KOs (ORCPT + 99 others); Sun, 29 Sep 2019 06:14:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:49164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfI2KOs (ORCPT ); Sun, 29 Sep 2019 06:14:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCE97207FA; Sun, 29 Sep 2019 10:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569752086; bh=8Ilmt/CLNGJO3WgwhjzU9NPlqv1+VuVIxmqpzgvJrO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q4JltL7V+1QSlxTnOPNGtHhMRYykzKK5bN36yC6yl9W096GR7VsJYei4pdGKiN09U m2g6NCeNYbteRTRZnxyZizRAUJMYjqVxb9f3s/9Ux7fxIe1nabPiA9DER0cOhNSuQD 3y9jLujdg+qSBUYvrNwR3udSZAkHfFa4MNNQ6YwE= Date: Sun, 29 Sep 2019 12:14:43 +0200 From: Greg Kroah-Hartman To: Masahiro Yamada Cc: Matthias Maennich , 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: <20190929101443.GB1907778@kroah.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) 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:18:50AM +0900, 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? Heh, I live in a country where English is not the "mother tongue" and I totally missed this, sorry about that :( > For example, in my locale (ja_JP.UTF-8) > > I can see messages in Japanese as follows: > > $ sh scripts/nsdeps > cat: /modules.order: そのようなファイルやディレクトリはありません Ugh, I forgot this would change the error messages from other programs. You are right, your proposal isn't ok, I missed this given that I am used to programming in English. sorry, greg k-h