Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
@ 2024-06-05  3:49 Richard Acayan
  2024-06-05  5:45 ` Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Richard Acayan @ 2024-06-05  3:49 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Kent Overstreet, linux-kbuild
  Cc: Richard Acayan

In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
script"), the mksysmap script was transformed into a sed script,
made directly executable with "#!/bin/sed -f". Apparently, the path to
sed is different on NixOS, fixed by using the env command.

To accommodate the number of arguments above the normal maximum for
hashbangs, the -S flag of env was used (as in
"#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
Explicitly use sed instead of relying on the executable shebang to keep
compatibility with build environments using Busybox.

Fixes: 973eca8db557 ("kbuild: mksysmap now works on nixos")
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
 scripts/link-vmlinux.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 46ce5d04dbeb..518c70b8db50 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -193,7 +193,7 @@ kallsyms_step()
 mksysmap()
 {
 	info NM ${2}
-	${NM} -n "${1}" | "${srctree}/scripts/mksysmap" > "${2}"
+	${NM} -n "${1}" | sed -f "${srctree}/scripts/mksysmap" > "${2}"
 }
 
 sorttable()
-- 
2.45.2


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

* Re: [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
  2024-06-05  3:49 [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh Richard Acayan
@ 2024-06-05  5:45 ` Masahiro Yamada
  2024-06-05 13:05 ` Masahiro Yamada
  2024-06-06 23:14 ` Dmitry Safonov
  2 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2024-06-05  5:45 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Nathan Chancellor, Nicolas Schier, Kent Overstreet, linux-kbuild

