Skip to content

Commit

Permalink
Pass the netgo tag when building static binaries:
Browse files Browse the repository at this point in the history
- When building static binaries with CGO, cgo unix network segfaults
- When building dynamically linked binaries with CGO, everything is fine

prometheus/alertmanager#304
golang/go#7857

Signed-off-by: Ying Li <[email protected]>
  • Loading branch information
cyli committed Nov 15, 2016
1 parent ab9892b commit 8259514
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [v0.5.1](https://github.com/docker/notary/releases/tag/v0.5.1) 11/14/2016
+ If no `records` parameter is provided in a request for the changefeed, a default value of 100 is used.
+ Fix build tags for static notary client binaries in linux

## [v0.5.0](https://github.com/docker/notary/releases/tag/v0.5.0) 11/14/2016
+ Non-certificate public keys in PEM format can now be added to delegation roles [#965](https://github.com/docker/notary/pull/965)
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ ${PREFIX}/bin/static/notary:
else
${PREFIX}/bin/static/notary-server: NOTARY_VERSION $(shell find . -type f -name '*.go')
@echo "+ $@"
@(export CGO_ENABLED=0; go build -tags ${NOTARY_BUILDTAGS} -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary-server)
@(export CGO_ENABLED=0; go build -tags "${NOTARY_BUILDTAGS} netgo" -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary-server)

${PREFIX}/bin/static/notary-signer: NOTARY_VERSION $(shell find . -type f -name '*.go')
@echo "+ $@"
@(export CGO_ENABLED=0; go build -tags ${NOTARY_BUILDTAGS} -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary-signer)
@(export CGO_ENABLED=0; go build -tags "${NOTARY_BUILDTAGS} netgo" -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary-signer)

${PREFIX}/bin/static/notary:
@echo "+ $@"
@go build -tags ${NOTARY_BUILDTAGS} -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary
@go build -tags "${NOTARY_BUILDTAGS} netgo" -o $@ ${GO_LDFLAGS_STATIC} ./cmd/notary

endif

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for os in "$@"; do
go build \
-o "${NOTARYDIR}/cross/${GOOS}/${GOARCH}/${OUTFILE}" \
-a \
-tags "${BUILDTAGS}" \
-tags "${BUILDTAGS} netgo" \
-ldflags "-w ${CTIMEVAR} ${LDFLAGS}" \
./cmd/notary;
set +x;
Expand Down

0 comments on commit 8259514

Please sign in to comment.