Skip to content

Commit

Permalink
build binary with -trimpath
Browse files Browse the repository at this point in the history
  • Loading branch information
cuonglm committed Nov 14, 2019
1 parent e2568b3 commit c5f6881
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
cd $GOPATH/src/github.com/loadimpact/k6
echo "Building k6..."
CGO_ENABLED=0 GOARCH=$ARCH go build -a -ldflags '-s -w' -o /tmp/k6
CGO_ENABLED=0 GOARCH=$ARCH go build -a -trimpath -ldflags '-s -w' -o /tmp/k6
echo "Done!"
VERSION=${CIRCLE_TAG:1} ./packaging/gen-packages.sh
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.13-alpine as builder
WORKDIR $GOPATH/src/github.com/loadimpact/k6
ADD . .
RUN apk --no-cache add git
RUN CGO_ENABLED=0 go install -a -ldflags "-s -w -X github.com/loadimpact/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X github.com/loadimpact/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"

FROM alpine:3.10
RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- pandoc -s -f markdown -t rtf -o packaging\LICENSE.rtf LICENSE.md
- go version
- go build -a -ldflags "-s -w" -o packaging\k6.exe
- go build -a -trimpath -ldflags "-s -w" -o packaging\k6.exe
- cd %APPVEYOR_BUILD_FOLDER%\packaging
- candle.exe -arch x64 -dVERSION=%VERSION% k6.wxs
- light.exe -ext WixUIExtension k6.wixobj
Expand Down
2 changes: 1 addition & 1 deletion build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_dist() {
local DIR="k6-${VERSION}-${ALIAS}"

local BUILD_ENV=("${@:4}")
local BUILD_ARGS=(-o "dist/$DIR/k6${SUFFIX}")
local BUILD_ARGS=(-o "dist/$DIR/k6${SUFFIX}" -trimpath)

if [ -n "$VERSION_DETAILS" ]; then
BUILD_ARGS+=(-ldflags "-X github.com/loadimpact/k6/lib/consts.VersionDetails=$VERSION_DETAILS")
Expand Down

0 comments on commit c5f6881

Please sign in to comment.