[PATCH] D14446: Fallback to getpwuid() in path::home_directory() on Unix.

Rafael Espíndola via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 18 08:52:19 PST 2016


On 7 January 2016 at 11:47, Paweł Bylica <chfast at gmail.com> wrote:
> chfast added a comment.
>
> In http://reviews.llvm.org/D14446#296637, @rafael wrote:
>
>> > E.g. in llvm-lit testing environment.
>>
>>
>> Isn't the intention precisely to avoid tests creating files in the
>>  home directory or being dependent on global config entries?
>>
>> Cheers,
>> Rafael
>
>
> I'm not sure.
>
> 1. Temp directory does not fallback to $HOME.
> 2. Setting $HOME to "" might be a workaround.
> 3. On Windows Windows API is used to find out the user's home dir in case information from environment variables are not enough.
>
> I don't really need this change, so if you believe it is an overkill, I'm happy to drop it.

I am not sure, but I can see the point of unix and windows putting a
similar amount of effort to finding the home dir. I would suggest a
quick git blame to find who added uses of this function and ask them
what they expect. Given that we can start using getpwuid on unix or
drop the windows api calls.

Cheers,
Rafael


More information about the llvm-commits mailing list