mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Remove '-s' flag from ldflags from the build
This retains the symbols (but still removes the dwarf info). This increases the executable size by ~8% (test on my laptop): $ go build -ldflags '-w' -o nats-server -rwxrwxr-x 1 yzhao yzhao 11911273 Jul 28 15:52 nats-server $ go build -ldflags '-s -w' -o nats-server -rwxrwxr-x 1 yzhao yzhao 11128832 Jul 28 15:52 nats-server Symbols are very useful during debugging. It would be great that if the NATS team consider including symbols.
This commit is contained in:
@@ -5,7 +5,7 @@ builds:
|
|||||||
id: nats-server
|
id: nats-server
|
||||||
binary: nats-server
|
binary: nats-server
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X github.com/nats-io/nats-server/server.gitCommit={{.ShortCommit}}
|
- -w -X github.com/nats-io/nats-server/server.gitCommit={{.ShortCommit}}
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=off
|
- GO111MODULE=off
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ builds:
|
|||||||
- main: ./main.go
|
- main: ./main.go
|
||||||
binary: nats-server
|
binary: nats-server
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X github.com/nats-io/nats-server/server.gitCommit={{.ShortCommit}}
|
- -w -X github.com/nats-io/nats-server/server.gitCommit={{.ShortCommit}}
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=off
|
- GO111MODULE=off
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ RUN mkdir -p src/github.com/nats-io && \
|
|||||||
cd src/github.com/nats-io/ && \
|
cd src/github.com/nats-io/ && \
|
||||||
git clone https://github.com/nats-io/natscli.git && \
|
git clone https://github.com/nats-io/natscli.git && \
|
||||||
cd natscli/nats && \
|
cd natscli/nats && \
|
||||||
go build -ldflags "-s -w -X main.version=${VERSION}" -o /nats
|
go build -ldflags "-w -X main.version=${VERSION}" -o /nats
|
||||||
|
|
||||||
RUN go get github.com/nats-io/nsc
|
RUN go get github.com/nats-io/nsc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user