public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use /bin/sh as shebang in gdb/make-init-c
@ 2021-07-13  0:19 Lancelot SIX
  2021-07-13  0:42 ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Lancelot SIX @ 2021-07-13  0:19 UTC (permalink / raw)
  To: gdb-patches; +Cc: brobecker, Lancelot SIX

While testing the NixOS[1] packaging for gdb-11.0.90.tar.xz, I got the
following error:

  […]
  CXX    aarch32-tdep.o
  CXX    gdb.o
  GEN    init.c
  /nix/store/26a78ync552m8j4sbjavhvkmnqir8c9y-bash-4.4-p23/bin/bash: ./make-init-c: /usr/bin/env: bad interpreter: No such file or directory
  make[2]: *** [Makefile:1866: stamp-init] Error 126
  make[2]: *** Waiting for unfinished jobs....
  make[2]: Leaving directory '/build/gdb-11.0.90/gdb'
  make[1]: *** [Makefile:9814: all-gdb] Error 2
  make[1]: Leaving directory '/build/gdb-11.0.90'
  make: *** [Makefile:903: all] Error 2
  builder for '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed with exit code 2
  error: build of '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed

In the nix build environment, /usr/bin/env is not present, only /bin/sh
is.  This patch makes sure that gdb/make-init-c uses '/bin/sh' as
interpreter as this is the only one available on this platform.

I do not think this change will cause regressions on any other
configuration, but feedbacks on portability with regard to this issue
are welcome.

This patch is intended for both master and gdb-11-branch.

[1] https://nixos.org/

gdb/Changelog

	* make-init-c: Use /bin/sh as shebang.
---
 gdb/make-init-c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/make-init-c b/gdb/make-init-c
index e3c5985f133..d8630591c89 100755
--- a/gdb/make-init-c
+++ b/gdb/make-init-c
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/bin/sh
 
 # Copyright (C) 2013-2021 Free Software Foundation, Inc.
 #
-- 
2.31.1


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

* Re: [PATCH] Use /bin/sh as shebang in gdb/make-init-c
  2021-07-13  0:19 [PATCH] Use /bin/sh as shebang in gdb/make-init-c Lancelot SIX
@ 2021-07-13  0:42 ` Simon Marchi
  2021-07-13 22:11   ` Lancelot SIX
  2021-07-17 18:34   ` Joel Brobecker
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Marchi @ 2021-07-13  0:42 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches; +Cc: brobecker



On 2021-07-12 8:19 p.m., Lancelot SIX via Gdb-patches wrote:
> While testing the NixOS[1] packaging for gdb-11.0.90.tar.xz, I got the
> following error:
> 
>   […]
>   CXX    aarch32-tdep.o
>   CXX    gdb.o
>   GEN    init.c
>   /nix/store/26a78ync552m8j4sbjavhvkmnqir8c9y-bash-4.4-p23/bin/bash: ./make-init-c: /usr/bin/env: bad interpreter: No such file or directory
>   make[2]: *** [Makefile:1866: stamp-init] Error 126
>   make[2]: *** Waiting for unfinished jobs....
>   make[2]: Leaving directory '/build/gdb-11.0.90/gdb'
>   make[1]: *** [Makefile:9814: all-gdb] Error 2
>   make[1]: Leaving directory '/build/gdb-11.0.90'
>   make: *** [Makefile:903: all] Error 2
>   builder for '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed with exit code 2
>   error: build of '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed
> 
> In the nix build environment, /usr/bin/env is not present, only /bin/sh
> is.  This patch makes sure that gdb/make-init-c uses '/bin/sh' as
> interpreter as this is the only one available on this platform.
> 
> I do not think this change will cause regressions on any other
> configuration, but feedbacks on portability with regard to this issue
> are welcome.
> 
> This patch is intended for both master and gdb-11-branch.
> 
> [1] https://nixos.org/
> 
> gdb/Changelog
> 
> 	* make-init-c: Use /bin/sh as shebang.
> ---
>  gdb/make-init-c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/make-init-c b/gdb/make-init-c
> index e3c5985f133..d8630591c89 100755
> --- a/gdb/make-init-c
> +++ b/gdb/make-init-c
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env sh
> +#!/bin/sh
>  
>  # Copyright (C) 2013-2021 Free Software Foundation, Inc.
>  #
> 

This is ok.  I didn't use /usr/bin/env for a particular reason, it's
just by habit.

Simon

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

* Re: [PATCH] Use /bin/sh as shebang in gdb/make-init-c
  2021-07-13  0:42 ` Simon Marchi
@ 2021-07-13 22:11   ` Lancelot SIX
  2021-07-17 18:34   ` Joel Brobecker
  1 sibling, 0 replies; 5+ messages in thread
From: Lancelot SIX @ 2021-07-13 22:11 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches, brobecker

Hi,

