summary refs log tree commit diff stats
path: root/results/scraper/launchpad/636315
blob: ff44d966983748ebdc88ca0de1833836e81b1e99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
configure and build errors on Solaris 10 due to /bin/sh usage

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.

On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
<email address hidden> 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.

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
> <email address hidden> 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

On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <email address hidden> wrote:
> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 11:26 AM, Andreas Färber
>> <email address hidden> 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

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <<email address hidden> 
> > 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

On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <email address hidden> wrote:
> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <email address hidden>
>> 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?

Am 12.09.2010 um 23:05 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <<email address hidden> 
> > 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.

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 <<email address hidden> 
>> > 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
>


On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <email address hidden> wrote:
> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <email address hidden>
>> 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?

On Mon, Sep 13, 2010 at 8:49 AM, Michael Tokarev <email address hidden> wrote:
> 13.09.2010 01:05, Blue Swirl wrote:
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <email address hidden> wrote:
>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>
>>>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <email address hidden>
>>>> 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.

Am 14.09.2010 um 18:34 schrieb Blue Swirl:

> On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <<email address hidden> 
> > wrote:
>> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>>
>>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <<email address hidden> 
>>> >
>>> 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.

On Tue, Sep 14, 2010 at 8:37 PM, Andreas Färber <email address hidden> wrote:
> Am 14.09.2010 um 18:34 schrieb Blue Swirl:
>
>> On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <email address hidden>
>> wrote:
>>>
>>> Am 12.09.2010 um 23:05 schrieb Blue Swirl:
>>>
>>>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <email address hidden>
>>>> 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?


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

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.