linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh
@ 2022-01-10  8:59 SeongJae Park
  2022-01-10 10:13 ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: SeongJae Park @ 2022-01-10  8:59 UTC (permalink / raw)
  To: ojeda
  Cc: alex.gaynor, wedsonaf, akpm, wei.liu, linux-kernel,
	rust-for-linux, SeongJae Park

Some common tools like 'diff' don't support permissions of the files.
Due to that, 'rust-version.sh' in some trees including '-mm' result in
having no execution permission, and therefore build fails like below:

    $ make O=../linux.out/ olddefconfig
    make[1]: Entering directory 'linux.out'
      GEN     Makefile
    sh: 1: linux/scripts/rust-version.sh: Permission denied
    init/Kconfig:71: syntax error
    init/Kconfig:70: invalid statement
    linux/scripts/kconfig/Makefile:77: recipe for target 'olddefconfig' failed
    make[2]: *** [olddefconfig] Error 1
    linux/Makefile:666: recipe for target 'olddefconfig' failed
    make[1]: *** [olddefconfig] Error 2
    make[1]: Leaving directory 'linux.out'
    Makefile:226: recipe for target '__sub-make' failed
    make: *** [__sub-make] Error 2

It's not a big deal, but not so fun.  This commit works around the issue
by specifying the interpreter for 'rust-version.sh' in the Kconfig file.
The ugly work around wouldn't be needed once 'rust-version.sh' file is
merged in the mainline with the execution permission.

Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
---
Changes from v1
(https://lore.kernel.org/all/20220106123357.16220-1-sj@kernel.org/)
- Collect 'Reviewed-by:' from Wei Liu
- Specify that this is temporal workaround and when it can be reverted
  (Miguel Ojeda)

 init/Kconfig | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index cd23faa163d1..d3707b9f222c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -67,7 +67,13 @@ config HAS_RUST
 config RUSTC_VERSION
 	depends on HAS_RUST
 	int
-	default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))
+	# Because some common tools like 'diff' don't support permissions of
+	# the files, 'rust-version.sh' in some trees that managed with such
+	# tools result in having no execution permission.  As a temporal work
+	# around, we specify the interpreter ('/bin/sh').  It will be unneeded
+	# once 'rust-version.sh' is merged in the mainline with its execution
+	# permission.
+	default $(shell,/bin/sh $(srctree)/scripts/rust-version.sh $(RUSTC))
 
 config CC_CAN_LINK
 	bool
-- 
2.17.1


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

* Re: [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh
  2022-01-10  8:59 [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh SeongJae Park
@ 2022-01-10 10:13 ` Miguel Ojeda
  2022-01-12  0:32   ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2022-01-10 10:13 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Andrew Morton,
	Wei Liu, linux-kernel, rust-for-linux

On Mon, Jan 10, 2022 at 9:59 AM SeongJae Park <sj@kernel.org> wrote:
>
> Some common tools like 'diff' don't support permissions of the files.

Picking it up, thanks!

Cheers,
Miguel

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

* Re: [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh
  2022-01-10 10:13 ` Miguel Ojeda
@ 2022-01-12  0:32   ` Miguel Ojeda
  2022-01-12  7:43     ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2022-01-12  0:32 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Andrew Morton,
	Wei Liu, linux-kernel, rust-for-linux

On Mon, Jan 10, 2022 at 11:13 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Picking it up, thanks!

This is now in linux-next (Jan 11) -- hopefully it is now better for you!

I will carry the patch in our rust-next branch but I won't put it in
the patch series, this way we won't need to revert it when merged into
mainline.

Cheers,
Miguel

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

* Re: [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh
  2022-01-12  0:32   ` Miguel Ojeda
@ 2022-01-12  7:43     ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2022-01-12  7:43 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: SeongJae Park, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Andrew Morton, Wei Liu, linux-kernel, rust-for-linux

On Wed, 12 Jan 2022 01:32:20 +0100 Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:

> On Mon, Jan 10, 2022 at 11:13 AM Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
> >
> > Picking it up, thanks!
> 
> This is now in linux-next (Jan 11) -- hopefully it is now better for you!

Confirmed that, thank you! :)

> 
> I will carry the patch in our rust-next branch but I won't put it in
> the patch series, this way we won't need to revert it when merged into
> mainline.

Sure.  Looking forward to the day!


Thanks,
SJ

> 
> Cheers,
> Miguel

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

end of thread, other threads:[~2022-01-12  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10  8:59 [PATCH v2 for-rust-for-linux] init/Kconfig: Specify the interpreter for rust-version.sh SeongJae Park
2022-01-10 10:13 ` Miguel Ojeda
2022-01-12  0:32   ` Miguel Ojeda
2022-01-12  7:43     ` SeongJae Park

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).