[deadcode] keep intermediate files around on failure

Summary:
The are already ignored by git and can be useful to 1) debug when the
deadcode Makefile has a bug, and 2) help incremental analysis.

Reviewed By: ngorogiannis

Differential Revision: D21277538

fbshipit-source-id: dc6394ed7
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent 2b0ff5d160
commit 5580bc8901

@ -182,11 +182,8 @@ detect_dead_code:
sort -u "$$tmp_file_copied" > $(ALL_ML_FILES_COPIED); \ sort -u "$$tmp_file_copied" > $(ALL_ML_FILES_COPIED); \
rm "$$tmp_file_copied" rm "$$tmp_file_copied"
$(MAKE) -j 1 detect_dead_src_file $(MAKE) -j 1 detect_dead_src_file
# build and get dead code warnings; clean in case of errors so as not to leave rubbish around # build and get dead code warnings
if ! dune build --profile test all_infer_in_one_file.bc; then \ dune build --profile test all_infer_in_one_file.bc
$(MAKE) clean; \
exit 1; \
fi
# be paranoid about cleaning because we do not want to include infer_in_one_file into infer by # be paranoid about cleaning because we do not want to include infer_in_one_file into infer by
# accident and I don't know enough dune to be positive that it won't happen # accident and I don't know enough dune to be positive that it won't happen
$(MAKE) clean $(MAKE) clean
@ -232,17 +229,9 @@ detect_dead_src_file:
(is_in_blacklist "$$i") || (echo "$$i" >> "$$tmp_file"); \ (is_in_blacklist "$$i") || (echo "$$i" >> "$$tmp_file"); \
done; \ done; \
sort -u "$$tmp_file" > $(ALL_MLI_FILES_COPIED); \ sort -u "$$tmp_file" > $(ALL_MLI_FILES_COPIED); \
rm "$$tmp_file"; \ rm "$$tmp_file"
diff $(ALL_ML_FILES) $(ALL_ML_FILES_COPIED) 1>&2
if ! diff $(ALL_ML_FILES) $(ALL_ML_FILES_COPIED) 1>&2; then \ diff $(ALL_MLI_FILES) $(ALL_MLI_FILES_COPIED) 1>&2
$(MAKE) clean; \
exit 1; \
fi
if ! diff $(ALL_MLI_FILES) $(ALL_MLI_FILES_COPIED) 1>&2; then \
$(MAKE) clean; \
exit 1; \
fi
.PHONY: clean .PHONY: clean
clean: clean:

Loading…
Cancel
Save