From: Eivind Eklund Date: 2007-11-21T23:04:41+09:00 Subject: Re: RubyGems 0.9.5 On Nov 21, 2007 6:31 AM, Austin Ziegler wrote: > > RubyGems needs to work correctly no matter where Ruby is installed. It > > needs to never modify files outside of --prefix (or installed defined > > directories) and it needs to consistently respect $GEM_HOME. > > Right. But you have to get it to know about those places -- and it > *does* consistently respect $GEM_HOME. Just because your maintainer > was stupid enough to MODIFY THE SOURCE rather than using, you know, > ENVIRONMENT VARIABLES doesn't make it RubyGems fault. The problem is that environment variables is a lousy way to keep around configuration for programs, for a variety of reasons: - They're hard to control generally (stuff remove them/limit to specific sets of them, there's no generic place to set them) - There is actually limited environment space and environment space, and every environment variable eats space from the arguments allowed to every process, no matter if it is related to Ruby or not. The POSIX default number of bytes for arguments plus environment variables (ARG_MAX) is actually 4096 bytes, so for POSIX minimal OS this is a real problem. In practice modern operating systems mostly set ARG_MAX in the range 64k to 256k. 64k still small enough that if all manner of stuff played around with using environment variables as their config, it would be a problem in practice for some. There are side effects of increasing ARG_MAX, e.g. increased kernel virtual memory use which goes at the expense of user space (unfortunate on 32-bit systems with large amounts of memory wanted for user space apps) and I expect increased RAM use per program. To my mind, the "right" way to deal with this particular issue would probably be to have RubyGems automatically patch itself on update, keeping the old paths around in the new "binary". Yeah, it's icky. It seems less icky than the alternative, which is an application that needs environment variables to work correctly, and (from a user's perspective, as seen by the initial complaint) mess up in the absence of them Eivind.