linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: replace LANG=C with LC_ALL=C
@ 2021-04-30  1:56 Masahiro Yamada
  2021-04-30  6:02 ` Greg KH
       [not found] ` <162162208791.14477.6963689219198766644.git-patchwork-notify@kernel.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-04-30  1:56 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, Michael Ellerman, Matthias Maennich,
	Matthieu Baerts, Benjamin Herrenschmidt, David S. Miller,
	Jakub Kicinski, Mat Martineau, Paul Mackerras, Shuah Khan,
	linux-kernel, linux-kselftest, linuxppc-dev, mptcp, netdev

LANG gives a weak default to each LC_* in case it is not explicitly
defined. LC_ALL, if set, overrides all other LC_* variables.

  LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL

This is why documentation such as [1] suggests to set LC_ALL in build
scripts to get the deterministic result.

LANG=C is not strong enough to override LC_* that may be set by end
users.

[1]: https://reproducible-builds.org/docs/locales/

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Matthias Maennich <maennich@google.com>
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net> (mptcp)
---

Changes in v2:
 - rebase

 arch/powerpc/boot/wrapper                          | 2 +-
 scripts/nsdeps                                     | 2 +-
 scripts/recordmcount.pl                            | 2 +-
 scripts/setlocalversion                            | 2 +-
 scripts/tags.sh                                    | 2 +-
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +-
 usr/gen_initramfs.sh                               | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 41fa0a8715e3..cdb796b76e2e 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -191,7 +191,7 @@ if [ -z "$kernel" ]; then
     kernel=vmlinux
 fi
 
-LANG=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
+LC_ALL=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
 case "$elfformat" in
     elf64-powerpcle)	format=elf64lppc	;;
     elf64-powerpc)	format=elf32ppc	;;
diff --git a/scripts/nsdeps b/scripts/nsdeps
index e8ce2a4d704a..04c4b96e95ec 100644
--- a/scripts/nsdeps
+++ b/scripts/nsdeps
@@ -44,7 +44,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 | LANG=C sort -u >> ${source_file}.tmp
+			cat $source_file | grep MODULE_IMPORT_NS | LC_ALL=C sort -u >> ${source_file}.tmp
 			tail -n +$((offset +1)) ${source_file} | grep -v MODULE_IMPORT_NS >> ${source_file}.tmp
 			if ! diff -q ${source_file} ${source_file}.tmp; then
 				mv ${source_file}.tmp ${source_file}
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 867860ea57da..0a7fc9507d6f 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -497,7 +497,7 @@ sub update_funcs
 #
 # Step 2: find the sections and mcount call sites
 #
-open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
+open(IN, "LC_ALL=C $objdump -hdr $inputfile|") || die "error running $objdump";
 
 my $text;
 
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index bb709eda96cd..db941f6d9591 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -126,7 +126,7 @@ scm_version()
 	fi
 
 	# Check for svn and a svn repo.
