This is an archive of the discontinued LLVM Phabricator instance.

Set HOME for tests that use module cache path
ClosedPublic

Authored by ccross on Aug 30 2022, 4:27 PM.

Details

Summary

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.

Diff Detail

Event Timeline

ccross created this revision.Aug 30 2022, 4:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 4:27 PM
ccross requested review of this revision.Aug 30 2022, 4:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 4:27 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pirama accepted this revision.Sep 14 2022, 12:01 PM
pirama added a reviewer: srhines.
This revision is now accepted and ready to land.Sep 14 2022, 12:01 PM
srhines accepted this revision.Sep 14 2022, 12:07 PM
This revision was automatically updated to reflect the committed changes.