Add project-root to buck targers when looking for infer-deps.txt

Reviewed By: ngorogiannis

Differential Revision: D19014744

fbshipit-source-id: 2d03a6e57
master
Martin Trojer 5 years ago committed by Facebook Github Bot
parent 387ef518f9
commit 7c22d4169d

@ -154,7 +154,8 @@ class BuckAnalyzer:
if proc.returncode != 0:
return None
# remove target name prefixes from each line and split them into a list
out = [x.split(None, 1)[1] for x in buck_output.strip().split('\n')]
out = [os.path.join(self.args.project_root, x.split(None, 1)[1])
for x in buck_output.strip().split('\n')]
return [os.path.dirname(x)
if os.path.isfile(x) else x
for x in out if os.path.exists(x)]

@ -10,8 +10,8 @@ ANALYZER = checkers
BUCK_TARGET = //src:hello @buck_target.txt
SOURCES = $(wildcard src/*.c) $(wildcard src/subtarget1/*.c) $(wildcard src/subtarget2/*.c)
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-linters
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
INFER_OPTIONS = --report-custom-error --developer-mode --no-linters
INFERPRINT_OPTIONS = --issues-tests
CLEAN_EXTRA = buck-out
include $(TESTS_DIR)/infer.make

@ -11,7 +11,7 @@ B_CPP = src/b.cpp
BUCK_TARGET = //src:test
TEST_DETERMINATOR_RESULT = infer-out/changed_functions.json
DIFF_OUTPUT = diff.mod.test
INFER_OPTIONS = --flavors --process-clang-ast --no-linters --no-capture --export-changed-functions --modified-lines $(DIFF_OUTPUT) --project-root $(TESTS_DIR)
INFER_OPTIONS = --flavors --process-clang-ast --no-linters --no-capture --export-changed-functions --modified-lines $(DIFF_OUTPUT)
$(DIFF_OUTPUT):
$(QUIET)echo -n '$(A_CPP):' > diff.mod.test

@ -9,8 +9,8 @@ ROOT_DIR = $(TESTS_DIR)/../..
BUCK_TARGET = //src:hello @buck_target.txt
SOURCES = $(wildcard src/*.c) $(wildcard src/subtarget1/*.c) $(wildcard src/subtarget2/*.c)
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-linters
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
INFER_OPTIONS = --report-custom-error --developer-mode --no-linters
INFERPRINT_OPTIONS = --issues-tests
CLEAN_EXTRA = buck-out
include $(TESTS_DIR)/infer.make

@ -9,8 +9,8 @@ ROOT_DIR = $(TESTS_DIR)/../..
BUCK_TARGET = //src:hello
SOURCES = src/hello.c src/hello2.c
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
INFER_OPTIONS = --report-custom-error --developer-mode --project-root $(TESTS_DIR) --no-linters
INFERPRINT_OPTIONS = --project-root $(TESTS_DIR) --issues-tests
INFER_OPTIONS = --report-custom-error --developer-mode --no-linters
INFERPRINT_OPTIONS = --issues-tests
CLEAN_EXTRA = buck-out
include $(TESTS_DIR)/infer.make

Loading…
Cancel
Save