Skip to content

Commit

Permalink
Merge pull request #1343 from iotaledger/develop
Browse files Browse the repository at this point in the history
Fix build issues (#1340)
  • Loading branch information
capossele authored May 24, 2021
2 parents a7cc89e + 336d93e commit 64ef162
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ builds:
- id: goshimmer
binary: goshimmer
flags:
- -tags=builtin_static,rocksdb
- -tags=rocksdb,builtin_static,netgo
ldflags:
- -s -w -X github.com/iotaledger/goshimmer/plugins/banner.AppVersion={{.Version}}
main: main.go
goos:
- linux
goarch:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# golang 1.16.3-buster amd64
FROM golang@sha256:dfa3cef088454200d6b48e2a911138f7d5d9afff77f89243eea6342f16ddcfb0 AS build

ARG BUILD_TAGS=builtin_static,rocksdb
ARG BUILD_TAGS=rocksdb,builtin_static,netgo

# Ensure ca-certficates are up to date
RUN update-ca-certificates
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ We always recommend to run your node via [Docker](https://goshimmer.docs.iota.or

Please follow this guide: https://github.com/facebook/rocksdb/blob/master/INSTALL.md to build above libs.

Finally, when compiling GoShimmer, just add the option `-tags rocksdb`:
Finally, when compiling GoShimmer, just run the build script:

```bash
go build -tags rocksdb
./scripts/build.sh
```

If you also want to link the libraries statically (only on Linux) run this instead:
```bash
./scripts/build_goshimmer_rocksdb_builtin.sh
```

## Supporting the project
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/iotaledger/goshimmer

go 1.16

replace github.com/linxGnu/grocksdb => github.com/gohornet/grocksdb v1.6.34-0.20210505192124-94dfdec03284
replace github.com/linxGnu/grocksdb => github.com/gohornet/grocksdb v1.6.34-0.20210518222204-d6ea5eedcfb9

require (
github.com/DataDog/zstd v1.4.8 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
github.com/gohornet/grocksdb v1.6.34-0.20210505192124-94dfdec03284 h1:vfRtUdFkakrGpvoxNIhfrPp89vlMR2ufLOtsW+s2Gdc=
github.com/gohornet/grocksdb v1.6.34-0.20210505192124-94dfdec03284/go.mod h1:/+iSQrn7Izt6kFhHBQvcE6FkklsKXa8hc35pFyFDrDw=
github.com/gohornet/grocksdb v1.6.34-0.20210518222204-d6ea5eedcfb9 h1:XaOoA14ZQgURuB+DOZibjEDjx3vB/bD4u2thLB5tK9U=
github.com/gohornet/grocksdb v1.6.34-0.20210518222204-d6ea5eedcfb9/go.mod h1:/+iSQrn7Izt6kFhHBQvcE6FkklsKXa8hc35pFyFDrDw=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
commit_hash=$(git rev-parse --short HEAD)

go build -ldflags="-s -w -X github.com/iotaledger/goshimmer/plugins/banner.AppVersion=${latest_tag:1}-$commit_hash"
go build -ldflags="-s -w -X github.com/iotaledger/goshimmer/plugins/banner.AppVersion=${latest_tag:1}-$commit_hash" -tags rocksdb,netgo
9 changes: 9 additions & 0 deletions scripts/build_goshimmer_rocksdb_builtin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
#
# Builds GoShimmer with the latest git tag and commit hash (short)
# E.g.: ./goshimmer -v --> GoShimmer 0.3.0-f3b76ae4

latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
commit_hash=$(git rev-parse --short HEAD)

go build -ldflags="-s -w -X github.com/iotaledger/goshimmer/plugins/banner.AppVersion=${latest_tag:1}-$commit_hash" -tags rocksdb,builtin_static,netgo
2 changes: 1 addition & 1 deletion tools/docker-network/builder/docker-compose.builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: builder
image: golang:1.16.2
working_dir: /tmp/goshimmer/
entrypoint: go install -tags rocksdb main.go pkged.go
entrypoint: go install -tags builtin_static,rocksdb,netgo main.go pkged.go
volumes:
- ../../..:/tmp/goshimmer:ro
- goshimmer-cache:/go
Expand Down

0 comments on commit 64ef162

Please sign in to comment.