-	if rev=$(LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'); then
+	if rev=$(LC_ALL=C svn info 2>/dev/null | grep '^Last Changed Rev'); then
 		rev=$(echo $rev | awk '{print $NF}')
 		printf -- '-svn%s' "$rev"
 
diff --git a/scripts/tags.sh b/scripts/tags.sh
index fd96734deff1..db8ba411860a 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -326,5 +326,5 @@ esac
 
 # Remove structure forward declarations.
 if [ -n "$remove_structs" ]; then
-    LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
+    LC_ALL=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
 fi
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
index 9236609731b1..3c4cb72ed8a4 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
@@ -274,7 +274,7 @@ check_mptcp_disabled()
 	ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0
 
 	local err=0
-	LANG=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \
+	LC_ALL=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \
 		grep -q "^socket: Protocol not available$" && err=1
 	ip netns delete ${disabled_ns}
 
diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
index 8ae831657e5d..63476bb70b41 100755
--- a/usr/gen_initramfs.sh
+++ b/usr/gen_initramfs.sh
@@ -147,7 +147,7 @@ dir_filelist() {
 	header "$1"
 
 	srcdir=$(echo "$1" | sed -e 's://*:/:g')
-	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LANG=C sort)
+	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LC_ALL=C sort)
 
 	# If $dirlist is only one line, then the directory is empty
 	if [  "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kbuild: replace LANG=C with LC_ALL=C
  2021-04-30  1:56 [PATCH v2] kbuild: replace LANG=C with LC_ALL=C Masahiro Yamada
@ 2021-04-30  6:02 ` Greg KH
       [not found] ` <162162208791.14477.6963689219198766644.git-patchwork-notify@kernel.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-04-30  6:02 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Michael Ellerman, Matthias Maennich,
	Matthieu Baerts, Benjamin Herrenschmidt, David S. Miller,
	Jakub Kicinski, Mat Martineau, Paul Mackerras, Shuah Khan,
	linux-kernel, linux-kselftest, linuxppc-dev, mptcp, netdev

On Fri, Apr 30, 2021 at 10:56:27AM +0900, Masahiro Yamada wrote:
> LANG gives a weak default to each LC_* in case it is not explicitly
> defined. LC_ALL, if set, overrides all other LC_* variables.
> 
>   LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL
> 
> This is why documentation such as [1] suggests to set LC_ALL in build
> scripts to get the deterministic result.
> 
> LANG=C is not strong enough to override LC_* that may be set by end
> users.
> 
> [1]: https://reproducible-builds.org/docs/locales/
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
> Reviewed-by: Matthias Maennich <maennich@google.com>
> Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net> (mptcp)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kbuild: replace LANG=C with LC_ALL=C
       [not found] ` <162162208791.14477.6963689219198766644.git-patchwork-notify@kernel.org>
@ 2021-05-22  2:14   ` Masahiro Yamada
  2021-05-22  2:22     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-05-22  2:14 UTC (permalink / raw)
  To: patchwork-bot+linux-kselftest, Shuah Khan, Linux Kernel Mailing List

On Sat, May 22, 2021 at 3:34 AM
<patchwork-bot+linux-kselftest@kernel.org> wrote:
>
> Hello:
>
> This patch was applied to shuah/linux-kselftest.git (refs/heads/next):
>
> On Fri, 30 Apr 2021 10:56:27 +0900 you wrote:
> > LANG gives a weak default to each LC_* in case it is not explicitly
> > defined. LC_ALL, if set, overrides all other LC_* variables.
> >
> >   LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL
> >
> > This is why documentation such as [1] suggests to set LC_ALL in build
> > scripts to get the deterministic result.
> >
> > [...]
>
> Here is the summary with links:
>   - [v2] kbuild: replace LANG=C with LC_ALL=C
>     https://git.kernel.org/shuah/linux-kselftest/c/77a88274dc1a
>
> You are awesome, thank you!
> --


Huh?

This patch exists in Linus' tree.

Why is this going to the kselftest tree
in the first place?



commit 77a88274dc1a2cf3a775161d9a3242bc798ee680
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Fri Apr 30 10:56:27 2021 +0900

    kbuild: replace LANG=C with LC_ALL=C

    LANG gives a weak default to each LC_* in case it is not explicitly
    defined. LC_ALL, if set, overrides all other LC_* variables.

      LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL

    This is why documentation such as [1] suggests to set LC_ALL in build
    scripts to get the deterministic result.

    LANG=C is not strong enough to override LC_* that may be set by end
    users.

    [1]: https://reproducible-builds.org/docs/locales/

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
    Reviewed-by: Matthias Maennich <maennich@google.com>
    Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net> (mptcp)
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>






--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kbuild: replace LANG=C with LC_ALL=C
  2021-05-22  2:14   ` Masahiro Yamada
@ 2021-05-22  2:22     ` Masahiro Yamada
  2021-05-24 16:03       ` Shuah Khan
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-05-22  2:22 UTC (permalink / raw)
  To: patchwork-bot+linux-kselftest, Shuah Khan, Linux Kernel Mailing List

On Sat, May 22, 2021 at 11:14 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sat, May 22, 2021 at 3:34 AM
> <patchwork-bot+linux-kselftest@kernel.org> wrote:
> >
> > Hello:
> >
> > This patch was applied to shuah/linux-kselftest.git (refs/heads/next):
> >
> > On Fri, 30 Apr 2021 10:56:27 +0900 you wrote:
> > > LANG gives a weak default to each LC_* in case it is not explicitly
> > > defined. LC_ALL, if set, overrides all other LC_* variables.
> > >
> > >   LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL
> > >
> > > This is why documentation such as [1] suggests to set LC_ALL in build
> > > scripts to get the deterministic result.
> > >
> > > [...]
> >
> > Here is the summary with links:
> >   - [v2] kbuild: replace LANG=C with LC_ALL=C
> >     https://git.kernel.org/shuah/linux-kselftest/c/77a88274dc1a
> >
> > You are awesome, thank you!
> > --
>
>
> Huh?
>
> This patch exists in Linus' tree.
>
> Why is this going to the kselftest tree
> in the first place?


Sorry, I misunderstood it.

I think this notification was unneeded
because the commit was not actually
applied to kselftest tree.


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] kbuild: replace LANG=C with LC_ALL=C
  2021-05-22  2:22     ` Masahiro Yamada
@ 2021-05-24 16:03       ` Shuah Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Shuah Khan @ 2021-05-24 16:03 UTC (permalink / raw)
  To: Masahiro Yamada, patchwork-bot+linux-kselftest,
	Linux Kernel Mailing List, Shuah Khan

On 5/21/21 8:22 PM, Masahiro Yamada wrote:
> On Sat, May 22, 2021 at 11:14 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> On Sat, May 22, 2021 at 3:34 AM
>> <patchwork-bot+linux-kselftest@kernel.org> wrote:
>>>
>>> Hello:
>>>
>>> This patch was applied to shuah/linux-kselftest.git (refs/heads/next):
>>>
>>> On Fri, 30 Apr 2021 10:56:27 +0900 you wrote:
>>>> LANG gives a weak default to each LC_* in case it is not explicitly
>>>> defined. LC_ALL, if set, overrides all other LC_* variables.
>>>>
>>>>    LANG  <  LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC, ...  <  LC_ALL
>>>>
>>>> This is why documentation such as [1] suggests to set LC_ALL in build
>>>> scripts to get the deterministic result.
>>>>
>>>> [...]
>>>
>>> Here is the summary with links:
>>>    - [v2] kbuild: replace LANG=C with LC_ALL=C
>>>      https://git.kernel.org/shuah/linux-kselftest/c/77a88274dc1a
>>>
>>> You are awesome, thank you!
>>> --
>>
>>
>> Huh?
>>
>> This patch exists in Linus' tree.
>>
>> Why is this going to the kselftest tree
>> in the first place?
> 
> 
> Sorry, I misunderstood it.
> 
> I think this notification was unneeded
> because the commit was not actually
> applied to kselftest tree.
> 

When I rebase kselftest tree, patchwork-bot generates this unnecessary
notification. I have been procrastinating looking into how to disable
this. This confusion is a good enough reason to get to it asap. :)

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-24 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30  1:56 [PATCH v2] kbuild: replace LANG=C with LC_ALL=C Masahiro Yamada
2021-04-30  6:02 ` Greg KH
     [not found] ` <162162208791.14477.6963689219198766644.git-patchwork-notify@kernel.org>
2021-05-22  2:14   ` Masahiro Yamada
2021-05-22  2:22     ` Masahiro Yamada
2021-05-24 16:03       ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).