rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init/Kconfig: Specify the interpreter for rust-version.sh
@ 2022-01-06 12:33 SeongJae Park
  2022-01-06 12:59 ` Wei Liu
  2022-01-09 20:38 ` Miguel Ojeda
  0 siblings, 2 replies; 4+ messages in thread
From: SeongJae Park @ 2022-01-06 12:33 UTC (permalink / raw)
  To: ojeda
  Cc: alex.gaynor, wedsonaf, akpm, 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 fixes the issue by
specifying the interpreter for 'rust-version.sh' in the Kconfig file.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index cd23faa163d1..97ab35692d46 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -67,7 +67,7 @@ config HAS_RUST
 config RUSTC_VERSION
 	depends on HAS_RUST
 	int
-	default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))
+	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] init/Kconfig: Specify the interpreter for rust-version.sh
  2022-01-06 12:33 [PATCH] init/Kconfig: Specify the interpreter for rust-version.sh SeongJae Park
@ 2022-01-06 12:59 ` Wei Liu
  2022-01-09 20:38 ` Miguel Ojeda
  1 sibling, 0 replies; 4+ messages in thread
From: Wei Liu @ 2022-01-06 12:59 UTC (permalink / raw)
  To: SeongJae Park
  Cc: ojeda, alex.gaynor, wedsonaf, akpm, linux-kernel, rust-for-linux,
	Wei Liu

On Thu, Jan 06, 2022 at 12:33:57PM +0000, SeongJae Park wrote:
> 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 fixes the issue by
> specifying the interpreter for 'rust-version.sh' in the Kconfig file.
> 
> Signed-off-by: SeongJae Park <sj@kernel.org>

Reviewed-by: Wei Liu <wei.liu@kernel.org>

> ---
>  init/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/init/Kconfig b/init/Kconfig
> index cd23faa163d1..97ab35692d46 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -67,7 +67,7 @@ config HAS_RUST
>  config RUSTC_VERSION
>  	depends on HAS_RUST
>  	int
> -	default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))
> +	default $(shell,/bin/sh $(srctree)/scripts/rust-version.sh $(RUSTC))
>  
>  config CC_CAN_LINK
>  	bool
> -- 
> 2.17.1
> 

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

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

On Thu, Jan 6, 2022 at 1:34 PM SeongJae Park <sj@kernel.org> wrote:
>
> 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:

Do you mean the Quilt workflow? From a quick look:

https://lists.nongnu.org/archive/html/quilt-dev/2008-01/msg00000.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749069

Is that the issue? I am surprised it loses that information...

> It's not a big deal, but not so fun.  This commit fixes the issue by
> specifying the interpreter for 'rust-version.sh' in the Kconfig file.

Other script calls do not do that, so I would prefer to avoid it. But
I can take it temporarily to help you (until we are in mainline, if I
understand correctly the issue), but I would prefer to have a comment
nearby it justifying the workaround and explaining when we can remove
it.

Cheers,
Miguel

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

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

On Sun, 9 Jan 2022 21:38:40 +0100 Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:

> On Thu, Jan 6, 2022 at 1:34 PM SeongJae Park <sj@kernel.org> wrote:
> >
> > 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:
> 
> Do you mean the Quilt workflow? From a quick look:
> 
> https://lists.nongnu.org/archive/html/quilt-dev/2008-01/msg00000.html
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749069
> 
> Is that the issue? I am surprised it loses that information...

Right.  I once encountered similar issue with DAMON kselftest[1], and as a
result we made kselftest deals with such case[2].

[1] https://lore.kernel.org/mm-commits/YRJisBs9AunccCD4@kroah.com/
[2] https://lore.kernel.org/linux-kselftest/20210810164534.25902-1-sj38.park@gmail.com/

> 
> > It's not a big deal, but not so fun.  This commit fixes the issue by
> > specifying the interpreter for 'rust-version.sh' in the Kconfig file.
> 
> Other script calls do not do that, so I would prefer to avoid it. But
> I can take it temporarily to help you (until we are in mainline, if I
> understand correctly the issue), but I would prefer to have a comment
> nearby it justifying the workaround and explaining when we can remove
> it.

Fully agreed.  I will send v2 with the comment.


Thanks,
SJ

> 
> Cheers,
> Miguel
> 

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 12:33 [PATCH] init/Kconfig: Specify the interpreter for rust-version.sh SeongJae Park
2022-01-06 12:59 ` Wei Liu
2022-01-09 20:38 ` Miguel Ojeda
2022-01-10  8:41   ` 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).