diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2019-01-29 21:20:28 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-31 18:18:55 -0800 |
commit | 9bcaf16c7de255e2e906bef795f0b62b0a19c124 (patch) | |
tree | ee5a2641476025a74bb8daa1c31385e989349a4f | |
parent | 5dedcb076082293782b0d720886d709150dfef2d (diff) | |
download | chrome-ec-9bcaf16c7de255e2e906bef795f0b62b0a19c124.tar.gz |
make: improve buildall problems reporting
When buildall fails for a reason other than failure to build a board
image, it is difficult to figure out what exactly went wrong, the
amount of output on the screen is overwhelming, the vast majority of
it having nothing to do with the failure.
Also, experience shows that the user does not really care about the
exact build phase when a failure happened. As soon as the user
detects file(s) in .failedboards directory, he/she can try building
the board separately and see what the problem is.
With this patch not only building the boards, but also running regular
tests, fuzz and cts tests will create appropriate files in the
./.failedboards directory when starting the appropriate make step and
will remove the files when succeeding.
Management of ./.failedboards directory is also being simplified: its
creation is enforced before building various targets, but cleaning
happens only when the target is buildall.
Now, after running 'make buildall' files in ./.failedboards give a
better indication of what went wrong:
- regular files - building board with this name failed
- files host-XXXX_fuzz - fuzzer XXX_fuzz failed
- files host-XXXX - test XXXX failed
- files cts-XXXX-YYY cts test for board XXX test YYY failed
BRANCH=none
BUG=none
TEST=created various failures and observed the appropriate leftovers
in ./.failedboards
Change-Id: Iadfe1c63da5db7fe37b8647b277b61a461de5399
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1444795
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | Makefile.rules | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Makefile.rules b/Makefile.rules index 73edbae82e..98a9e4b37b 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -157,10 +157,8 @@ FAILED_BOARDS_DIR = .failedboards try_build_boards: $(foreach b, $(BOARDS), proj-$(b)) .PHONY: build_boards -build_boards: - @rm -rf $(FAILED_BOARDS_DIR) - @mkdir $(FAILED_BOARDS_DIR) - @for b in $(BOARDS); do echo 'starting' > $(FAILED_BOARDS_DIR)/$$b; done +build_boards: | $(FAILED_BOARDS_DIR) + @rm -f $(FAILED_BOARDS_DIR)/* $(MAKE) try_build_boards .PHONY: buildall @@ -187,10 +185,7 @@ buildall: build_boards try_build_tests: $(foreach b, $(BOARDS), tests-$(b)) .PHONY: buildalltests -buildalltests: - @rm -rf $(FAILED_BOARDS_DIR) - @mkdir $(FAILED_BOARDS_DIR) - @for b in $(BOARDS); do echo 'starting' > $(FAILED_BOARDS_DIR)/$$b; done +buildalltests: | $(FAILED_BOARDS_DIR) $(MAKE) try_build_tests @echo "$@ completed successfully!" @@ -208,17 +203,15 @@ ifeq ($(TEST_BUILD),) endif # not a TEST_BUILD endif # CONFIG_EXPERIMENTAL_CONSOLE=y -proj-%: - @echo 'building' > $(FAILED_BOARDS_DIR)/$* +proj-%: | $(FAILED_BOARDS_DIR) + @touch $(FAILED_BOARDS_DIR)/$* @echo "======= building $*" $(MAKE) --no-print-directory BOARD=$* V=$(V) @rm $(FAILED_BOARDS_DIR)/$* tests-%: - @echo 'building tests' > $(FAILED_BOARDS_DIR)/$* @echo "======= building $* tests" $(MAKE) --no-print-directory BOARD=$* V=$(V) tests - @rm $(FAILED_BOARDS_DIR)/$* dis-y := $(out)/RW/$(PROJECT).RW.dis dis-$(CONFIG_FW_INCLUDE_RO) += $(out)/RO/$(PROJECT).RO.dis @@ -263,11 +256,13 @@ host-test-targets=$(foreach t,$(test-list-host),host-$(t)) run-test-targets=$(foreach t,$(test-list-host),run-$(t)) .PHONY: $(host-test-targets) $(run-test-targets) -$(host-test-targets): host-%: +$(host-test-targets): host-%: | $(FAILED_BOARDS_DIR) + @touch $(FAILED_BOARDS_DIR)/test-$* $(call quiet,host_test,BUILD ) $(run-test-targets): run-%: host-% $(call quiet,run_host_test,TEST ) + @rm -f $(FAILED_BOARDS_DIR)/test-$* # Fuzzing tests @@ -280,10 +275,15 @@ $(fuzz-test-targets): TEST_FLAG=TEST_FUZZ=y TEST_ASAN=$(TEST_ASAN) \ TEST_MSAN=$(TEST_MSAN) TEST_UBSAN=$(TEST_UBSAN) \ CROSS_COMPILE=$(shell echo $(HOSTCC) | grep -v ccache | \ sed -e 's/[^-]*$$//') -$(fuzz-test-targets): host-%: +$(fuzz-test-targets): host-%: | $(FAILED_BOARDS_DIR) + @touch $(FAILED_BOARDS_DIR)/test-$* $(call quiet,host_test,BUILD ) $(run-fuzz-test-targets): run-%: host-% $(call quiet,run_fuzz,TEST ) + @rm -f $(FAILED_BOARDS_DIR)/test-$* + +$(FAILED_BOARDS_DIR): + @mkdir $(FAILED_BOARDS_DIR) .PHONY: buildfuzztests buildfuzztests: $(fuzz-test-targets) @@ -307,8 +307,10 @@ cts_boards := stm32l476g-eval nucleo-f072rb # $2: board name define make-cts = build_cts: cts-$(1)-$(2) -cts-$(1)-$(2): +cts-$(1)-$(2): | $(FAILED_BOARDS_DIR) + @touch $(FAILED_BOARDS_DIR)/cts-$(2)-$(1) $$(MAKE) CTS_MODULE=$(1) BOARD=$(2) + @rm -f $(FAILED_BOARDS_DIR)/cts-$(2)-$(1) # Do not remove this blank line endef |