Skip to content

Commit

Permalink
Merge pull request #410 from klihub/devel/race-detector-in-debug-imag…
Browse files Browse the repository at this point in the history
…e-builds

build: enable race-detector in image build, too.
  • Loading branch information
fmuyassarov authored Nov 13, 2024
2 parents c003258 + c14d6b3 commit c386e91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ ifeq ($(DEBUG),1)
DOCKER_BUILD_DEBUG := --build-arg DEBUG=1
ifneq ($(NORACE),1)
BUILD_FLAGS += -race
else
DOCKER_BUILD_DEBUG += --build-arg NORACE=1
endif
endif

Expand Down Expand Up @@ -148,12 +150,12 @@ verify: verify-godeps verify-fmt verify-generate verify-build verify-docs
build-plugins: $(foreach bin,$(PLUGINS),$(BIN_PATH)/$(bin))

build-plugins-static:
$(MAKE) STATIC=1 DEBUG=$(DEBUG) build-plugins
$(MAKE) STATIC=1 DEBUG=$(DEBUG) NORACE=$(NORACE) build-plugins

build-binaries: $(foreach bin,$(BINARIES),$(BIN_PATH)/$(bin))

build-binaries-static:
$(MAKE) STATIC=1 DEBUG=$(DEBUG) build-binaries
$(MAKE) STATIC=1 DEBUG=$(DEBUG) NORACE=$(NORACE) build-binaries

build-images: images

Expand Down
3 changes: 2 additions & 1 deletion cmd/plugins/balloons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG IMAGE_VERSION
ARG BUILD_VERSION
ARG BUILD_BUILDID
ARG DEBUG=0
ARG NORACE=0

WORKDIR /go/builder

Expand All @@ -24,7 +25,7 @@ RUN go mod download
COPY . .

RUN make clean
RUN make IMAGE_VERSION=${IMAGE_VERSION} BUILD_VERSION=${BUILD_VERSION} BUILD_BUILDID=${BUILD_BUILDID} PLUGINS=nri-resource-policy-balloons DEBUG=$DEBUG V=$DEBUG build-plugins-static
RUN make IMAGE_VERSION=${IMAGE_VERSION} BUILD_VERSION=${BUILD_VERSION} BUILD_BUILDID=${BUILD_BUILDID} PLUGINS=nri-resource-policy-balloons DEBUG=$DEBUG NORACE=$NORACE V=$DEBUG build-plugins-static

RUN cpgodir() { \
mkdir -p $2; \
Expand Down
3 changes: 2 additions & 1 deletion cmd/plugins/topology-aware/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG IMAGE_VERSION
ARG BUILD_VERSION
ARG BUILD_BUILDID
ARG DEBUG=0
ARG NORACE=0

WORKDIR /go/builder

Expand All @@ -24,7 +25,7 @@ RUN go mod download
COPY . .

RUN make clean
RUN make IMAGE_VERSION=${IMAGE_VERSION} BUILD_VERSION=${BUILD_VERSION} BUILD_BUILDID=${BUILD_BUILDID} PLUGINS=nri-resource-policy-topology-aware DEBUG=$DEBUG V=$DEBUG build-plugins-static
RUN make IMAGE_VERSION=${IMAGE_VERSION} BUILD_VERSION=${BUILD_VERSION} BUILD_BUILDID=${BUILD_BUILDID} PLUGINS=nri-resource-policy-topology-aware DEBUG=$DEBUG NORACE=$NORACE V=$DEBUG build-plugins-static

RUN cpgodir() { \
mkdir -p $2; \
Expand Down

0 comments on commit c386e91

Please sign in to comment.