This is an archive of the discontinued LLVM Phabricator instance.

[Clang][ScanDeps] Change multiple-commands.c test to use -fmodules-cache-path on implicit builds
ClosedPublic

Authored by bruno on Sep 9 2022, 3:25 PM.

Details

Summary

The module cache escapes the test output dirs in this test. Since its default location maybe
composed of system and user related path this can cause problems in some builders (e.g. not
accessible paths inherited in a chroot environment).

Clean the test a bit by passing -fmodules-cache-path inside the test output dirs.

Diff Detail

Event Timeline

bruno created this revision.Sep 9 2022, 3:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 3:25 PM
Herald added subscribers: hoy, modimo, wenlei. · View Herald Transcript
bruno requested review of this revision.Sep 9 2022, 3:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 3:25 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir accepted this revision.Sep 9 2022, 3:28 PM

Thanks for catching this!

clang/test/ClangScanDeps/multiple-commands.c
11

Nit: we could just put it inside DIR/modcache and not need a second substitution.

This revision is now accepted and ready to land.Sep 9 2022, 3:28 PM
jansvoboda11 accepted this revision.Sep 9 2022, 3:29 PM

LGTM, thanks! Though we usually put the cache directory into %t/cache (aka DIR/cache in the JSON file) in other scanner tests, which would allow you to drop the second sed expression. (And you'd want to rm -rf %t instead.)

bruno added a comment.Sep 9 2022, 4:12 PM

Thanks for the fast review! Good suggestions, will apply and land.

This revision was landed with ongoing or failed builds.Sep 9 2022, 4:20 PM
This revision was automatically updated to reflect the committed changes.