Cygwin inherits Windows environment variables. Is you run 'set' from
a Windows Command Prompt, do you see thousands of lines? If so,
that's where they are coming from.
Cheers,
Chris
--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d
Execute the following, and please post the result: "set | wc -c"On Tue, Nov 8, 2011 at 1:28 PM, Martin Edwards <martinm...@gmail.com> wrote:Hi, I'm not sure if this is a mintty or cygwin thing.
When I try and run keychain I get the following message
xargs: environment is too large for exec
Running set to see what environment variables are set and I see thousands of lines, it looks like lots of functions that have been set.
Is this something to do with mintty or cygwin, I thought I had a fairly plain cygwin setup with mintty on top.
Any pointers or help appreciated.
Quite possibly. As I mentioned in an earlier email, start a Windows
Command Prompt (cmd.exe) and type 'set', if you see thousands of
environment variables, then it is Windows that is setting these and
Cygwin is inheriting them.
"set" in bash prints all variables and functions, not only the
environment. That's what the "env" command is for.
This looks like a bug in xargs. Even if the environment is too
big, it should print the information requested by --show-limits.
There's also another problem here. Under POSIX, the sysconf(_SC_ARG_MAX)
or ARG_MAX limit is the limit of environmant and arguments combined.
That's why xargs --show-limits subtracts the environment size from the
maxiumum usable command length:
$ xargs --show-limits
Your environment variables take up 1986 bytes
POSIX upper limit on argument length (this system): 27966
[...]
Maximum length of command we could actually use: 25980
Neither is the upper limit correct, nor does subtracting the environment
size make sense on Cygwin. These values are independent from each other.
As for ARG_MAX/_SC_ARG_MAX, it's set to 32000. That'a safe fallback for
calling native Windows applications.
Corinna
This looks like a bug in xargs. Even if the environment is too
big, it should print the information requested by --show-limits.