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

Chandler Carruth chandlerc at google.com
Wed Feb 11 17:12:15 PST 2015


On Wed, Feb 11, 2015 at 1:30 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:

> > On Feb 11, 2015, at 1:28 AM, Ilia K <ki.stfu at gmail.com> wrote:
> >
> > In 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
> >
> >
> > 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.

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


More information about the llvm-commits mailing list