[clang] 0867c01 - [ClangScanDeps][test] Add -fmodules-cache-path=DIR/cache to make diagnostics.c hermetic

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 13 13:17:59 PDT 2021


Author: Fangrui Song
Date: 2021-09-13T13:17:55-07:00
New Revision: 0867c017e55e3a3d457f26bb778a2cd80d86e1f4

URL: https://github.com/llvm/llvm-project/commit/0867c017e55e3a3d457f26bb778a2cd80d86e1f4
DIFF: https://github.com/llvm/llvm-project/commit/0867c017e55e3a3d457f26bb778a2cd80d86e1f4.diff

LOG: [ClangScanDeps][test] Add -fmodules-cache-path=DIR/cache to make diagnostics.c hermetic

Otherwise it may access sys::path::cache_directory/clang/ModuleCache which may not be writable.

Added: 
    

Modified: 
    clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template

Removed: 
    


################################################################################
diff  --git a/clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template b/clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template
index 062e202328c86..c729ea980a64d 100644
--- a/clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template
+++ b/clang/test/ClangScanDeps/Inputs/diagnostics/cdb.json.template
@@ -1,7 +1,7 @@
 [
   {
     "directory": "DIR",
-    "command": "clang -c DIR/tu.c -fmodules -target i386-apple-ios14.0-simulator -Wno-error=invalid-ios-deployment-target -o DIR/tu.o",
+    "command": "clang -c DIR/tu.c -fmodules -target i386-apple-ios14.0-simulator -fmodules-cache-path=DIR/cache -Wno-error=invalid-ios-deployment-target -o DIR/tu.o",
     "file": "DIR/tu.c"
   }
 ]


        


More information about the cfe-commits mailing list