util/testing: Give meaningful error if intel-sec-tools aren't around

Without manual handling, when 3rdparty/intel-sec-tools isn't around,
`make what-jenkins-does` reports only

    go: go.mod file not found in current directory or any parent directory; see 'go help modules'

which isn't meaningful or actionable. Instead check that the go.mod file
exists and bail out with a better error message before trying to run
`go mod vendor`.

Change-Id: I035747746ca5fd54841bd67352044dde12a28185
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57527
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Patrick Georgi 2021-09-09 13:42:29 +02:00 committed by Patrick Georgi
parent 05c6d65308
commit 673716dedd
1 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,11 @@ ifneq ($(JENKINS_SKIP_LINT_TESTS),y)
util/lint/lint lint-stable --junit util/lint/lint lint-stable --junit
util/lint/lint lint-extended --junit util/lint/lint lint-extended --junit
endif endif
if [ ! -f 3rdparty/intel-sec-tools/go.mod ]; then \
echo "Please download 3rdparty/intel-sec-tools/:"; \
echo "git submodule update --init 3rdparty/intel-sec-tools"; \
exit 1; \
fi
cd 3rdparty/intel-sec-tools/ ; go mod vendor cd 3rdparty/intel-sec-tools/ ; go mod vendor
util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/chromeos $(ABUILD_OPTIONS) -x -X $(top)/abuild-chromeos.xml util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/chromeos $(ABUILD_OPTIONS) -x -X $(top)/abuild-chromeos.xml
util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/default $(ABUILD_OPTIONS) util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/default $(ABUILD_OPTIONS)