qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
@ 2023-11-23 21:15 Samuel Tardieu
  2023-11-23 21:18 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Samuel Tardieu @ 2023-11-23 21:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Samuel Tardieu, Alessandro Di Federico,
	Anton Johansson

This file is the only one involved in the compilation process which
still uses the /bin/bash path.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 target/hexagon/idef-parser/prepare | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/hexagon/idef-parser/prepare b/target/hexagon/idef-parser/prepare
index 72d6fcbd21..cb3622d4f8 100755
--- a/target/hexagon/idef-parser/prepare
+++ b/target/hexagon/idef-parser/prepare
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 #  Copyright(c) 2019-2021 rev.ng Labs Srl. All Rights Reserved.
-- 
2.42.0



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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
  2023-11-23 21:15 [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash Samuel Tardieu
@ 2023-11-23 21:18 ` Philippe Mathieu-Daudé
  2023-11-24 11:10 ` Anton Johansson via
  2023-11-28 13:14 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-23 21:18 UTC (permalink / raw)
  To: Samuel Tardieu, qemu-devel
  Cc: qemu-trivial, Alessandro Di Federico, Anton Johansson

On 23/11/23 22:15, Samuel Tardieu wrote:
> This file is the only one involved in the compilation process which
> still uses the /bin/bash path.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   target/hexagon/idef-parser/prepare | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
  2023-11-23 21:15 [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash Samuel Tardieu
  2023-11-23 21:18 ` Philippe Mathieu-Daudé
@ 2023-11-24 11:10 ` Anton Johansson via
  2023-11-28 13:14 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 7+ messages in thread
From: Anton Johansson via @ 2023-11-24 11:10 UTC (permalink / raw)
  To: Samuel Tardieu; +Cc: qemu-devel, qemu-trivial, Alessandro Di Federico

On 23/11/23, Samuel Tardieu wrote:
> This file is the only one involved in the compilation process which
> still uses the /bin/bash path.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>  target/hexagon/idef-parser/prepare | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/hexagon/idef-parser/prepare b/target/hexagon/idef-parser/prepare
> index 72d6fcbd21..cb3622d4f8 100755
> --- a/target/hexagon/idef-parser/prepare
> +++ b/target/hexagon/idef-parser/prepare
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  #
>  #  Copyright(c) 2019-2021 rev.ng Labs Srl. All Rights Reserved.
> -- 
> 2.42.0
> 
Reviewed-by: Anton Johansson <anjo@rev.ng>


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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
  2023-11-23 21:15 [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash Samuel Tardieu
  2023-11-23 21:18 ` Philippe Mathieu-Daudé
  2023-11-24 11:10 ` Anton Johansson via
@ 2023-11-28 13:14 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-28 13:14 UTC (permalink / raw)
  To: Samuel Tardieu, qemu-devel
  Cc: qemu-trivial, Alessandro Di Federico, Anton Johansson

On 23/11/23 22:15, Samuel Tardieu wrote:
> This file is the only one involved in the compilation process which
> still uses the /bin/bash path.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   target/hexagon/idef-parser/prepare | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Patch queued, thanks!

Phil.



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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
       [not found] <20231123205742.630004-1-sam@rfc1149.net>
@ 2023-12-25  8:05 ` Michael Tokarev
  2023-12-25  8:15   ` Samuel Tardieu
  2023-12-25  8:17   ` Stefan Weil via
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Tokarev @ 2023-12-25  8:05 UTC (permalink / raw)
  To: Samuel Tardieu, qemu-trivial, QEMU Developers

23.11.2023 23:57, Samuel Tardieu :
> This file is the only one involved in the compilation process which
> still uses the /bin/bash path.
> 
> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
> ---
>   target/hexagon/idef-parser/prepare | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/hexagon/idef-parser/prepare b/target/hexagon/idef-parser/prepare
> index 72d6fcbd21..cb3622d4f8 100755
> --- a/target/hexagon/idef-parser/prepare
> +++ b/target/hexagon/idef-parser/prepare
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash

What's the reason for this indirection?  bash has been /bin/bash for decades,
it is used this way in many other places in qemu code and in other projects.
Yes I know about current move /bin => /usr/bin etc, but the thing is that
traditional paths like this one (or like /bin/sh) is not going away any time
soon.  What's the matter here?

/mjt


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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
  2023-12-25  8:05 ` Michael Tokarev
@ 2023-12-25  8:15   ` Samuel Tardieu
  2023-12-25  8:17   ` Stefan Weil via
  1 sibling, 0 replies; 7+ messages in thread
From: Samuel Tardieu @ 2023-12-25  8:15 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-trivial, qemu-devel


Michael Tokarev <mjt@tls.msk.ru> writes:

>> -#!/bin/bash
>> +#!/usr/bin/env bash
>
> What's the reason for this indirection?  bash has been /bin/bash 
> for decades,
> it is used this way in many other places in qemu code and in 
> other projects.
> Yes I know about current move /bin => /usr/bin etc, but the 
> thing is that
> traditional paths like this one (or like /bin/sh) is not going 
> away any time
> soon.  What's the matter here?

In addition to Stefan's answer, some modern systems use a per-user 
file system hierarchy where each user (or even each environment 
development for a user)  gets a global set of directories with 
only the applications they want. This is done either through 
adding each application directory into the user PATH or by using a 
set of user-specific bin/lib/... directories full of symlinks to 
the chosen applications.

In those environments, /usr/bin might only contain "env", such as 
"/usr/bin/env application" works. This is the case for example on 
NixOS, which is more and more used in research environments for 
their easily reproducible build environments.

  Sam
-- 
Samuel Tardieu
Télécom Paris - Institut Polytechnique de Paris


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

* Re: [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash
  2023-12-25  8:05 ` Michael Tokarev
  2023-12-25  8:15   ` Samuel Tardieu
@ 2023-12-25  8:17   ` Stefan Weil via
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Weil via @ 2023-12-25  8:17 UTC (permalink / raw)
  To: Michael Tokarev, Samuel Tardieu, qemu-trivial, QEMU Developers

Am 25.12.23 um 09:05 schrieb Michael Tokarev:
> 23.11.2023 23:57, Samuel Tardieu :
>> This file is the only one involved in the compilation process which
>> still uses the /bin/bash path.
>>
>> Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
>> ---
>>   target/hexagon/idef-parser/prepare | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/hexagon/idef-parser/prepare 
>> b/target/hexagon/idef-parser/prepare
>> index 72d6fcbd21..cb3622d4f8 100755
>> --- a/target/hexagon/idef-parser/prepare
>> +++ b/target/hexagon/idef-parser/prepare
>> @@ -1,4 +1,4 @@
>> -#!/bin/bash
>> +#!/usr/bin/env bash
> 
> What's the reason for this indirection?  bash has been /bin/bash for 
> decades,
> it is used this way in many other places in qemu code and in other 
> projects.
> Yes I know about current move /bin => /usr/bin etc, but the thing is that
> traditional paths like this one (or like /bin/sh) is not going away any 
> time
> soon.  What's the matter here?
> 
> /mjt
> 

On MacOS /bin/bash is the pre-installed bash:

% /bin/bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.

With /usr/bin/env I get a recent one from Homebrew:

% /usr/bin/env bash --version
GNU bash, version 5.2.21(1)-release (aarch64-apple-darwin23.0.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

So if a bash script uses bash syntax which was added after 2007, that 
would not work with /bin/bash. That's why I had to use the indirection 
for another open source project. I don't know whether the QEMU bash 
scripts require a newer version of bash.

Regards
Stefan


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

end of thread, other threads:[~2023-12-25  8:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23 21:15 [PATCH] target/hexagon/idef-parser/prepare: use env to invoke bash Samuel Tardieu
2023-11-23 21:18 ` Philippe Mathieu-Daudé
2023-11-24 11:10 ` Anton Johansson via
2023-11-28 13:14 ` Philippe Mathieu-Daudé
     [not found] <20231123205742.630004-1-sam@rfc1149.net>
2023-12-25  8:05 ` Michael Tokarev
2023-12-25  8:15   ` Samuel Tardieu
2023-12-25  8:17   ` Stefan Weil via

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