From 3c482da09421e5e666380f2c248d6cfc1cf057d9 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Fri, 13 Jan 2017 06:33:49 -0800 Subject: [PATCH] [compilation db] fix problems with buck compilation database integration Summary: This fixes compilation database integration with buck. Some directories from command don't exist (specifically ones that should hold `dep.tmp`). To workaround this problem, create those directories when invoking clang command Reviewed By: jvillard, martinoluca Differential Revision: D4403580 fbshipit-source-id: 57bcfc7 --- infer/src/clang/ClangCommand.re | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/infer/src/clang/ClangCommand.re b/infer/src/clang/ClangCommand.re index daad3b37d..a73b91c6f 100644 --- a/infer/src/clang/ClangCommand.re +++ b/infer/src/clang/ClangCommand.re @@ -88,6 +88,12 @@ let clang_cc1_cmd_sanitizer cmd => { if (String.equal option "-arch" && String.equal arg "armv7k") { "armv7" /* replace armv7k arch with armv7 */ + } else if ( + String.is_suffix arg suffix::"dep.tmp" + ) { + /* compilation-database-buck integration produces path to `dep.tmp` file that doesn't exist. Create it */ + Unix.mkdir_p (Filename.dirname arg); + arg } else if ( String.equal option "-isystem" ) {