[PATCH] Fix llvm::sys::path::home_directory on unix to get path from passwd.pw_dir when the $HOME variable isn't set

Mehdi Amini mehdi.amini at apple.com
Wed Feb 11 17:17:05 PST 2015


> On Feb 11, 2015, at 5:12 PM, Chandler Carruth <chandlerc at google.com> wrote:
> 
> 
> On Wed, Feb 11, 2015 at 1:30 AM, Mehdi Amini <mehdi.amini at apple.com <mailto:mehdi.amini at apple.com>> wrote:
> > On Feb 11, 2015, at 1:28 AM, Ilia K <ki.stfu at gmail.com <mailto:ki.stfu at gmail.com>> wrote:
> >
> > In http://reviews.llvm.org/D7515#121843 <http://reviews.llvm.org/D7515#121843>, @joker.eph wrote:
> >
> >> FWIW, it seems to me that Python is doing it this way: https://github.com/enthought/Python-2.7.3/blob/master/Lib/posixpath.py <https://github.com/enthought/Python-2.7.3/blob/master/Lib/posixpath.py>
> >
> >
> > As you see my fix does the same thing.
> >
> > Are you interested in this patch? If so I can fix your remarks
> 
> 
> I am completely neutral. It’s Chandler’s call...
> 
> We'll see if Python has a strong influence on him  :)
> 
> FWIW, I'd rather not add the complexity. I'm not really swayed that this is important enough for us to add complex logic to handle the fallback case.
> 
> What would convince me we should add it would be existing and hard to change settings where HOME was removed from the environment, and thus users who were negatively impacted by us not providing a fallback. Currently, it seems like any failure to find the home directory will likely just expose a flawed runtime environment that needs to be fixed. But if there are users that need LLVM tools to work without the HOME variable *and* who need to access the home directory, then that would motivate adding this support.
> 

Completely makes sense to me.

Mehdi


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150211/a436a514/attachment.html>


More information about the llvm-commits mailing list