I have pushed this commit to both master and gdb-11-branch (with a
changelog entry for the latter).

Thanks,
Lancelot.

On Mon, Jul 12, 2021 at 08:42:59PM -0400, Simon Marchi via Gdb-patches wrote:
> 
> 
> On 2021-07-12 8:19 p.m., Lancelot SIX via Gdb-patches wrote:
> > While testing the NixOS[1] packaging for gdb-11.0.90.tar.xz, I got the
> > following error:
> > 
> >   […]
> >   CXX    aarch32-tdep.o
> >   CXX    gdb.o
> >   GEN    init.c
> >   /nix/store/26a78ync552m8j4sbjavhvkmnqir8c9y-bash-4.4-p23/bin/bash: ./make-init-c: /usr/bin/env: bad interpreter: No such file or directory
> >   make[2]: *** [Makefile:1866: stamp-init] Error 126
> >   make[2]: *** Waiting for unfinished jobs....
> >   make[2]: Leaving directory '/build/gdb-11.0.90/gdb'
> >   make[1]: *** [Makefile:9814: all-gdb] Error 2
> >   make[1]: Leaving directory '/build/gdb-11.0.90'
> >   make: *** [Makefile:903: all] Error 2
> >   builder for '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed with exit code 2
> >   error: build of '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed
> > 
> > In the nix build environment, /usr/bin/env is not present, only /bin/sh
> > is.  This patch makes sure that gdb/make-init-c uses '/bin/sh' as
> > interpreter as this is the only one available on this platform.
> > 
> > I do not think this change will cause regressions on any other
> > configuration, but feedbacks on portability with regard to this issue
> > are welcome.
> > 
> > This patch is intended for both master and gdb-11-branch.
> > 
> > [1] https://nixos.org/
> > 
> > gdb/Changelog
> > 
> > 	* make-init-c: Use /bin/sh as shebang.
> > ---
> >  gdb/make-init-c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/gdb/make-init-c b/gdb/make-init-c
> > index e3c5985f133..d8630591c89 100755
> > --- a/gdb/make-init-c
> > +++ b/gdb/make-init-c
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env sh
> > +#!/bin/sh
> >  
> >  # Copyright (C) 2013-2021 Free Software Foundation, Inc.
> >  #
> > 
> 
> This is ok.  I didn't use /usr/bin/env for a particular reason, it's
> just by habit.
> 
> Simon

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

* Re: [PATCH] Use /bin/sh as shebang in gdb/make-init-c
  2021-07-13  0:42 ` Simon Marchi
  2021-07-13 22:11   ` Lancelot SIX
@ 2021-07-17 18:34   ` Joel Brobecker
  2021-07-18  2:45     ` Simon Marchi
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2021-07-17 18:34 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Lancelot SIX, gdb-patches, brobecker

> > diff --git a/gdb/make-init-c b/gdb/make-init-c
> > index e3c5985f133..d8630591c89 100755
> > --- a/gdb/make-init-c
> > +++ b/gdb/make-init-c
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env sh
> > +#!/bin/sh
> >  
> >  # Copyright (C) 2013-2021 Free Software Foundation, Inc.
> >  #
> > 
> 
> This is ok.  I didn't use /usr/bin/env for a particular reason, it's
> just by habit.

Maybe what we could be doing is make sure that the Makefile calls
the script using $SHELL?

-- 
Joel

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

* Re: [PATCH] Use /bin/sh as shebang in gdb/make-init-c
  2021-07-17 18:34   ` Joel Brobecker
@ 2021-07-18  2:45     ` Simon Marchi
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Marchi @ 2021-07-18  2:45 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Lancelot SIX, gdb-patches



On 2021-07-17 2:34 p.m., Joel Brobecker wrote:
>>> diff --git a/gdb/make-init-c b/gdb/make-init-c
>>> index e3c5985f133..d8630591c89 100755
>>> --- a/gdb/make-init-c
>>> +++ b/gdb/make-init-c
>>> @@ -1,4 +1,4 @@
>>> -#!/usr/bin/env sh
>>> +#!/bin/sh
>>>  
>>>  # Copyright (C) 2013-2021 Free Software Foundation, Inc.
>>>  #
>>>
>>
>> This is ok.  I didn't use /usr/bin/env for a particular reason, it's
>> just by habit.
> 
> Maybe what we could be doing is make sure that the Makefile calls
> the script using $SHELL?
> 

That would be fine with me.

Simon

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

end of thread, other threads:[~2021-07-18  2:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  0:19 [PATCH] Use /bin/sh as shebang in gdb/make-init-c Lancelot SIX
2021-07-13  0:42 ` Simon Marchi
2021-07-13 22:11   ` Lancelot SIX
2021-07-17 18:34   ` Joel Brobecker
2021-07-18  2:45     ` Simon Marchi

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 read-only IMAP folder(s) and NNTP newsgroup(s).