chirpstack / chirpstack-rest-api

ChirpStack gRPC API to REST proxy.
MIT License
17 stars 14 forks source link

Cant build #7

Closed fromnowhereuser closed 1 year ago

fromnowhereuser commented 1 year ago

Hello,

I am building againt ubuntu server 22 x86_64 GNU/Linux I am not able to build the binary. I have installed go, goreleaser, and build essential.

If a try a make: main.go:17:2: import "github.com/chirpstack/chirpstack-rest-api/ui" is a program, not an importable package

If i try a make dist ⨯ release failed after 2m6s error=failed to build for linux_amd64_v1: exit status 1: go: downloading github.com/goreleaser/goreleaser v1.10.2

I try to understand how gRPC call works, but, I have only few hours left to change version from 3 to 4 and i want to use this to handle the gap for the moment. Can you help me ?

t-huyeng commented 1 year ago

Did you try to use make devshell before using make build as mentioned in the readme?

make devshell
> docker-compose run --rm chirpstack-rest-api bash
bash-5.1# make build
> mkdir -p build
> go build -a -installsuffix cgo -ldflags "-s -w -X main.version=13fedf8" -o build/chirpstack-rest-api main.go
....

is working for me.

Also maybe asked your question at https://forum.chirpstack.io/ for more help.

fromnowhereuser commented 1 year ago

Thx you for the response, i did that too. the return of make build:

main.go:17:2: import "github.com/chirpstack/chirpstack-rest-api/ui" is a program, not an importable package

Something must be broken

t-huyeng commented 1 year ago

Can you check your go-version with go version It should output something like this : go version go1.18.7 linux/amd64.

If you use make devshell you should be inside the docker-container which should be configured correctly. So no need to install everything locally as you stated in the first post:

I have installed go, goreleaser, and build essential.

Can you confirm that you are inside the docker-container?

t-huyeng commented 1 year ago

@fromnowhereuser any updates on your side?

brocaar commented 1 year ago

Please use the provided Docker Compose based development environment for compiling. You will find instructions in the README.md. This environment comes with all requirements pre-installed and is also used for the testing and release pipeline.