mosn / layotto

A fast and efficient cloud native application runtime
http://mosn.io/layotto/
Apache License 2.0
822 stars 170 forks source link

Failed to build layotto #68

Closed pinxiong closed 3 years ago

pinxiong commented 3 years ago

What happened:

I tried to run build this project and know how it works, so I downloaded the source code and then followed the quick-start to run the apollo demo.

Failed to run the command below:

cd ${projectpath}/cmd/layotto
go build

Error

****:layotto ****$ go build
go: downloading github.com/dapr/components-contrib v1.2.0
go: downloading github.com/dapr/kit v0.0.1
go: downloading github.com/urfave/cli v1.22.1
go: downloading google.golang.org/grpc v1.37.0
go: downloading mosn.io/mosn v0.22.1-0.20210425073346-b6880db4669c
go: downloading mosn.io/pkg v0.0.0-20210401090620-f0e0d1a3efce
go: downloading github.com/aws/aws-sdk-go v1.27.0
go: downloading github.com/Azure/azure-event-hubs-go v1.3.1
go: downloading github.com/Azure/azure-storage-blob-go v0.8.0
go: downloading github.com/Azure/go-autorest v14.2.0+incompatible
go: downloading cloud.google.com/go v0.65.0
go: downloading google.golang.org/api v0.32.0
go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
go: downloading github.com/apache/pulsar-client-go v0.1.0
go: downloading github.com/cenkalti/backoff/v4 v4.1.0
go: downloading github.com/Azure/go-autorest/autorest v0.11.12
go: downloading github.com/Azure/azure-service-bus-go v0.10.10
go: downloading github.com/nats-io/nats.go v1.10.1-0.20210330225420-a0b1f60162f8
go: downloading github.com/hazelcast/hazelcast-go-client v0.0.0-20190530123621-6cf767c2f31a
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/Azure/go-amqp v0.13.1
go: downloading github.com/Shopify/sarama v1.23.1
go: downloading github.com/nats-io/stan.go v0.8.3
go: downloading github.com/go-redis/redis v6.15.9+incompatible
go: downloading github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271
go: downloading cloud.google.com/go/pubsub v1.3.1
go: downloading github.com/eclipse/paho.mqtt.golang v1.3.2
go: downloading github.com/go-redis/redis/v8 v8.8.0
go: downloading github.com/aerospike/aerospike-client-go v4.5.0+incompatible
go: downloading github.com/agrea/ptr v0.0.0-20180711073057-77a518d99b7b
go: downloading github.com/Azure/azure-sdk-for-go v48.2.0+incompatible
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/a8m/documentdb v1.2.1-0.20190920062420-efdd52fe0905
go: downloading github.com/gocql/gocql v0.0.0-20191018090344-07ace3bab0f8
go: downloading cloud.google.com/go/datastore v1.1.0
go: downloading gopkg.in/couchbase/gocb.v1 v1.6.4
go: downloading github.com/hashicorp/consul/api v1.3.0
go: downloading github.com/golang/protobuf v1.5.0
go: downloading github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
go: downloading go.mongodb.org/mongo-driver v1.1.2
go: downloading github.com/go-sql-driver/mysql v1.5.0
go: downloading github.com/jackc/pgx v3.6.2+incompatible
go: downloading github.com/dancannon/gorethink v4.0.0+incompatible
go: downloading github.com/golang/mock v1.4.4
go: downloading github.com/jackc/pgx/v4 v4.6.0
go: downloading github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73
go: downloading github.com/hashicorp/go-multierror v1.0.0
go: downloading github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
go: downloading mosn.io/api v0.0.0-20210414070543-8a0686b03540
go: downloading github.com/valyala/fasthttp v1.26.0
go: downloading github.com/zouyx/agollo/v4 v4.0.7
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading golang.org/x/net v0.0.0-20210510120150-4163338589ed
go: downloading github.com/alibaba/sentinel-golang v1.0.2
go: downloading github.com/prometheus/client_golang v1.8.0
go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
go: downloading go.uber.org/atomic v1.7.0
go: downloading github.com/miekg/dns v1.0.14
go: downloading github.com/mosn/easygo v0.0.0-20201210062404-62796fdb3827
go: downloading golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
go: downloading github.com/Azure/azure-amqp-common-go v1.1.4
go: downloading github.com/Azure/azure-pipeline-go v0.2.1
go: downloading github.com/Azure/go-autorest/autorest/date v0.3.0
go: downloading github.com/Azure/go-autorest/autorest/adal v0.9.5
go: downloading go.opencensus.io v0.22.5
go: downloading github.com/Azure/go-autorest/autorest/to v0.4.0
go: downloading github.com/jpillora/backoff v1.0.0
go: downloading github.com/mitchellh/mapstructure v1.3.3
go: downloading pack.ag/amqp v0.11.2
go: downloading google.golang.org/genproto v0.0.0-20201204160425-06b3db808446
go: downloading github.com/Azure/go-autorest/tracing v0.6.0
go: downloading github.com/Azure/azure-amqp-common-go/v3 v3.1.0
go: downloading github.com/devigned/tab v0.1.1
go: downloading nhooyr.io/websocket v1.8.6
go: downloading github.com/nats-io/nkeys v0.3.0
go: downloading github.com/nats-io/nuid v1.0.1
go: downloading github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798
go: downloading github.com/eapache/go-resiliency v1.2.0
go: downloading github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21
go: downloading github.com/eapache/queue v1.1.0
go: downloading github.com/jcmturner/gofork v1.0.0
go: downloading github.com/pierrec/lz4 v2.0.5+incompatible
go: downloading gopkg.in/jcmturner/gokrb5.v7 v7.3.0
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
go: downloading github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
go: downloading go.opentelemetry.io/otel v0.19.0
go: downloading github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e
go: downloading github.com/opentracing/opentracing-go v1.2.0
go: downloading gopkg.in/couchbase/gocbcore.v7 v7.1.18
go: downloading gopkg.in/couchbaselabs/gocbconnstr.v1 v1.0.4
go: downloading gopkg.in/couchbaselabs/jsonx.v1 v1.0.0
go: downloading github.com/hashicorp/go-rootcerts v1.0.0
go: downloading github.com/hashicorp/serf v0.8.2
go: downloading github.com/golang/snappy v0.0.3
go: downloading github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed
go: downloading golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
go: downloading gopkg.in/fatih/pool.v2 v2.0.0
go: downloading gopkg.in/gorethink/gorethink.v4 v4.1.0
go: downloading github.com/jackc/pgconn v1.5.0
go: downloading github.com/jackc/pgtype v1.3.0
go: downloading github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/hashicorp/go-syslog v1.0.0
go: downloading golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5
go: downloading github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae
go: downloading github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d
go: downloading istio.io/api v0.0.0-20200227213531-891bf31f3c32
go: downloading mosn.io/proxy-wasm-go-host v0.0.0-20210312032409-2334f9cf62ec
go: downloading github.com/andybalholm/brotli v1.0.2
go: downloading github.com/klauspost/compress v1.12.2
go: downloading github.com/valyala/bytebufferpool v1.0.0
go: downloading github.com/gammazero/workerpool v1.1.2
go: downloading github.com/russross/blackfriday v2.0.0+incompatible
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading go.uber.org/automaxprocs v1.3.0
go: downloading github.com/dchest/siphash v1.2.1
go: downloading github.com/prometheus/common v0.14.0
go: downloading github.com/prometheus/procfs v0.6.0
go: downloading github.com/hashicorp/go-plugin v1.0.1
go: downloading github.com/trainyao/go-maglev v0.0.0-20200611125015-4c1ae64d96a8
go: downloading github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149
go: downloading github.com/Azure/go-autorest/logger v0.2.0
go: downloading github.com/form3tech-oss/jwt-go v3.2.2+incompatible
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/Azure/go-autorest/autorest/validation v0.3.0
go: downloading github.com/satori/go.uuid v1.2.0
go: downloading gopkg.in/jcmturner/dnsutils.v1 v1.0.1
go: downloading github.com/hashicorp/go-uuid v1.0.1
go: downloading go.opentelemetry.io/otel/metric v0.19.0
go: downloading go.opentelemetry.io/otel/trace v0.19.0
go: downloading github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
go: downloading github.com/jackc/pgio v1.0.0
go: downloading github.com/jackc/pgproto3 v1.1.0
go: downloading github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878
go: downloading github.com/jackc/chunkreader v1.0.0
go: downloading github.com/jackc/pgproto3/v2 v2.0.1
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/chunkreader/v2 v2.0.1
go: downloading github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8
go: downloading github.com/shirou/gopsutil v3.21.3+incompatible
go: downloading github.com/spf13/viper v1.7.1
go: downloading github.com/gammazero/deque v0.1.0
go: downloading istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c
go: downloading github.com/xdg/stringprep v1.0.0
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/google/cel-go v0.5.1
go: downloading github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403
go: downloading github.com/envoyproxy/protoc-gen-validate v0.1.0
go: downloading github.com/juju/errors v0.0.0-20190930114154-d42613fe1ab9
go: downloading github.com/hashicorp/go-hclog v0.14.1
go: downloading github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb
go: downloading github.com/mitchellh/go-testing-interface v1.0.0
go: downloading github.com/oklog/run v1.0.0
go: downloading gopkg.in/jcmturner/rpc.v1 v1.1.0
go: downloading github.com/google/go-cmp v0.5.5
go: downloading github.com/hashicorp/go-immutable-radix v1.0.0
go: downloading github.com/apache/dubbo-go-hessian2 v1.7.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/pelletier/go-toml v1.2.0
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/spf13/jwalterweatherman v1.0.0
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading gopkg.in/ini.v1 v1.51.0
go: downloading github.com/tklauser/go-sysconf v0.3.5
go: downloading golang.org/x/tools v0.0.0-20210106214847-113979e3529a
go: downloading github.com/census-instrumentation/opencensus-proto v0.2.1
go: downloading github.com/fatih/color v1.7.0
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading gopkg.in/jcmturner/aescts.v1 v1.0.1
go: downloading github.com/dubbogo/gost v1.9.0
go: downloading github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f
go: downloading github.com/mattn/go-colorable v0.1.4
# mosn.io/pkg/utils
../../../../../go/pkg/mod/mosn.io/pkg@v0.0.0-20210401090620-f0e0d1a3efce/utils/dup_arm64.go:8:9: undefined: syscall.Dup3

