bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU enhancement -- $(xargs cmd, list)


From: Reid Madsen
Subject: Re: GNU enhancement -- $(xargs cmd, list)
Date: Tue, 7 Nov 2000 09:06:29 -0600 (CST)

Not so.  On Solaris, the xargs implementation limits the command line to 2K.
Not very useful IMO.

Reid

 > From: "Howard Chu" <address@hidden>
 > Cc: <address@hidden>, <address@hidden>
 > Date: Tue, 7 Nov 2000 01:19:26 -0800
 > MIME-Version: 1.0
 > Content-Type: text/plain;
 >      charset="iso-8859-1"
 > Content-Transfer-Encoding: 7bit
 > X-Priority: 3 (Normal)
 > X-MSMail-Priority: Normal
 > X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0
 > Importance: Normal
 > X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
 > 
 > I would omit the XARGS LEN. Presumably the local platform's xargs command is
 > already properly configured for the native system's line length limitations.
 > 
 >   -- Howard Chu
 >   Chief Architect, Symas Corp.       Director, Highland Sun
 >   http://www.symas.com               http://highlandsun.com/hyc
 > 
 > > -----Original Message-----
 > > From: address@hidden [mailto:address@hidden Behalf Of
 > > Reid Madsen
 > > Sent: Monday, November 06, 2000 5:42 PM
 > > To: address@hidden
 > > Cc: address@hidden; address@hidden
 > > Subject: Re: GNU enhancement -- $(xargs cmd, list)
 > >
 > >
 > >
 > >  > Date: 6 Nov 2000 16:56:30 -0600
 > >  > From: Reid Madsen <address@hidden>
 > >  >
 > >  > I also thought about using the _POSIX_ARG_MAX and ARG_MAX
 > > symbols to determine
 > >  > when the xargs approach was really needed.  If the command
 > > line is within
 > >  > limits, then
 > >  >
 > >  >         $(xargs cmd, list)
 > >  >
 > >  > would expand to:
 > >  >
 > >  >         cmd list
 > >  >
 > >  > Do you believe this is doable/portable?
 > >  >
 > >  > Reid
 > >  >
 > >  >
 > >  > FYI, a quick perusal of our systems shows:
 > >  >
 > >  >         POSIX_ARG_MAX   ARG_MAX
 > >  >         -------------   -------
 > >  > Solaris         4096    1MB
 > >  > HP              4096    2MB
 > >  > AIX             4096    24576   Pathetic!
 > >  > OSF             4096    38912   Pathetic!
 > >  > NT              4096    14500   Pathetic ** 2 !
 > >  >
 > >  > Gotta love those 2-4 byte per arg limits on AIX, OSF, and NT.
 > >
 > > After experimenting with this on Solaris for about 3 hours, I've
 > > come to the
 > > conclusion that this is way to complicated.  The 'exec' man page
 > > states that
 > > the error E2BIG is returned when the sum of the command length
 > > and environment
 > > length exceeds ARG_MAX.  So, armed with that information I when out and
 > > created a Makefile with enough big arguments to push it right up
 > > to the edge.
 > > Adding a single character would case make to fail with:
 > >
 > >    make: execvp: num_args: Arg list too long
 > >
 > > However the 'edge' was nowhere close to the size of the command line +
 > > environment.  It's off by about 100K.  Yuck!
 > >
 > > So, instead, I've decided that in addtion to the $(XARGS) variable that
 > > GNUmake should also define a $(XARGS_LEN) variable.  Which will be used to
 > > measure the length of the command line.  When less the
 > > $(XARGS_LEN), then a
 > > normal command is launched, otherwise xargs is launched as"
 > >
 > >    xargs -s $(XARGS_LEN) cmd << tmpfile
 > >
 > > In our build process, based on IMAKE, we can set XARGS_LEN
 > > differently for the
 > > different platforms we build on.  IMO, this is probably the most flexible.
 > >
 > > If you have a better idea, I'd be glad to hear it.
 > >
 > > Reid
 > >
 > > --
 > > Reid Madsen                             address@hidden
 > >
 > > Senior Member, Tech. Staff              (972) 536-3261 (Desk)
 > > I2 Technologies                         (214) 850-9613 (Cellular)
 > > --
 > > Making incrementally (without 'clean') since May 18, 2000.
 > > Long live incremental make!
 > >
 > > _______________________________________________
 > > Bug-make mailing list
 > > address@hidden
 > > http://mail.gnu.org/mailman/listinfo/bug-make
 > >
 > 


-- 
Reid Madsen                             address@hidden                      
Senior Member, Tech. Staff              (972) 536-3261 (Desk)
I2 Technologies                         (214) 850-9613 (Cellular)
--
Making incrementally (without 'clean') since May 18, 2000.
Long live incremental make!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]