This is an archive of the discontinued LLVM Phabricator instance.

[clang] Allow CLANG_MODULE_CACHE_PATH env var to override module caching behavior
ClosedPublic

Authored by abrachet on May 30 2022, 1:45 PM.

Details

Summary

CLANG_MODULE_CACHE_PATH can be used to change where clang should put the module cache, or can be set to "" to disable caching entirely.

Diff Detail

Event Timeline

abrachet created this revision.May 30 2022, 1:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2022, 1:45 PM
abrachet requested review of this revision.May 30 2022, 1:45 PM

To give a bit of context behind this change, we have noticed that as of D125331, a single run of libc++ test suites generates 3.1G of data inside Clang's module cache. This is problematic in CI where we quickly run out of disk space as a consequence. We would like to have a way to either change the cache path to a temporary location, or disable it altogether, that could be used without having to pass an extra flag to every compiler invocation.

phosek added inline comments.May 30 2022, 3:18 PM
clang/test/Driver/modules-cache-path.m
4

This needs a trailing slash.

8

This needs a trailing slash.

abrachet updated this revision to Diff 432992.May 30 2022, 4:15 PM
abrachet marked 2 inline comments as done.
abrachet added inline comments.
clang/test/Driver/modules-cache-path.m
4

The classic "harmless" cosmetic change that I don't need to run tests again for :)

phosek accepted this revision.Jun 6 2022, 2:00 PM

LGTM this would be really valuable for our use cases, but please wait a few more days to give other reviewers a chance to respond.

This revision is now accepted and ready to land.Jun 6 2022, 2:00 PM
This revision was automatically updated to reflect the committed changes.
abrachet marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 9:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript