[all-commits] [llvm/llvm-project] 7fe475: Set HOME for tests that use module cache path

colincross via All-commits all-commits at lists.llvm.org
Thu Sep 15 17:10:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7fe475756b26080fe0bb02e8e317662ccc9a01f1
      https://github.com/llvm/llvm-project/commit/7fe475756b26080fe0bb02e8e317662ccc9a01f1
  Author: Colin Cross <ccross at android.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M clang/test/Driver/modules-cache-path.m
    M clang/test/Modules/driver.c
    M clang/test/Unit/lit.cfg.py

  Log Message:
  -----------
  Set HOME for tests that use module cache path

Getting the default module cache path calls llvm::sys::path::cache_directory,
which calls home_directory, which checks the HOME environment variable
before falling back to getpwuid.  When compiling against musl libc,
which does not support NSS, and running on a machine that doesn't have
the current user in /etc/passwd due to NSS, no home directory can
be found.  Set the HOME environment variable in the tests to avoid
depending on getpwuid.

Reviewed By: pirama, srhines

Differential Revision: https://reviews.llvm.org/D132984




More information about the All-commits mailing list