On Wed, Jun 5, 2024 at 12:49 PM Richard Acayan <mailingradian@gmail.com> wrote:
>
> In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
> script"), the mksysmap script was transformed into a sed script,
> made directly executable with "#!/bin/sed -f". Apparently, the path to
> sed is different on NixOS, fixed by using the env command.
>
> To accommodate the number of arguments above the normal maximum for
> hashbangs, the -S flag of env was used (as in
> "#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
> Explicitly use sed instead of relying on the executable shebang to keep
> compatibility with build environments using Busybox.
>
> Fixes: 973eca8db557 ("kbuild: mksysmap now works on nixos")


There is no 973eca8db557 in my tree.

I do not even see it in ML.

Where did it come from, and where will it go?




commit 973eca8db5570dd0c3f2b3190867138cc446eb3b
Author:     Kent Overstreet <kent.overstreet@linux.dev>
AuthorDate: Sun Jun 2 23:13:35 2024 -0400
Commit:     Kent Overstreet <kent.overstreet@linux.dev>
CommitDate: Sun Jun 2 23:23:47 2024 -0400

    kbuild: mksysmap now works on nixos

    Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

diff --git a/scripts/mksysmap b/scripts/mksysmap
index c12723a04655..835cccf8e7de 100755
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -1,4 +1,4 @@
-#!/bin/sed -f
+#!/usr/bin/env -S sed -f
 # SPDX-License-Identifier: GPL-2.0-only
 #
 # sed script to filter out symbols that are not needed for System.map,









-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
  2024-06-05  3:49 [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh Richard Acayan
  2024-06-05  5:45 ` Masahiro Yamada
@ 2024-06-05 13:05 ` Masahiro Yamada
  2024-06-05 13:07   ` Kent Overstreet
  2024-06-06 23:14 ` Dmitry Safonov
  2 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2024-06-05 13:05 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Nathan Chancellor, Nicolas Schier, Kent Overstreet, linux-kbuild

On Wed, Jun 5, 2024 at 12:49 PM Richard Acayan <mailingradian@gmail.com> wrote:
>
> In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
> script"), the mksysmap script was transformed into a sed script,
> made directly executable with "#!/bin/sed -f". Apparently, the path to
> sed is different on NixOS, fixed by using the env command.
>
> To accommodate the number of arguments above the normal maximum for
> hashbangs, the -S flag of env was used (as in
> "#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
> Explicitly use sed instead of relying on the executable shebang to keep
> compatibility with build environments using Busybox.


I am fine with the code.

Kent will drop his local commit, so please reword the commit description
without 973eca8db557 in mind.



> Fixes: 973eca8db557 ("kbuild: mksysmap now works on nixos")


Please replace this tag with:

Fixes: b18b047002b7 ("kbuild: change scripts/mksysmap into sed script")



Thanks.







> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---
>  scripts/link-vmlinux.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index 46ce5d04dbeb..518c70b8db50 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -193,7 +193,7 @@ kallsyms_step()
>  mksysmap()
>  {
>         info NM ${2}
> -       ${NM} -n "${1}" | "${srctree}/scripts/mksysmap" > "${2}"
> +       ${NM} -n "${1}" | sed -f "${srctree}/scripts/mksysmap" > "${2}"
>  }
>
>  sorttable()
> --
> 2.45.2
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
  2024-06-05 13:05 ` Masahiro Yamada
@ 2024-06-05 13:07   ` Kent Overstreet
  2024-06-05 17:56     ` Richard Acayan
  0 siblings, 1 reply; 6+ messages in thread
From: Kent Overstreet @ 2024-06-05 13:07 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Richard Acayan, Nathan Chancellor, Nicolas Schier, linux-kbuild

On Wed, Jun 05, 2024 at 10:05:22PM +0900, Masahiro Yamada wrote:
> On Wed, Jun 5, 2024 at 12:49 PM Richard Acayan <mailingradian@gmail.com> wrote:
> >
> > In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
> > script"), the mksysmap script was transformed into a sed script,
> > made directly executable with "#!/bin/sed -f". Apparently, the path to
> > sed is different on NixOS, fixed by using the env command.
> >
> > To accommodate the number of arguments above the normal maximum for
> > hashbangs, the -S flag of env was used (as in
> > "#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
> > Explicitly use sed instead of relying on the executable shebang to keep
> > compatibility with build environments using Busybox.
> 
> 
> I am fine with the code.
> 
> Kent will drop his local commit, so please reword the commit description
> without 973eca8db557 in mind.

Sorry for the hassle - glad this is fixed

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

* Re: [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
  2024-06-05 13:07   ` Kent Overstreet
@ 2024-06-05 17:56     ` Richard Acayan
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Acayan @ 2024-06-05 17:56 UTC (permalink / raw)
  To: Kent Overstreet
  Cc: Masahiro Yamada, Nathan Chancellor, Nicolas Schier, linux-kbuild

On Wed, Jun 05, 2024 at 09:07:26AM -0400, Kent Overstreet wrote:
> On Wed, Jun 05, 2024 at 10:05:22PM +0900, Masahiro Yamada wrote:
> > On Wed, Jun 5, 2024 at 12:49 PM Richard Acayan <mailingradian@gmail.com> wrote:
> > >
> > > In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
> > > script"), the mksysmap script was transformed into a sed script,
> > > made directly executable with "#!/bin/sed -f". Apparently, the path to
> > > sed is different on NixOS, fixed by using the env command.
> > >
> > > To accommodate the number of arguments above the normal maximum for
> > > hashbangs, the -S flag of env was used (as in
> > > "#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
> > > Explicitly use sed instead of relying on the executable shebang to keep
> > > compatibility with build environments using Busybox.
> > 
> > 
> > I am fine with the code.
> > 
> > Kent will drop his local commit, so please reword the commit description
> > without 973eca8db557 in mind.
> 
> Sorry for the hassle - glad this is fixed

All good :). I'm just happy that the maintainers are still listening to
developers compiling linux-next on Alpine Linux.

You can optionally attach a reporter tag in v2 since you reported the
original bug.

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

* [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh
  2024-06-05  3:49 [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh Richard Acayan
  2024-06-05  5:45 ` Masahiro Yamada
  2024-06-05 13:05 ` Masahiro Yamada
@ 2024-06-06 23:14 ` Dmitry Safonov
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Safonov @ 2024-06-06 23:14 UTC (permalink / raw)
  To: mailingradian
  Cc: kent.overstreet, linux-kbuild, masahiroy, nathan, nicolas,
	Dmitry Safonov

On Wed, Jun 5, 2024 at 12:49 PM Richard Acayan <mailingradian@gmail.com> wrote:
>
> In commit b18b047002b7 ("kbuild: change scripts/mksysmap into sed
> script"), the mksysmap script was transformed into a sed script,
> made directly executable with "#!/bin/sed -f". Apparently, the path to
> sed is different on NixOS, fixed by using the env command.
> 
> To accommodate the number of arguments above the normal maximum for
> hashbangs, the -S flag of env was used (as in
> "#!/usr/bin/env -S sed -f"). However, env -S is a GNU extension.
> Explicitly use sed instead of relying on the executable shebang to keep
> compatibility with build environments using Busybox.
> 
> Fixes: 973eca8db557 ("kbuild: mksysmap now works on nixos")
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>

Thanks! Fixes the build on my nix system as well.
Tested-by: Dmitry Safonov <0x7f454c46@gmail.com>

> ---
>  scripts/link-vmlinux.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index 46ce5d04dbeb..518c70b8db50 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -193,7 +193,7 @@ kallsyms_step()
>  mksysmap()
>  {
>  	info NM ${2}
> -	${NM} -n "${1}" | "${srctree}/scripts/mksysmap" > "${2}"
> +	${NM} -n "${1}" | sed -f "${srctree}/scripts/mksysmap" > "${2}"
>  }
>  
>  sorttable()

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

end of thread, other threads:[~2024-06-06 23:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05  3:49 [PATCH -next] kbuild: explicitly run mksysmap as sed script from link-vmlinux.sh Richard Acayan
2024-06-05  5:45 ` Masahiro Yamada
2024-06-05 13:05 ` Masahiro Yamada
2024-06-05 13:07   ` Kent Overstreet
2024-06-05 17:56     ` Richard Acayan
2024-06-06 23:14 ` Dmitry Safonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox