Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-12-03 Thread Roman Bolshakov
On Sun, Dec 02, 2018 at 01:26:52PM +0100, Bruno Haible wrote: > Roman Bolshakov wrote: > > But then we will need to correct calculation of VC_ARG_MAX. We can take > > formulae from [2]: > > expr `getconf ARG_MAX` - `env|wc -c` - `env|egrep '^[^ ]+='|wc -l` \* 4 - > > 2048 > > This formula

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-12-03 Thread Roman Bolshakov
On Mon, Dec 03, 2018 at 08:16:22AM +0100, Bernhard Voelker wrote: > On 11/30/18 12:14 PM, Roman Bolshakov wrote: > > May I ask you to review what way we should go with ARG_MAX? > > > > I'm okay with both ways whether it's: > > * computing effective argument length and passing it to "-s" option;

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-12-02 Thread Bernhard Voelker
On 11/30/18 12:14 PM, Roman Bolshakov wrote: > May I ask you to review what way we should go with ARG_MAX? > > I'm okay with both ways whether it's: > * computing effective argument length and passing it to "-s" option; > * or exploiting behaviour of GNU/BSD xargs and specifying "-n" beyond >

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-12-02 Thread Bruno Haible
Hi Roman, > May I ask you to review what way we should go with ARG_MAX? > > I'm okay with both ways whether it's: > * computing effective argument length and passing it to "-s" option; > * or exploiting behaviour of GNU/BSD xargs and specifying "-n" beyond >the limit. Use the approach

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-12-02 Thread Bruno Haible
Roman Bolshakov wrote: > But then we will need to correct calculation of VC_ARG_MAX. We can take > formulae from [2]: > expr `getconf ARG_MAX` - `env|wc -c` - `env|egrep '^[^ ]+='|wc -l` \* 4 - 2048 This formula assumes that a pointer in the 'environ' array is 4 bytes long. On 64-bit platforms it

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-11-30 Thread Roman Bolshakov
Hi Bruno, May I ask you to review what way we should go with ARG_MAX? I'm okay with both ways whether it's: * computing effective argument length and passing it to "-s" option; * or exploiting behaviour of GNU/BSD xargs and specifying "-n" beyond the limit. Thank you, Roman

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-11-28 Thread Roman Bolshakov
On Tue, Nov 27, 2018 at 07:40:24PM +0100, Bruno Haible wrote: > Roman Bolshakov wrote: > > if test -n "$$files"; then > > \ > > if test -n "$$prohibit"; then \ > > - grep $$with_grep_options

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-11-28 Thread Roman Bolshakov
On Tue, Nov 27, 2018 at 07:19:43PM +0100, Bruno Haible wrote: > Hi, > > > The workaround is to split argument list into chunks that operating > > system can process. "getconf ARG_MAX" is used to determine size of the > > chunk. > > Two questions on this: > > 1) People say that 'getconf ARG_MAX'

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-11-27 Thread Bruno Haible
Roman Bolshakov wrote: > if test -n "$$files"; then > \ > if test -n "$$prohibit"; then \ > - grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \ > + echo "$$files" | xargs -n

Re: [PATCH 1/2] maint.mk: Split long argument lists

2018-11-27 Thread Bruno Haible
Hi, > The workaround is to split argument list into chunks that operating > system can process. "getconf ARG_MAX" is used to determine size of the > chunk. Two questions on this: 1) People say that 'getconf ARG_MAX' returns the appromixate number of bytes in a command line. [1] But you

[PATCH 1/2] maint.mk: Split long argument lists

2018-11-27 Thread Roman Bolshakov
$(VC_LIST_EXCEPT) is usually expanded into arguments for a command. When a project contains too many, some operating systems can't pass all the arguments because they hit the limit of arguments. FreeBSD and macOS are known to have the limit of 256k of arguments. More on the issue: