Re: Good but ... mk-origtargz Allow more files to be deleted than can fit inside argv (`getconf ARG_MAX`)
Osamu Aoki: > > Maybe before discussing technical solutions, we should know what issues > we are addressing by this modification. Is there a real cases which you > need to have this patch? > I need this for rustc. Try "apt-get source rustc" now and "uscan --verbose", it will fail. I had to locally patch mk-origtargz for it to work. X -- GPG: ed25519/56034877E1F87C35 GPG: rsa4096/1318EFAC5FBBDBCE https://github.com/infinity0/pubkeys.git ___ devscripts-devel mailing list devscripts-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel
Re: Good but ... mk-origtargz Allow more files to be deleted than can fit inside argv (`getconf ARG_MAX`)
Hi, On Tue, Jan 23, 2018 at 03:58:11PM +0100, Mattia Rizzolo wrote: > On Tue, Jan 23, 2018 at 10:58:53PM +0900, Osamu Aoki wrote: > > This looks a reasonable patch. But I don't know why you chose > > 16384=0x400 as the max figure. ... (It's ARG_MAX is in BYTEs but ...) > Jan 13 21:39:31infinity0: why a magic number in the > mk-origtargz patch? > Jan 13 21:43:10(instead of running a getconf and getting the > value and use it, I suppose) > Jan 13 21:45:38(and then doing some computation to turn > number in something usable) > Jan 13 21:50:07 jamessan[m]: it's `getconf ARG_MAX` / 128 > which i felt was a reasonable path length for source filenames > Jan 13 21:50:33 and worked in practise for me (larger values > like 3 broke) > Jan 13 21:56:52infinity0: yes, but why not detecting it at > runtime (and a comment explaining why 128 is better than NAME_MAX=255) > Jan 13 21:57:09 because it would involve more perl code > > > So I agree. Please don't merge that as it is until somebody does what's > written here ↑. Maybe before discussing technical solutions, we should know what issues we are addressing by this modification. Is there a real cases which you need to have this patch? I don't know perl at all but in rough idea in perl/python mix pseudo code: # suppose @args has all the filename paths $max = `getconf ARG_MAX`; $file = shift; while #args > 0 $cmdline = "command "; while (total_length($cmdline) + len($file) -2 < $max) { $cmdline = $cmdline . " " . $file; $file = shift; } if ("command " != $cmdline ) { shell_out_code($cmdline); } else { error_message; } Then it is guaranteed to be within ARG_MAX. But is these such case? Osamu > -- > regards, > Mattia Rizzolo > > GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`. > more about me: https://mapreri.org : :' : > Launchpad user: https://launchpad.net/~mapreri `. `'` > Debian QA page: https://qa.debian.org/developer.php?login=mattia `- ___ devscripts-devel mailing list devscripts-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel
Re: Good but ... mk-origtargz Allow more files to be deleted than can fit inside argv (`getconf ARG_MAX`)
Osamu Aoki: > Hi, > > [..] > > This looks a reasonable patch. But I don't know why you chose > 16384=0x400 as the max figure. > > Following your comment, I tried on my local machine > $ getconf ARG_MAX > 2097152 > > This is bigger than 16384. > > If this is different on different system, why not dynamically check and > set it with some safety margin like `getconf ARG_MAX` - 16 etc.? > Hi Osamu, ARG_MAX is measured in bytes, not number of arguments. I calculated 16384 as 2M / 128, 128 being a generously-high estimated value for "average path length" in debian packages. I agree it would be clearer to replace 16384 with `getconf ARG_MAX / AV_PATH_LENGTH_EST` and define AV_PATH_LENGTH_EST = 128 near the top, but my perl knowledge is very basic and I wasn't sure of the best way to shell out to another program. X -- GPG: ed25519/56034877E1F87C35 GPG: rsa4096/1318EFAC5FBBDBCE https://github.com/infinity0/pubkeys.git ___ devscripts-devel mailing list devscripts-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel
Re: Good but ... mk-origtargz Allow more files to be deleted than can fit inside argv (`getconf ARG_MAX`)
On Tue, Jan 23, 2018 at 10:58:53PM +0900, Osamu Aoki wrote: > This looks a reasonable patch. But I don't know why you chose > 16384=0x400 as the max figure. > > Following your comment, I tried on my local machine > $ getconf ARG_MAX > 2097152 > > This is bigger than 16384. > > If this is different on different system, why not dynamically check and > set it with some safety margin like `getconf ARG_MAX` - 16 etc.? Related lines from IRC: Jan 13 21:39:31infinity0: why a magic number in the mk-origtargz patch? Jan 13 21:43:10(instead of running a getconf and getting the value and use it, I suppose) Jan 13 21:45:38(and then doing some computation to turn number in something usable) Jan 13 21:50:07 jamessan[m]: it's `getconf ARG_MAX` / 128 which i felt was a reasonable path length for source filenames Jan 13 21:50:33 and worked in practise for me (larger values like 3 broke) Jan 13 21:56:52infinity0: yes, but why not detecting it at runtime (and a comment explaining why 128 is better than NAME_MAX=255) Jan 13 21:57:09 because it would involve more perl code So I agree. Please don't merge that as it is until somebody does what's written here ↑. -- regards, Mattia Rizzolo GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`. more about me: https://mapreri.org : :' : Launchpad user: https://launchpad.net/~mapreri `. `'` Debian QA page: https://qa.debian.org/developer.php?login=mattia `- signature.asc Description: PGP signature ___ devscripts-devel mailing list devscripts-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel