From c9399797d8defbdb41f483d0bdbeb96c5777c82f Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Thu, 23 Jul 2020 07:27:35 -0700 Subject: Fix kokoro presubmits! Fixed the following error: tools/bazel.mk:119: *** Destination not provided.. Stop. The issue was that we were running all make commands in a subshell so variables like $T were not passed on. The other issue was related to credentials. The test passed locally but not on kokoro, the only difference in the workflow was the credentials bit. Also fixed up some other tiny issues I came across, were not blockers. PiperOrigin-RevId: 322782457 --- Makefile | 2 +- tools/bazel.mk | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9806e9901..b44eda445 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # Helpful pretty-printer. MAKEBANNER := \033[1;34mmake\033[0m -submake = echo -e '$(MAKEBANNER) $1' >&2; sh -c '$(MAKE) $1' +submake = echo -e '$(MAKEBANNER) $1' >&2; $(MAKE) $1 # Described below. OPTIONS := diff --git a/tools/bazel.mk b/tools/bazel.mk index b6f23fe7e..e27e907ab 100644 --- a/tools/bazel.mk +++ b/tools/bazel.mk @@ -30,9 +30,6 @@ DOCKER_SOCKET := /var/run/docker.sock # Bazel flags. OPTIONS += --test_output=errors --keep_going --verbose_failures=true -ifneq ($(AUTH_CREDENTIALS),) -OPTIONS += --auth_credentials=${AUTH_CREDENTIALS} --config=remote -endif BAZEL := bazel $(STARTUP_OPTIONS) # Non-configurable. @@ -71,7 +68,7 @@ SHELL=/bin/bash -o pipefail bazel-server-start: load-default ## Starts the bazel server. @mkdir -p $(BAZEL_CACHE) @mkdir -p $(GCLOUD_CONFIG) - @if docker ps --all | grep $(DOCKER_NAME); then docker rm $(DOCKER_NAME); fi + @if docker ps --all | grep $(DOCKER_NAME); then docker rm -f $(DOCKER_NAME); fi docker run -d --rm \ --init \ --name $(DOCKER_NAME) \ @@ -102,7 +99,7 @@ bazel-server: ## Ensures that the server exists. Used as an internal target. @docker exec $(DOCKER_NAME) true || $(MAKE) bazel-server-start .PHONY: bazel-server -build_cmd = docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) sh -o pipefail -c '$(BAZEL) $(STARTUP_OPTIONS) build $(OPTIONS) $(TARGETS)' +build_cmd = docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) sh -o pipefail -c '$(BAZEL) build $(OPTIONS) $(TARGETS)' build_paths = $(build_cmd) 2>&1 \ | tee /proc/self/fd/2 \ -- cgit v1.2.3