TheThingsArchive / api

Generated code for accessing The Things Network v2 API
MIT License
12 stars 8 forks source link

make clean all fails #29

Closed bkircher67 closed 6 years ago

bkircher67 commented 6 years ago

Hello, if I execute the "make clean all" command on my Ubuntu 17.10 then after a few minutes I get this message and the setup terminates:

make[1]: Verzeichnis „/home/bernd/ttn/api“ wird betreten
/src: warning: directory does not exist.
/home/bernd/ttn/api/protocol/protocol.proto: File does not reside within any path specified using --proto_path (or -I).  You must specify a --proto_path which encompasses this file.  Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).
Makefile:46: die Regel für Ziel „protocol/protocol.pb.go“ scheiterte
make[1]: *** [protocol/protocol.pb.go] Fehler 1
make[1]: Verzeichnis „/home/bernd/ttn/api“ wird verlassen
Makefile:37: die Regel für Ziel „protos/go“ scheiterte
make: *** [protos/go] Fehler 2

KR Bernd

htdvisser commented 6 years ago

Thanks for your report.

This repository was extracted from our TheThingsNetwork/ttn repository, and heavily depends on Go and some Go dependencies. I'll try to update the README and Makefile to work around this.

htdvisser commented 6 years ago

Hi @bkircher67, could you try again with the newest master branch?

singularsyntax commented 6 years ago

I likewise have problems:

[vagrant@localhost api]$ make clean all
find . -name '*pb.go' -delete
find . -name '*pb.gw.go' -delete
rm -rf java/src/org/thethingsnetwork/api
find . -name '*_pb.js' -delete
rm -rf php/*
find . -name '*_pb.rb' -delete
find . -name '*_pb2.py' -delete
find . -name '*_pb2_grpc.py' -delete
rm -rf python/github python/github.com
rm -rf c/github.com/TheThingsNetwork
find . -name '*.swift' -delete
find . -name '*_mock.go' -delete
docker build -t thethingsnetwork/api-protoc:latest .
Sending build context to Docker daemon  3.24 MB
Step 1/7 : FROM golang:1.10 AS go_builder
Error parsing reference: "golang:1.10 AS go_builder" is not a valid repository/tag: invalid reference format
make: *** [docker] Error 1

It seems like the intent is to use Docker to encapsulate the protobuf API code generation build process. If so, it would probably make sense to also isolate and containerize the Golang dependencies from the host system.

htdvisser commented 6 years ago

Are you on a recent version of Docker? It looks like it doesn't understand the multi-stage build directive "FROM golang:1.10 AS go_builder" that was introduced more than a year ago with Docker 17.05.

singularsyntax commented 6 years ago

Yeah, it's old (the one that comes with CentOS 7):

[vagrant@localhost ~]$ docker --version
Docker version 1.13.1, build dded712/1.13.1

I'll try a newer version. It would be helpful to update the README with the minimum supported version.

htdvisser commented 6 years ago

That indeed looks pretty old. Everything should be okay with 17.05 or newer, but I haven't tested with it. If a newer version works for you, could you please submit a pull request adding the minimum version to the README? Thanks!

singularsyntax commented 6 years ago

Different problem now, on a recent version of Docker:

[vagrant@localhost api]$ docker --version
Docker version 18.06.1-ce, build e68fc7a

This is the error message:

Generating swift protos...
make[1]: Entering directory `/vagrant/ttn-playground/api'
make[1]: Leaving directory `/vagrant/ttn-playground/api'
mockgen -source=./protocol/lorawan/device.pb.go -package lorawan DeviceManagerClient > protocol/lorawan/device_mock.go
/bin/sh: mockgen: command not found
make: *** [mocks] Error 127
htdvisser commented 6 years ago

Hmm, mockgen is a Go tool that isn't really needed if we just want to compile the protos. You could work around this by removing the mocks dependency from the all target in the Makefile (currently that's line 9).