Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Is v2.2 broken on MacOs? #37

Closed
smacker opened this issue Jan 16, 2018 · 4 comments
Closed

Is v2.2 broken on MacOs? #37

smacker opened this issue Jan 16, 2018 · 4 comments

Comments

@smacker
Copy link
Contributor

smacker commented Jan 16, 2018

smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ rm -rf client-go.v2/
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ go get -d -u gopkg.in/bblfsh/client-go.v2/...
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ cd $GOPATH/src/gopkg.in/bblfsh/client-go.v2
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh/client-go.v2 on master*
$ make dependencies
go get -v -t gopkg.in/bblfsh/client-go.v2
gopkg.in/bblfsh/client-go.v2
go get -v -t gopkg.in/bblfsh/client-go.v2/tools
gopkg.in/bblfsh/client-go.v2/tools
# gopkg.in/bblfsh/client-go.v2/tools
In file included from tools/bindings.go:15:
./bindings.h:8:10: fatal error: 'uast.h' file not found
#include "uast.h"
         ^~~~~~~~
1 error generated.
make: [gopkg.in/bblfsh/client-go.v2/tools] Error 2 (ignored)
curl -SL https://github.com/bblfsh/libuast/releases/download/v1.6.1/libuast-v1.6.1.tar.gz | tar xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   611    0   611    0     0    611      0 --:--:-- --:--:-- --:--:--  1168
100 21516  100 21516    0     0  21516      0  0:00:01  0:00:01 --:--:-- 21516
mv libuast-v1.6.1/src/* tools/.
rm -rf libuast-v1.6.1
go get -v -t .
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh/client-go.v2 on master*
$ make dependencies
go get -v -t gopkg.in/bblfsh/client-go.v2
go get -v -t gopkg.in/bblfsh/client-go.v2/tools
gopkg.in/bblfsh/client-go.v2/tools
# gopkg.in/bblfsh/client-go.v2/tools
In file included from _cgo_export.c:3:
In file included from tools/bindings.go:15:
tools/bindings.h:160:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
In file included from tools/bindings.go:15:
tools/bindings.h:160:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
uast.cc:44:33: error: non-aggregate type 'const std::vector<const char *>' cannot be initialized with an initializer list
uast.cc:82:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:234:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:247:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:248:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:462:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
make: [gopkg.in/bblfsh/client-go.v2/tools] Error 2 (ignored)
curl -SL https://github.com/bblfsh/libuast/releases/download/v1.6.1/libuast-v1.6.1.tar.gz | tar xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   611    0   611    0     0    611      0 --:--:-- --:--:-- --:--:--   901
100 21516  100 21516    0     0  21516      0  0:00:01  0:00:01 --:--:-- 21516
mv libuast-v1.6.1/src/* tools/.
rm -rf libuast-v1.6.1
go get -v -t .

Then when I run anything that uses client-go I have:

$ go run main.go
# gopkg.in/bblfsh/client-go.v2/tools
In file included from _cgo_export.c:3:
In file included from ../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.go:15:
../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.h:160:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
In file included from ../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.go:15:
../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.h:160:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
uast.cc:44:33: error: non-aggregate type 'const std::vector<const char *>' cannot be initialized with an initializer list
uast.cc:82:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:234:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:247:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:248:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:462:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
smacker at Maxims-MacBook-Pro in ~/Dev/hercules-web on master*
$ echo $?
2
@vmarkovtsev
Copy link
Contributor

@smacker Please try the new release

@smacker
Copy link
Contributor Author

smacker commented Jan 24, 2018

same problem:

smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ rm -rf client-go.v2/
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ go get -d -u gopkg.in/bblfsh/client-go.v2/...
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh
$ cd $GOPATH/src/gopkg.in/bblfsh/client-go.v2
smacker at Maxims-MacBook-Pro in ~/go/src/gopkg.in/bblfsh/client-go.v2 on master*
$ make dependencies
go get -v -t gopkg.in/bblfsh/client-go.v2
golang.org/x/net/http2
google.golang.org/grpc/encoding
google.golang.org/grpc/encoding/proto
google.golang.org/grpc/transport
google.golang.org/grpc
gopkg.in/bblfsh/sdk.v1/protocol
gopkg.in/bblfsh/client-go.v2
go get -v -t gopkg.in/bblfsh/client-go.v2/tools
gopkg.in/bblfsh/client-go.v2/tools
# gopkg.in/bblfsh/client-go.v2/tools
In file included from tools/bindings.go:45:
./bindings.h:13:10: fatal error: 'libuast/uast.h' file not found
#include "libuast/uast.h"
         ^~~~~~~~~~~~~~~~
1 error generated.
make: [gopkg.in/bblfsh/client-go.v2/tools] Error 2 (ignored)
curl -SL https://github.com/bblfsh/libuast/releases/download/v.1.8.1/libuast-v.1.8.1.tar.gz | tar xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   612    0   612    0     0    612      0 --:--:-- --:--:-- --:--:--   817
100 24053  100 24053    0     0  24053      0  0:00:01  0:00:01 --:--:-- 63632
mv libuast-v.1.8.1/src/* tools/.
rm -rf libuast-v.1.8.1
go get -v -t ./...
gopkg.in/bblfsh/client-go.v2/tools
# gopkg.in/bblfsh/client-go.v2/tools
In file included from _cgo_export.c:3:
In file included from tools/bindings.go:45:
tools/bindings.h:166:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
In file included from tools/bindings.go:45:
tools/bindings.h:166:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
uast.cc:44:33: error: non-aggregate type 'const std::vector<const char *>' cannot be initialized with an initializer list
uast.cc:86:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:275:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:288:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:289:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:527:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
uast.cc:552:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
make: [cgo-dependencies] Error 2 (ignored)

and now it's super difficult to rollback 😢

@vmarkovtsev
Copy link
Contributor

@smacker Temporary workaround:

export CGO_CXXFLAGS=-std=c++14

We will include it into the defaults in the next release.

@smacker
Copy link
Contributor Author

smacker commented Jan 24, 2018

yeah. Thanks. Found it already.
adding // #cgo !custom_libuast,darwin CXXFLAGS: -std=c++14 or -std=c++11 helps (beside nasty warnings)

# gopkg.in/bblfsh/client-go.v2/tools
In file included from _cgo_export.c:3:
In file included from ../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.go:46:
../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.h:166:1: warning: control reaches end of non-void function [-Wreturn-type]
# gopkg.in/bblfsh/client-go.v2/tools
In file included from ../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.go:46:
../../go/src/gopkg.in/bblfsh/client-go.v2/tools/bindings.h:166:1: warning: control reaches end of non-void function [-Wreturn-type]

to remove them I added:

#cgo !custom_libuast,darwin CFLAGS: -Wno-return-type

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants