Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable race detector. #658

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ all: agent credential-helper download-binaries ## Build everything

agent: ## Build the agent
@echo "Building Portainer agent..."
@CGO_ENABLED=0 GOOS=$(PLATFORM) GOARCH=$(ARCH) go build -trimpath --installsuffix cgo --ldflags "-s" -o dist/$(agent) cmd/agent/main.go
@GOOS=$(PLATFORM) GOARCH=$(ARCH) go build -race -trimpath --installsuffix cgo --ldflags "-s" -o dist/$(agent) cmd/agent/main.go

credential-helper: ## Build the credential helper (used by edge private registries)
@echo "Building Portainer credential-helper..."
Expand Down
4 changes: 2 additions & 2 deletions dev-scripts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ function compile_agent() {

cd cmd/agent || exit 1

local cmd=(go build -trimpath --installsuffix cgo)
local cmd=(go build -race -trimpath --installsuffix cgo)

ldflags="-s"
if [[ -n "$AGENT_VERSION" ]]; then
ldflags="$ldflags -X 'github.com/portainer/agent.Version=${AGENT_VERSION}'"
fi

GOOS="linux" GOARCH="$(go env GOARCH)" CGO_ENABLED=0 "${cmd[@]}" --ldflags "$ldflags"
GOOS="linux" GOARCH="$(go env GOARCH)" "${cmd[@]}" --ldflags "$ldflags"

rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function build_archive() {
function build_binary() {
platform=$1
arch=$2
GOOS="${platform}" GOARCH="${arch}" CGO_ENABLED=0 go build -a -trimpath --installsuffix cgo --ldflags '-s' "${MAIN}"
GOOS="${platform}" GOARCH="${arch}" go build -race -a -trimpath --installsuffix cgo --ldflags '-s' "${MAIN}"
mv main "dist/agent"
}

Expand Down
Loading