summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-03-14 21:34:03 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-03-25 09:48:23 +0100
commit473f2dec087288309cb169bf84c12124e1d7d7d1 (patch)
tree0b15d3921149d5c6689de251f363fa0338e4c7ef /compilerplugins
parented3a13ac9837b52e899bd82ccae1244988e99f47 (diff)
compilerplugins: fix clang plugin allowlists for sccache-dist
While icecream passes preprocessed (via -frewrite-includes) input to the compiler on stdin, sccache-dist writes it to a file at the same location as the source file in its sandbox. So we need a new heuristic to detect that the input has -frewrite-includes applied; there is not any variable that sccache sets, users could have SCCACHE_CACHE_SIZE set but only if they use the disk cache, so check CXX for now. Also set SCCACHE_EXTRAFILES to include log-areas.dox required by plugin. Change-Id: I4e00bfb0db7dab28f228fc0e85d753506e2c86b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112480 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/plugin.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 753c548cf252..c68eceb67c32 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -251,6 +251,12 @@ StringRef Plugin::getFilenameOfLocation(SourceLocation spellingLocation) const
}
else
{
+ char const*const pCXX = getenv("CXX");
+ if (pCXX && strstr(pCXX, "sccache"))
+ { // heuristic; sccache passes file with -frewrite-directives by name
+ s_Mode = STDIN;
+ return getFilenameOfLocation(spellingLocation);
+ }
auto const fn(compiler.getSourceManager().getFilename(spellingLocation));
if (!fn.data()) // wtf? happens in sot/source/sdstor/stg.cxx
{