truechain / truechain-engineering-code

Go implementation of TrueChain
GNU Lesser General Public License v3.0
100 stars 82 forks source link

Build v2.1.0 Failed #119

Closed letspesl closed 4 years ago

letspesl commented 4 years ago

When I build v2.1.0, I got this error. How can I fix it?

github.com/truechain/truechain-engineering-code/internal/jsre github.com/truechain/truechain-engineering-code/vendor/github.com/karalabe/hid In file included from vendor/github.com/karalabe/hid/hid_enabled.go:22: /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to [-Wcpp]

warning redirecting incorrect #include <sys/poll.h> to

^~~ github.com/truechain/truechain-engineering-code/vendor/gopkg.in/olebedev/go-duktape.v3 duk_logging.c: In function 'duk__logger_prototype_log_shared': duk_logging.c:184:64: warning: 'Z' directive writing 1 byte into a region of size between 0 and 9 [-Wformat-overflow=] sprintf((char ) date_buf, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", ^ duk_logging.c:184:2: note: 'sprintf' output between 25 and 85 bytes into a destination of size 32 sprintf((char ) date_buf, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", ^~~~~~~~~~~~~~~~~ (int) comp.year, (int) comp.month + 1, (int) comp.day,

          (int) comp.hours, (int) comp.minutes, (int) comp.seconds,
      (int) comp.milliseconds);
      ~~~~~~~~~~~~~~~~~~~~~~~~

util.go:45: exit status 2 exit status 1 make: *** [Makefile:16: getrue] Error 1

jiyilanzhou commented 4 years ago

which operating system win or mac? can you give me more detail error?

letspesl commented 4 years ago

I try it by using docker. My Dockerfile is the following. I got the error in "RUN make getrue"

FROM golang:1.10-alpine as construction

RUN apk add --no-cache make git gcc musl-dev linux-headers RUN git clone https://github.com/truechain/truechain-engineering-code /truechain-engineering-code

WORKDIR /truechain-engineering-code RUN git checkout tags/v2.1.0 && git submodule init && git submodule update --init --recursive RUN make getrue RUN ./build/env.sh go run ./build/ci.go install ./cmd/impawn

FROM alpine:latest

RUN apk add --no-cache ca-certificates COPY --from=construction /truechain-engineering-code/build/bin/getrue /usr/local/bin/ COPY --from=construction /truechain-engineering-code/build/bin/impawn /usr/local/bin/

EXPOSE 8545 8545 9215 9215 30310 30310 30311 30311 30313 30313 CMD ["getrue"]

letspesl commented 4 years ago

I solved this problem by using golang v1.14. Thanks for help all.

jiyilanzhou commented 4 years ago

good, latest Update go version need support 1.13 above