All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh
@ 2015-10-09 14:04 Joonas Lahtinen
  2015-10-09 14:44 ` Morton, Derek J
  2015-10-09 14:59 ` Tvrtko Ursulin
  0 siblings, 2 replies; 3+ messages in thread
From: Joonas Lahtinen @ 2015-10-09 14:04 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: chs, Thomas Wood, riastradh

Currently the shell scripts (+ a couple of 'execl') in intel-gpu-tools
are are using a mix of #!/bin/bash (13) or #!/bin/sh shebangs (6). Also
5 of the #!/bin/bash scripts do source a #!/bin/sh script.

I think we should have it unified, either drop Bash dependency
completely or convert all scripts (and execl) to use it.

Most of the scripts are not using any features at all that they would
require a #!/bin/bash shebang or could not be trivially converted to be
#!/bin/sh compliant. Most have actually been written with #!/bin/bash
shebang but still with constructs like 'if [ "x${FOO}" = "x" ]' which
basically are used for compatability with ancient shells. Explained at
http://stackoverflow.com/a/6853353 .

I'd say the bash shebang is there just because author wrote it by
habit. 

In favor of #!/bin/bash there is the point made by Damien (CC'd) that
it'll rule out the incoming bug reports that are due to alternative
shell environments. 

In favor of #!/bin/sh NetBSD people (CC'd) informed they'll be glad to
see bash requirement go.

How about Android, does it make a difference there?

My view on this is that converting everything to #!/bin/sh allows using
BusyBox shell which makes the minimal testing build less complex. So
I'm in favor of converting to #!/bin/sh.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh
  2015-10-09 14:04 [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh Joonas Lahtinen
@ 2015-10-09 14:44 ` Morton, Derek J
  2015-10-09 14:59 ` Tvrtko Ursulin
  1 sibling, 0 replies; 3+ messages in thread
From: Morton, Derek J @ 2015-10-09 14:44 UTC (permalink / raw)
  To: Joonas Lahtinen,
	Intel graphics driver community testing & development
  Cc: chs, Wood, Thomas, riastradh

Hi Joonas,

On android /bin does not exist. It is /system/bin/sh (there is no /system/bin/bash) so the script needs to be executed specifying the shell to override the shebang anyway. e.g. '/system/bin/sh script.sh'

Currently the script type tests are not run on android as the build system does not copy them to the target file system. However I was planning on trying to fix that at some point.

So the android vote would be for #!/bin/sh as using bash would preclude ever being able to run the scripts on android.

//Derek

-----Original Message-----
From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of Joonas Lahtinen
Sent: Friday, October 9, 2015 3:04 PM
To: Intel graphics driver community testing & development
Cc: chs@netbsd.org; Wood, Thomas; riastradh@netbsd.org
Subject: [Intel-gfx] [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh

Currently the shell scripts (+ a couple of 'execl') in intel-gpu-tools are are using a mix of #!/bin/bash (13) or #!/bin/sh shebangs (6). Also
5 of the #!/bin/bash scripts do source a #!/bin/sh script.

I think we should have it unified, either drop Bash dependency completely or convert all scripts (and execl) to use it.

Most of the scripts are not using any features at all that they would require a #!/bin/bash shebang or could not be trivially converted to be #!/bin/sh compliant. Most have actually been written with #!/bin/bash shebang but still with constructs like 'if [ "x${FOO}" = "x" ]' which basically are used for compatability with ancient shells. Explained at
http://stackoverflow.com/a/6853353 .

I'd say the bash shebang is there just because author wrote it by habit. 

In favor of #!/bin/bash there is the point made by Damien (CC'd) that it'll rule out the incoming bug reports that are due to alternative shell environments. 

In favor of #!/bin/sh NetBSD people (CC'd) informed they'll be glad to see bash requirement go.

How about Android, does it make a difference there?

My view on this is that converting everything to #!/bin/sh allows using BusyBox shell which makes the minimal testing build less complex. So I'm in favor of converting to #!/bin/sh.

Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh
  2015-10-09 14:04 [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh Joonas Lahtinen
  2015-10-09 14:44 ` Morton, Derek J
@ 2015-10-09 14:59 ` Tvrtko Ursulin
  1 sibling, 0 replies; 3+ messages in thread
From: Tvrtko Ursulin @ 2015-10-09 14:59 UTC (permalink / raw)
  To: Joonas Lahtinen,
	Intel graphics driver community testing & development
  Cc: chs, Thomas Wood, riastradh


On 09/10/15 15:04, Joonas Lahtinen wrote:
> Currently the shell scripts (+ a couple of 'execl') in intel-gpu-tools
> are are using a mix of #!/bin/bash (13) or #!/bin/sh shebangs (6). Also
> 5 of the #!/bin/bash scripts do source a #!/bin/sh script.
>
> I think we should have it unified, either drop Bash dependency
> completely or convert all scripts (and execl) to use it.
>
> Most of the scripts are not using any features at all that they would
> require a #!/bin/bash shebang or could not be trivially converted to be
> #!/bin/sh compliant. Most have actually been written with #!/bin/bash
> shebang but still with constructs like 'if [ "x${FOO}" = "x" ]' which
> basically are used for compatability with ancient shells. Explained at
> http://stackoverflow.com/a/6853353 .
>
> I'd say the bash shebang is there just because author wrote it by
> habit.
>
> In favor of #!/bin/bash there is the point made by Damien (CC'd) that
> it'll rule out the incoming bug reports that are due to alternative
> shell environments.
>
> In favor of #!/bin/sh NetBSD people (CC'd) informed they'll be glad to
> see bash requirement go.
>
> How about Android, does it make a difference there?
>
> My view on this is that converting everything to #!/bin/sh allows using
> BusyBox shell which makes the minimal testing build less complex. So
> I'm in favor of converting to #!/bin/sh.

I'll just mention "#!/usr/bin/env sh" as potentially more portable 
option, for even more confusion.  :)

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-10-09 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-09 14:04 [RFC i-g-t] Deciding on #!/bin/bash or #!/bin/sh Joonas Lahtinen
2015-10-09 14:44 ` Morton, Derek J
2015-10-09 14:59 ` Tvrtko Ursulin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.