Skip to content

task: calculate correct cmdline bytes

The previous patches to workaround http://support.microsoft.com/kb/830473 drastically over estimated the number of characters in commands by treating the repr() version of the command array as a reasonable estimator of commandline length. This caused commands attempt to write argsfiles before they should have.

The new calculation calculates the number characters in the command array and adds the number of spaces that would be added by ' '.join(cmd) this provides a much closer estimate of the commandline length.

This also limits the CLI-length on non windows platforms to 200kB. This prevents us hitting the much larger argument limits on Linux/BSD/MacOS platforms.

This addresses #2223

Merge request reports