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 <s...@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

Reply via email to