Mercurial > hg > truffle
comparison mxtool/mx.py @ 19921:ea280aa54d58
Fix arg limit on Mac
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 17 Mar 2015 11:22:56 -0700 |
parents | bd953f563517 |
children | 6e5df2d60fbd |
comparison
equal
deleted
inserted
replaced
19920:7366593c0610 | 19921:ea280aa54d58 |
---|---|
2821 # 32,768 characters (http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx) | 2821 # 32,768 characters (http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx) |
2822 limit = 32768 - commandLinePrefixAllowance | 2822 limit = 32768 - commandLinePrefixAllowance |
2823 else: | 2823 else: |
2824 # Using just SC_ARG_MAX without extra downwards adjustment | 2824 # Using just SC_ARG_MAX without extra downwards adjustment |
2825 # results in "[Errno 7] Argument list too long" on MacOS. | 2825 # results in "[Errno 7] Argument list too long" on MacOS. |
2826 commandLinePrefixAllowance -= 20000 | 2826 commandLinePrefixAllowance = 20000 |
2827 syslimit = os.sysconf('SC_ARG_MAX') | 2827 syslimit = os.sysconf('SC_ARG_MAX') |
2828 if syslimit == -1: | 2828 if syslimit == -1: |
2829 syslimit = 262144 # we could use sys.maxint but we prefer a more robust smaller value | 2829 syslimit = 262144 # we could use sys.maxint but we prefer a more robust smaller value |
2830 limit = syslimit - commandLinePrefixAllowance | 2830 limit = syslimit - commandLinePrefixAllowance |
2831 assert limit > 0 | 2831 assert limit > 0 |