What you expected to happen:

Hope I can build this project successfully

How to reproduce it (as minimally and precisely as possible):

see above

Anything else we need to know?:

Layotto Version: master OS: Mac OS Big Sur 11.4

I guess that mosn don't support Apple M1 chip well

seeflood commented 3 years ago

Thanks for your feedback,I will try to borrow a Mac with M1 chip tomorrow

seeflood commented 3 years ago

By the way,which version of golang are you using? @pinxiong

pinxiong commented 3 years ago

By the way,which version of golang are you using? @pinxiong

****:layotto ****$ go version
go version go1.16.5 darwin/arm64
seeflood commented 3 years ago

@pinxiong Hi, I submitted a pr to fix this issue.Could u try again?

pinxiong commented 3 years ago

Thank you very much! Your PR can fix my issue! (You can close #68)

I have pasted more detailed info for helping other with the same problems before.

****:layotto ****$ git log
commit 8bcebb92b30df8b5c396f1e0bf3b86b143d233d8 (HEAD -> main, upstream/main)
Author: seeflood <349895584@qq.com>
Date:   Mon Jun 21 15:27:22 2021 +0800

    fix m1 compile error (#73)
****:layotto ****$ go build
go: downloading mosn.io/mosn v0.23.0
go: downloading mosn.io/pkg v0.0.0-20210604065522-6e8f5a087814
****:layotto ****$ pwd
/********/layotto/cmd/layotto
seeflood commented 3 years ago

Thanks again for your information. Welcome to Layotto Commutiy!