Quantcast

Re: UGLY_DEFS and command line length

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: UGLY_DEFS and command line length

Rik-4
On 03/02/2013 06:33 AM, [hidden email] wrote:

> Message: 2
> Date: Sat, 02 Mar 2013 08:23:24 -0500
> From: "John W. Eaton" <[hidden email]>
> To: Ben Abbott <[hidden email]>
> Cc: Rik Wehbring <[hidden email]>, octave maintainers mailing list
> <[hidden email]>
> Subject: Re: UGLY_DEFS, configure.ac, & toplev.cc on MacOS X
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 03/01/2013 07:54 PM, Ben Abbott wrote:
>
>>> >> Adding a single backslash allows me to build.
>>> >>
>>> >> Ben
>>> >>
>>> >> $ hg diff
>>> >> diff --git a/configure.ac b/configure.ac
>>> >> --- a/configure.ac
>>> >> +++ b/configure.ac
>>> >> @@ -2853,7 +2853,7 @@
>>> >>
>>> >> ## We have to insert extra levels of backslash quoting here so that
>>> >> ## the right thing ends up in oct-conf.h.
>>> >> -UGLY_DEFS=`echo $DEFS | $SED 's,\\",\\\\\\\\\\\\\\\\\\",g'`
>>> >> +UGLY_DEFS=`echo $DEFS | $SED 's,\\",\\\\\\\\\\\\\\\\\\\",g'`
>>> >> AC_MSG_NOTICE([defining UGLY_DEFS to be $UGLY_DEFS])
>>> >> AC_SUBST(UGLY_DEFS)
>>> >>
>> >
>> > Rik,
>> >
>> > The attached change allows me to build.
>> >
>> > If it doesn't break your build should this be pushed?
> I checked in two changes to eliminate UGLY_DEFS instead:
>
>    http://hg.savannah.gnu.org/hgweb/octave/rev/2a4f83826024
>    http://hg.savannah.gnu.org/hgweb/octave/rev/cf6788da4152
>
> While making this change, I noticed that UGLY_DEFS appeared three times
> in the sed commands.  Once in a substitution for OCTAVE_CONF_DEFS and
> twice for OCTAVE_CONF_UGLY_DEFS.  Without the extra substitutions, a
> single sed command might not be too long but I left it split in two
> parts anyway.
>
> jwe
3/2/12

John,

I broke up the sed patterns and put them in a file to work around the line
limitations in the shell rather than in sed.  Doesn't that problem (bug
#38372) still remain?  It seems like "cmd1 | cmd2" must initially be parsed
by a single interpreter which means the overall command line length is
still an issue.  Now that two UGLY_DEFS replacements have been taken out
the line length may be under the original bug reporter's length, but that
should probably be verified.

--Rik
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: UGLY_DEFS and command line length

John W. Eaton
Administrator
On 03/02/2013 10:01 AM, Rik wrote:

> I broke up the sed patterns and put them in a file to work around the line
> limitations in the shell rather than in sed.  Doesn't that problem (bug
> #38372) still remain?  It seems like "cmd1 | cmd2" must initially be parsed
> by a single interpreter which means the overall command line length is
> still an issue.  Now that two UGLY_DEFS replacements have been taken out
> the line length may be under the original bug reporter's length, but that
> should probably be verified.

Oh, right. Well, did the original bug report ever identify exactly what
shell it is that has this limit?

It may not matter now (it is 2013, right?) but I remember there was some
old sed that had a limit of 100 expressions, so even if the command line
length is OK, it may still be necessary to use two calls to sed.

Or, maybe we should just fix this some other way.  If we need to do more
work on this, then maybe we could have configure generate shell scripts
that we run in place of the $(do_subst_config_vals) Make macro.  Then
the the target files that we generate can depend on the shell scripts
instead of the Makefile.

jwe

Loading...