All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
@ 2010-09-12 11:26 Andreas Färber
  2010-09-12 17:22 ` Blue Swirl
  2016-10-21 11:35 ` [Qemu-devel] [Bug 636315] " Thomas Huth
  0 siblings, 2 replies; 16+ messages in thread
From: Andreas Färber @ 2010-09-12 11:26 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Running `LANG=C LC_ALL=C ./configure --prefix=...
--install=/usr/ucb/install` on Solaris 10 amd64 results in the following
errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.


Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

The first few can be resolved by running `bash ./configure ...` instead.

The "check if trace backend exists" hardcodes `sh
"$source_path/tracetool" ...` in configure. Replacing sh with bash makes
it work.

`gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
`create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA
access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: solaris

-- 
configure and build errors on Solaris 10 due to /bin/sh usage
https://bugs.launchpad.net/bugs/636315
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
Running `LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install` on Solaris 10 amd64 results in the following errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.


Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

The first few can be resolved by running `bash ./configure ...` instead. 

The "check if trace backend exists" hardcodes `sh "$source_path/tracetool" ...` in configure. Replacing sh with bash makes it work.

`gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
`create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 11:26 [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage Andreas Färber
@ 2010-09-12 17:22 ` Blue Swirl
  2010-09-12 17:35   ` Andreas Färber
  2016-10-21 11:35 ` [Qemu-devel] [Bug 636315] " Thomas Huth
  1 sibling, 1 reply; 16+ messages in thread
From: Blue Swirl @ 2010-09-12 17:22 UTC (permalink / raw)
  To: Bug 636315; +Cc: qemu-devel

On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
<636315@bugs.launchpad.net> wrote:
> Public bug reported:
>
> Running `LANG=C LC_ALL=C ./configure --prefix=...
> --install=/usr/ucb/install` on Solaris 10 amd64 results in the following
> errors:
>
> ./configure: bad substitution
> ./configure: !: not found
> ./configure: curl-config: not found
> ./configure: curl-config: not found
>
> Error: invalid trace backend
> Please choose a supported trace backend.

What is the output of "sh ./tracetool --nop --check-backend"?

>
>
> Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.
>
> The first few can be resolved by running `bash ./configure ...` instead.
>
> The "check if trace backend exists" hardcodes `sh
> "$source_path/tracetool" ...` in configure. Replacing sh with bash makes
> it work.
>
> `gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
> `create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
> etc.
>
> To sum it up,
> a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and

I fixed one in 2184d75b4a6a253e8b1e002b3dbcc85c20ba6041 and now
Milax's /bin/sh is happy.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 17:22 ` Blue Swirl
@ 2010-09-12 17:35   ` Andreas Färber
  2010-09-12 17:47     ` Blue Swirl
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2010-09-12 17:35 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Bug 636315, qemu-devel

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
> <636315@bugs.launchpad.net> wrote:
>> Error: invalid trace backend
>> Please choose a supported trace backend.
>
> What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 17:35   ` Andreas Färber
@ 2010-09-12 17:47     ` Blue Swirl
  2010-09-12 17:58       ` Andreas Färber
  0 siblings, 1 reply; 16+ messages in thread
From: Blue Swirl @ 2010-09-12 17:47 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Bug 636315, qemu-devel

On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
>> <636315@bugs.launchpad.net> wrote:
>>>
>>> Error: invalid trace backend
>>> Please choose a supported trace backend.
>>
>> What is the output of "sh ./tracetool --nop --check-backend"?
>
> ./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

diff --git a/tracetool b/tracetool
index 534cc70..c7582bf 100755
--- a/tracetool
+++ b/tracetool
@@ -48,7 +48,8 @@ get_argnames()
 {
     local nfields field name
     nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do
         nfields=$((nfields + 1))

         # Drop pointer star

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 17:47     ` Blue Swirl
@ 2010-09-12 17:58       ` Andreas Färber
  2010-09-12 21:05         ` Blue Swirl
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2010-09-12 17:58 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Bug 636315, qemu-devel

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de 
> > wrote:
>> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>>
>>> What is the output of "sh ./tracetool --nop --check-backend"?
>>
>> ./tracetool: syntax error at line 51: `$' unexpected
>
> Does this patch fix the problem?
>
> diff --git a/tracetool b/tracetool
> index 534cc70..c7582bf 100755
> --- a/tracetool
> +++ b/tracetool
> @@ -48,7 +48,8 @@ get_argnames()
> {
>     local nfields field name
>     nfields=0
> -    for field in $(get_args "$1"); do
> +    args=get_args "$1"
> +    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line  
above)

>         nfields=$((nfields + 1))

Next error is here:
./tracetool: syntax error at line 53: `nfields=$' unexpected

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 17:58       ` Andreas Färber
@ 2010-09-12 21:05         ` Blue Swirl
  2010-09-12 22:02           ` Andreas Färber
  2010-09-13  8:49           ` Michael Tokarev
  0 siblings, 2 replies; 16+ messages in thread
From: Blue Swirl @ 2010-09-12 21:05 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Bug 636315, qemu-devel

On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de>
>> wrote:
>>>
>>> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>>>
>>>> What is the output of "sh ./tracetool --nop --check-backend"?
>>>
>>> ./tracetool: syntax error at line 51: `$' unexpected
>>
>> Does this patch fix the problem?
>>
>> diff --git a/tracetool b/tracetool
>> index 534cc70..c7582bf 100755
>> --- a/tracetool
>> +++ b/tracetool
>> @@ -48,7 +48,8 @@ get_argnames()
>> {
>>    local nfields field name
>>    nfields=0
>> -    for field in $(get_args "$1"); do
>> +    args=get_args "$1"
>> +    for field in "$args"; do
>
> This part yes. (I took the liberty of adding args to the local line above)
>
>>        nfields=$((nfields + 1))
>
> Next error is here:
> ./tracetool: syntax error at line 53: `nfields=$' unexpected

That looks like fully standards compliant, so Solaris' /bin/sh is not.
Can you try what happens with /usr/xpg4/bin/sh?

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 21:05         ` Blue Swirl
@ 2010-09-12 22:02           ` Andreas Färber
  2010-09-14 16:34             ` blueswirl
  2010-09-13  8:49           ` Michael Tokarev
  1 sibling, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2010-09-12 22:02 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Bug 636315, qemu-devel

Am 12.09.2010 um 23:05 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de 
> > wrote:
>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>        nfields=$((nfields + 1))
>>
>> ./tracetool: syntax error at line 53: `nfields=$' unexpected
>
> That looks like fully standards compliant, so Solaris' /bin/sh is not.
> Can you try what happens with /usr/xpg4/bin/sh?

Works fine! Must've done something wrong when testing that earlier  
today.

configure, create_config and tracetool with your fix are silent when / 
usr/xpg4/bin is in the $PATH.
If you commit it, we can close this ticket. Thanks for your help, Blue.

Build still fails, in qemu-nbd.c due to err.h, but that's unrelated  
to /bin/sh.
After disabling the tools in configure, sparc-softmmu builds fine again.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 21:05         ` Blue Swirl
  2010-09-12 22:02           ` Andreas Färber
@ 2010-09-13  8:49           ` Michael Tokarev
  2010-09-13 21:34             ` Andreas Färber
  2010-09-14 16:41             ` Blue Swirl
  1 sibling, 2 replies; 16+ messages in thread
From: Michael Tokarev @ 2010-09-13  8:49 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Andreas Färber, Bug 636315, qemu-devel

13.09.2010 01:05, Blue Swirl wrote:
> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de> wrote:
>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>
>>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de>
>>> wrote:
>>>>
>>>> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>>>>
>>>>> What is the output of "sh ./tracetool --nop --check-backend"?
>>>>
>>>> ./tracetool: syntax error at line 51: `$' unexpected
>>>
>>> Does this patch fix the problem?
>>>
>>> diff --git a/tracetool b/tracetool
>>> index 534cc70..c7582bf 100755
>>> --- a/tracetool
>>> +++ b/tracetool
>>> @@ -48,7 +48,8 @@ get_argnames()
>>> {
>>>    local nfields field name
>>>    nfields=0
>>> -    for field in $(get_args "$1"); do
>>> +    args=get_args "$1"
>>> +    for field in "$args"; do
>>
>> This part yes. (I took the liberty of adding args to the local line above)

Um.  Are you sure it works as expected?  I'm not at all shure.
There are 2 errors in the above patch:

 +    args=get_args "$1"

After this line, variable $args will contain one word: "get_args".
Shell will try to execute a command or call a shell function which
name is stored in $1, if it is assigned.  If it is not, at least
bash will complain that it can't execute command "".

The proper way is to add backticks:

 +    args=`get_args "$1"`

In the second line:

 +    for field in "$args"; do

the double quotes ensure that all words in $args are
processed as single word, all at once.  So the for loop
will be executed exactly one time, no matter how many
arguments are given (even if there's none).

So the right solution is to drop double quotes.

JFYI.

/mjt

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-13  8:49           ` Michael Tokarev
@ 2010-09-13 21:34             ` Andreas Färber
  2010-09-14 16:41             ` Blue Swirl
  1 sibling, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2010-09-13 21:34 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Blue Swirl, Bug 636315, qemu-devel

Am 13.09.2010 um 10:49 schrieb Michael Tokarev:

> 13.09.2010 01:05, Blue Swirl wrote:
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de 
>> > wrote:
>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>
>>>> diff --git a/tracetool b/tracetool
>>>> index 534cc70..c7582bf 100755
>>>> --- a/tracetool
>>>> +++ b/tracetool
>>>> @@ -48,7 +48,8 @@ get_argnames()
>>>> {
>>>>   local nfields field name
>>>>   nfields=0
>>>> -    for field in $(get_args "$1"); do
>>>> +    args=get_args "$1"
>>>> +    for field in "$args"; do
>>>
>>> This part yes. (I took the liberty of adding args to the local  
>>> line above)
>
> Um.  Are you sure it works as expected?

No, I'm not sure. It's Dark Magic to me and happened to unbreak  
configure; I'll try out your suggestions the next days.

Thanks,
Andreas

>  I'm not at all shure.
> There are 2 errors in the above patch:
>
> +    args=get_args "$1"
>
> After this line, variable $args will contain one word: "get_args".
> Shell will try to execute a command or call a shell function which
> name is stored in $1, if it is assigned.  If it is not, at least
> bash will complain that it can't execute command "".
>
> The proper way is to add backticks:
>
> +    args=`get_args "$1"`
>
> In the second line:
>
> +    for field in "$args"; do
>
> the double quotes ensure that all words in $args are
> processed as single word, all at once.  So the for loop
> will be executed exactly one time, no matter how many
> arguments are given (even if there's none).
>
> So the right solution is to drop double quotes.
>
> JFYI.
>
> /mjt
>

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 22:02           ` Andreas Färber
@ 2010-09-14 16:34             ` blueswirl
  2010-09-14 20:37               ` Andreas Färber
  0 siblings, 1 reply; 16+ messages in thread
From: blueswirl @ 2010-09-14 16:34 UTC (permalink / raw)
  To: qemu-devel

On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de>
>> wrote:
>>>
>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>>
>>>>       nfields=$((nfields + 1))
>>>
>>> ./tracetool: syntax error at line 53: `nfields=$' unexpected
>>
>> That looks like fully standards compliant, so Solaris' /bin/sh is not.
>> Can you try what happens with /usr/xpg4/bin/sh?
>
> Works fine! Must've done something wrong when testing that earlier today.
>
> configure, create_config and tracetool with your fix are silent when
> /usr/xpg4/bin is in the $PATH.
> If you commit it, we can close this ticket. Thanks for your help, Blue.

Does /usr/xpg4/bin/sh work without the patch?

-- 
configure and build errors on Solaris 10 due to /bin/sh usage
https://bugs.launchpad.net/bugs/636315
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
Running `LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install` on Solaris 10 amd64 results in the following errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.


Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

The first few can be resolved by running `bash ./configure ...` instead. 

The "check if trace backend exists" hardcodes `sh "$source_path/tracetool" ...` in configure. Replacing sh with bash makes it work.

`gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
`create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-13  8:49           ` Michael Tokarev
  2010-09-13 21:34             ` Andreas Färber
@ 2010-09-14 16:41             ` Blue Swirl
  2010-09-14 18:18               ` Michael Tokarev
  1 sibling, 1 reply; 16+ messages in thread
From: Blue Swirl @ 2010-09-14 16:41 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Andreas Färber, Bug 636315, qemu-devel

On Mon, Sep 13, 2010 at 8:49 AM, Michael Tokarev <mjt@tls.msk.ru> wrote:
> 13.09.2010 01:05, Blue Swirl wrote:
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de> wrote:
>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>
>>>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de>
>>>> wrote:
>>>>>
>>>>> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>>>>>
>>>>>> What is the output of "sh ./tracetool --nop --check-backend"?
>>>>>
>>>>> ./tracetool: syntax error at line 51: `$' unexpected
>>>>
>>>> Does this patch fix the problem?
>>>>
>>>> diff --git a/tracetool b/tracetool
>>>> index 534cc70..c7582bf 100755
>>>> --- a/tracetool
>>>> +++ b/tracetool
>>>> @@ -48,7 +48,8 @@ get_argnames()
>>>> {
>>>>    local nfields field name
>>>>    nfields=0
>>>> -    for field in $(get_args "$1"); do
>>>> +    args=get_args "$1"
>>>> +    for field in "$args"; do
>>>
>>> This part yes. (I took the liberty of adding args to the local line above)
>
> Um.  Are you sure it works as expected?  I'm not at all shure.
> There are 2 errors in the above patch:
>
>  +    args=get_args "$1"
>
> After this line, variable $args will contain one word: "get_args".
> Shell will try to execute a command or call a shell function which
> name is stored in $1, if it is assigned.  If it is not, at least
> bash will complain that it can't execute command "".
>
> The proper way is to add backticks:
>
>  +    args=`get_args "$1"`
>
> In the second line:
>
>  +    for field in "$args"; do
>
> the double quotes ensure that all words in $args are
> processed as single word, all at once.  So the for loop
> will be executed exactly one time, no matter how many
> arguments are given (even if there's none).
>
> So the right solution is to drop double quotes.

Do you see any bug with the original?

If the problem is in fact that Solaris' /bin/sh is not standards
compliant, we shouldn't fix the script but instead make sure that the
shell used to run tracetool is the compliant one.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-14 16:41             ` Blue Swirl
@ 2010-09-14 18:18               ` Michael Tokarev
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Tokarev @ 2010-09-14 18:18 UTC (permalink / raw)
  To: Bug 636315; +Cc: qemu-devel

14.09.2010 20:41, blueswirl wrote:
> On Mon, Sep 13, 2010 at 8:49 AM, Michael Tokarev <mjt@tls.msk.ru> wrote:
[]
>>>>> diff --git a/tracetool b/tracetool
>>>>> index 534cc70..c7582bf 100755
>>>>> --- a/tracetool
>>>>> +++ b/tracetool
>>>>> @@ -48,7 +48,8 @@ get_argnames()
>>>>> {
>>>>>    local nfields field name
>>>>>    nfields=0
>>>>> -    for field in $(get_args "$1"); do
>>>>> +    args=get_args "$1"
>>>>> +    for field in "$args"; do
>>>>
>>>> This part yes. (I took the liberty of adding args to the local line above)
>>
>> Um.  Are you sure it works as expected?  I'm not at all shure.
>> There are 2 errors in the above patch:
[]
> Do you see any bug with the original?

The thing is - I've no idea what's the talk about.
There's no mentions of tracetool in 0.13.0-rc1 tarball.

> If the problem is in fact that Solaris' /bin/sh is not standards
> compliant, we shouldn't fix the script but instead make sure that the
> shell used to run tracetool is the compliant one.

Solaris's /bin/sh isn't exactly non-standard-compliant,
it's very limited.  In particular, $() construct weren't
in the standard for quite some time, and I'm not sure
it is now.

The usual idiom is to use backticks `` for this.  Only
in case of nested subshells or using case..esac (with
closing brases for individual cases) standard backticks
does not work.

/mjt

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-14 16:34             ` blueswirl
@ 2010-09-14 20:37               ` Andreas Färber
  2010-09-14 20:53                 ` Blue Swirl
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2010-09-14 20:37 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Bug 636315, qemu-devel

Am 14.09.2010 um 18:34 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <andreas.faerber@web.de 
> > wrote:
>> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>>
>>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de 
>>> >
>>> wrote:
>>>>
>>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>>>
>>>>>       nfields=$((nfields + 1))
>>>>
>>>> ./tracetool: syntax error at line 53: `nfields=$' unexpected
>>>
>>> That looks like fully standards compliant, so Solaris' /bin/sh is  
>>> not.
>>> Can you try what happens with /usr/xpg4/bin/sh?
>>
>> Works fine! Must've done something wrong when testing that earlier  
>> today.
>>
>> configure, create_config and tracetool with your fix are silent when
>> /usr/xpg4/bin is in the $PATH.
>> If you commit it, we can close this ticket. Thanks for your help,  
>> Blue.
>
> Does /usr/xpg4/bin/sh work without the patch?

No.

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-14 20:37               ` Andreas Färber
@ 2010-09-14 20:53                 ` Blue Swirl
  2010-09-17 21:14                   ` Andreas Färber
  0 siblings, 1 reply; 16+ messages in thread
From: Blue Swirl @ 2010-09-14 20:53 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Bug 636315, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]

On Tue, Sep 14, 2010 at 8:37 PM, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 14.09.2010 um 18:34 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <andreas.faerber@web.de>
>> wrote:
>>>
>>> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>>>
>>>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de>
>>>> wrote:
>>>>>
>>>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>>>>
>>>>>>      nfields=$((nfields + 1))
>>>>>
>>>>> ./tracetool: syntax error at line 53: `nfields=$' unexpected
>>>>
>>>> That looks like fully standards compliant, so Solaris' /bin/sh is not.
>>>> Can you try what happens with /usr/xpg4/bin/sh?
>>>
>>> Works fine! Must've done something wrong when testing that earlier today.
>>>
>>> configure, create_config and tracetool with your fix are silent when
>>> /usr/xpg4/bin is in the $PATH.
>>> If you commit it, we can close this ticket. Thanks for your help, Blue.
>>
>> Does /usr/xpg4/bin/sh work without the patch?
>
> No.

How about with the attached patch? If yes, does it work even with /bin/sh?

[-- Attachment #2: 0001-trace-use-older-function-call-and-expression-syntax.patch --]
[-- Type: application/mbox, Size: 3990 bytes --]

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

* Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-14 20:53                 ` Blue Swirl
@ 2010-09-17 21:14                   ` Andreas Färber
  0 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2010-09-17 21:14 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Bug 636315, qemu-devel

Am 14.09.2010 um 22:53 schrieb Blue Swirl:

> How about with the attached patch? If yes, does it work even with / 
> bin/sh?

LC_ALL=C /usr/xpg4/bin/sh ./tracetool --nop --check-backend

works fine,

LC_ALL=C sh ./tracetool --nop --check-backend
./tracetool: bad substitution

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

* [Qemu-devel] [Bug 636315] Re: configure and build errors on Solaris 10 due to /bin/sh usage
  2010-09-12 11:26 [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage Andreas Färber
  2010-09-12 17:22 ` Blue Swirl
@ 2016-10-21 11:35 ` Thomas Huth
  1 sibling, 0 replies; 16+ messages in thread
From: Thomas Huth @ 2016-10-21 11:35 UTC (permalink / raw)
  To: qemu-devel

The shell-based tracetool has been replace in commit
650ab98d1d9551f0ca21 with a script that has been implemented in Python,
so I think we can close this bug nowadays.

** Changed in: qemu
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/636315

Title:
  configure and build errors on Solaris 10 due to /bin/sh usage

Status in QEMU:
  Fix Released

Bug description:
  Running `LANG=C LC_ALL=C ./configure --prefix=...
  --install=/usr/ucb/install` on Solaris 10 amd64 results in the
  following errors:

  ./configure: bad substitution
  ./configure: !: not found
  ./configure: curl-config: not found
  ./configure: curl-config: not found

  Error: invalid trace backend
  Please choose a supported trace backend.

  
  Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

  The first few can be resolved by running `bash ./configure ...`
  instead.

  The "check if trace backend exists" hardcodes `sh
  "$source_path/tracetool" ...` in configure. Replacing sh with bash
  makes it work.

  `gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
  `create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
  etc.

  To sum it up,
  a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
  b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

  QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA
  access...)

  $ uname -a
  SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

  # No banner output for /bin/sh

  $ bash --version
  GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
  Copyright (C) 2004 Free Software Foundation, Inc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/636315/+subscriptions

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

end of thread, other threads:[~2016-10-21 11:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-12 11:26 [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage Andreas Färber
2010-09-12 17:22 ` Blue Swirl
2010-09-12 17:35   ` Andreas Färber
2010-09-12 17:47     ` Blue Swirl
2010-09-12 17:58       ` Andreas Färber
2010-09-12 21:05         ` Blue Swirl
2010-09-12 22:02           ` Andreas Färber
2010-09-14 16:34             ` blueswirl
2010-09-14 20:37               ` Andreas Färber
2010-09-14 20:53                 ` Blue Swirl
2010-09-17 21:14                   ` Andreas Färber
2010-09-13  8:49           ` Michael Tokarev
2010-09-13 21:34             ` Andreas Färber
2010-09-14 16:41             ` Blue Swirl
2010-09-14 18:18               ` Michael Tokarev
2016-10-21 11:35 ` [Qemu-devel] [Bug 636315] " Thomas Huth

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.