Skip to content

Commit

Permalink
[FIXED] Release on linux amd64 is the only one dynamically linked
Browse files Browse the repository at this point in the history
We are using the tool from https://github.com/mitchellh/gox
for cross compilation. When we issue a new release, we create a
tag and trigger Travis build which will then invoke the script and
upload the files to GH.

We were affected by mitchellh/gox#55

Invoking the script on a Linux amd64 would produce this:

file pkg/gnatsd-linux-amd64/gnatsd
pkg/gnatsd-linux-amd64/gnatsd: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

With the fix, you'll get this:

file pkg/gnatsd-linux-amd64/gnatsd
pkg/gnatsd-linux-amd64/gnatsd: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), statically linked, stripped

Resolves nats-io#470
  • Loading branch information
kozlovic committed Apr 7, 2017
1 parent 64dcdd6 commit 67a4a37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/cross_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ -n $1 ]]; then
export APPNAME=$APPNAME-$1
fi

gox -osarch="$OSARCH" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-{{.OS}}-{{.Arch}}/gnatsd"
env CGO_ENABLED=0 gox -osarch="$OSARCH" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-{{.OS}}-{{.Arch}}/gnatsd"
for dir in $DIRS; do \
(cp README.md $OUTDIR/$APPNAME-$dir/README.md) ;\
(cp LICENSE $OUTDIR/$APPNAME-$dir/LICENSE) ;\
Expand Down

0 comments on commit 67a4a37

Please sign in to comment.