Bug 18363 - doltlibtool broken on linux with bash 3.00.0
doltlibtool broken on linux with bash 3.00.0
Status: RESOLVED FIXED
Product: dolt
Classification: Unclassified
Component: general
unspecified
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: Carl Worth
cairo-bugs mailing list
:
Depends on: 18610
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-03 16:59 UTC by Jarod Eells
Modified: 2009-01-13 17:54 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarod Eells 2008-11-03 16:59:33 UTC
There is a line in doltlibtool which chokes on this version of bash.

Here is a patch that seems to work:

diff cairo-1.8.2/doltlibtool cairo-1.8.2/doltlibtool.new 
11c11
<         *) args+=("$arg")
---
>         *) args="${args} ${arg}"

bash --version reports:

GNU bash, version 3.00.0(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
Comment 1 Jarod Eells 2008-11-03 17:02:57 UTC
I forgot to add the error message.
../doltlibtool: line 11: syntax error near unexpected token `"$arg"'
../doltlibtool: line 11: `        *) args+=("$arg")'
Comment 2 Behdad Esfahbod 2008-11-03 20:55:43 UTC
Reassigning to dolt so this gets fixed upstream.
Comment 3 Behdad Esfahbod 2008-11-03 22:11:17 UTC
The patch as is, is wrong.  Does it help if you add "declare -a args" before args is first used?
Comment 4 Alp Toker 2008-11-03 22:33:53 UTC
Hi,

We've been carrying fixes for this in Mono and WebKit but I didn't want to git-push them without Josh taking a look (couldn't get a reply from him but my email was acting up so could be a problem on my end).

Relevant bug:
  https://bugs.webkit.org/show_bug.cgi?id=19395

Relevant commits:
  http://trac.webkit.org/changeset/38011
  http://lists.ximian.com/pipermail/mono-patches/2008-June/121713.html

There are a couple of other fixes in Mono and WebKit that I'd love to get upstream too if anyone wants to review this.
Comment 5 Behdad Esfahbod 2008-11-03 22:39:10 UTC
Thanks Alp.  I also see a patch sent to the mailing list in July, also unresponded: http://lists.freedesktop.org/archives/dolt/2008-July/000001.html

If Josh has lost interest in it, fine, lets revive it.  I can review, as we now ship this with cairo and I have to maintain that anyway.
Comment 6 Behdad Esfahbod 2008-11-03 22:52:00 UTC
Fixed in cairo master and 1.8 branch.
Comment 7 Jarod Eells 2008-11-04 08:36:47 UTC
(In reply to comment #3)
> The patch as is, is wrong.  Does it help if you add "declare -a args" before
> args is first used?
> 

No.  I added declare as the second line of the script and also tried moving it just after the args=() line.  In both cases, it continues to cause a syntax error.

Could you elaborate on why the patch is wrong?  It seems to work.


Comment 8 Jarod Eells 2008-11-04 11:04:35 UTC
(In reply to comment #7)
Never mind.  I see why.

> (In reply to comment #3)
> > The patch as is, is wrong.  Does it help if you add "declare -a args" before
> > args is first used?
> > 
> 
> No.  I added declare as the second line of the script and also tried moving it
> just after the args=() line.  In both cases, it continues to cause a syntax
> error.
> 
> Could you elaborate on why the patch is wrong?  It seems to work.
> 

Comment 9 Behdad Esfahbod 2008-11-04 11:27:08 UTC
Here is the correct patch, that I committed to cairo:

-        *) args+=("$arg")
+        *) args@<:@${#args[@]}@:>@="$arg" ;;


Please test.
Comment 10 Alp Toker 2008-11-05 13:50:22 UTC
Going to git push this build fix now (assuming I have write access). It's been deployed successfully for some months in Mono and a few days in WebKit too.
Comment 11 Rafał Mużyło 2008-12-07 08:16:57 UTC
While it's a bit of topic here, could you also
enhance DOLT macro with opt-out, IOW ability
to pass an option to ignore dolt and use libtool anyway ?

For quite awhile, I'm trying to get an answer to a simple
question: is there anything wrong with libtool 2.2 series ?
Cause if there's nothing wrong with it, it had (more or less) obsoleted
dolt and was released before dolt was available to the public.

The tests on the libtool mailing list seem to show that there's
no longer as large difference between those two and libtool is actually maintained.
Comment 12 Behdad Esfahbod 2008-12-07 13:47:08 UTC
Re libtool 2.2 vs dolt performance, we measured last month and dolt was still faster.  Don't remember the margin. Chris?
Comment 13 Alp Toker 2009-01-13 17:54:48 UTC
Fixed in 47928bb8.