r289176 - [CrashReproducer] Provide a clean dir path for -fmodules-cache-path
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 8 19:11:48 PST 2016
Author: bruno
Date: Thu Dec 8 21:11:48 2016
New Revision: 289176
URL: http://llvm.org/viewvc/llvm-project?rev=289176&view=rev
Log:
[CrashReproducer] Provide a clean dir path for -fmodules-cache-path
The most common workflow with module reproducers involves deleting the
module cache before running the script. This happens because leftovers
from the crash are present in the cache and could trigger unrelated and
confusing errors, misleading from the initial reproduction intent.
Change this to point to a clean path but leave the leftovers untouched.
rdar://problem/28655070
Modified:
cfe/trunk/lib/Driver/Job.cpp
cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m
cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m
cfe/trunk/test/Modules/crash-vfs-path-traversal.m
cfe/trunk/test/Modules/crash-vfs-relative-incdir.m
cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
cfe/trunk/test/Modules/crash-vfs-run-reproducer.m
Modified: cfe/trunk/lib/Driver/Job.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Job.cpp?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Job.cpp (original)
+++ cfe/trunk/lib/Driver/Job.cpp Thu Dec 8 21:11:48 2016
@@ -267,11 +267,14 @@ void Command::Print(raw_ostream &OS, con
OS << ' ';
printArg(OS, CrashInfo->VFSPath.str(), Quote);
- // Insert -fmodules-cache-path and use the relative module directory
- // <name>.cache/vfs/modules where we already dumped the modules.
+ // The leftover modules from the crash are stored in
+ // <name>.cache/vfs/modules
+ // Leave it untouched for pcm inspection and provide a clean/empty dir
+ // path to contain the future generated module cache:
+ // <name>.cache/vfs/repro-modules
SmallString<128> RelModCacheDir = llvm::sys::path::parent_path(
llvm::sys::path::parent_path(CrashInfo->VFSPath));
- llvm::sys::path::append(RelModCacheDir, "modules");
+ llvm::sys::path::append(RelModCacheDir, "repro-modules");
std::string ModCachePath = "-fmodules-cache-path=";
ModCachePath.append(RelModCacheDir.c_str());
Modified: cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m Thu Dec 8 21:11:48 2016
@@ -37,7 +37,7 @@
// CHECKSH-NOT: "-fmodules-cache-path="
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'type': 'directory',
// CHECKYAML: 'name': "",
Modified: cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m Thu Dec 8 21:11:48 2016
@@ -38,7 +38,7 @@
// CHECKSH-NOT: "-fmodules-cache-path="
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'case-sensitive':
// CHECKYAML-NEXT: 'use-external-names': 'false',
Modified: cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m Thu Dec 8 21:11:48 2016
@@ -39,7 +39,7 @@
// CHECKSH-NOT: "-fmodules-cache-path="
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'type': 'directory',
// CHECKYAML: 'name': "",
Modified: cfe/trunk/test/Modules/crash-vfs-path-traversal.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-traversal.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-traversal.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-traversal.m Thu Dec 8 21:11:48 2016
@@ -35,7 +35,7 @@
// CHECKSH-NOT: "-fmodules-cache-path="
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'case-sensitive':
// CHECKYAML-NEXT: 'use-external-names': 'false',
Modified: cfe/trunk/test/Modules/crash-vfs-relative-incdir.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-relative-incdir.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-relative-incdir.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-relative-incdir.m Thu Dec 8 21:11:48 2016
@@ -31,7 +31,7 @@
// CHECKSH: "-I" "/[[INCPATH:.*]]/include"
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'case-sensitive':
// CHECKYAML-NEXT: 'use-external-names': 'false',
@@ -53,6 +53,5 @@
// inside .cache/vfs, mapped by .cache/vfs/vfs.yaml.
// RUN: cd %t
-// RUN: rm -rf crash-vfs-relative-incdir-*.cache/modules
// RUN: chmod 755 crash-vfs-*.sh
// RUN: ./crash-vfs-*.sh
Modified: cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-relative-overlay.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-relative-overlay.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-relative-overlay.m Thu Dec 8 21:11:48 2016
@@ -34,7 +34,7 @@
// CHECKSH: "-isysroot" "{{[^"]*}}/i/"
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'case-sensitive':
// CHECKYAML-NEXT: 'use-external-names': 'false',
Modified: cfe/trunk/test/Modules/crash-vfs-run-reproducer.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-run-reproducer.m?rev=289176&r1=289175&r2=289176&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-run-reproducer.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-run-reproducer.m Thu Dec 8 21:11:48 2016
@@ -31,7 +31,7 @@
// CHECKSH: "-isysroot" "{{[^"]*}}/i/"
// CHECKSH: "crash-vfs-{{[^ ]*}}.m"
// CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
-// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/repro-modules"
// CHECKYAML: 'case-sensitive':
// CHECKYAML-NEXT: 'use-external-names': 'false',
@@ -53,6 +53,5 @@
// inside .cache/vfs, mapped by .cache/vfs/vfs.yaml.
// RUN: cd %t
-// RUN: rm -rf crash-vfs-run-reproducer-*.cache/modules/*
// RUN: chmod 755 crash-vfs-*.sh
// RUN: ./crash-vfs-*.sh
More information about the cfe-commits
mailing list