Comments (20)
Install docker in Mac and try it again, should work for sure
from grpc-web.
I believe that docker is installed on my Mac.
$ docker
Usage: docker [OPTIONS] COMMAND [arg...]
docker [ --help | -v | --version ]
A self-sufficient runtime for containers.
from grpc-web.
Is the docker virtual machine running and visible? Try something like
docker-machine start default
eval `docker-machine env default`
docker ps
If you get any errors from that then docker is not setup correctly.
from grpc-web.
You don't need docker to build on mac. Docker is used as container to build for different linux.
Here's the steps:
- install brew
- brew install pcre
- ./init_submodules.sh
- export KERNEL_BITS=64
- make
from grpc-web.
Updated the README.md with build instructions.
from grpc-web.
Thanks @fengli79, but I got another error while trying your solution.
Here is my complete log:
github$ git clone https://github.com/grpc/grpc-web
Cloning into 'grpc-web'...
remote: Counting objects: 172, done.
remote: Total 172 (delta 0), reused 0 (delta 0), pack-reused 172
Receiving objects: 100% (172/172), 68.46 KiB | 0 bytes/s, done.
Resolving deltas: 100% (39/39), done.
Checking connectivity... done.
github$ cd grpc-web
grpc-web$ ./init_submodules.sh
Submodule 'third_party/closure-library' (https://github.com/google/closure-library.git) registered for path 'third_party/closure-library'
Submodule 'third_party/grpc' (https://github.com/grpc/grpc.git) registered for path 'third_party/grpc'
Submodule 'third_party/nginx/src' (https://nginx.googlesource.com/nginx) registered for path 'third_party/nginx/src'
Submodule 'third_party/openssl' (https://github.com/openssl/openssl.git) registered for path 'third_party/openssl'
Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'third_party/protobuf'
Cloning into 'third_party/closure-library'...
remote: Counting objects: 93224, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 93224 (delta 41), reused 0 (delta 0), pack-reused 93125
Receiving objects: 100% (93224/93224), 74.82 MiB | 783.00 KiB/s, done.
Resolving deltas: 100% (74711/74711), done.
Checking connectivity... done.
Submodule path 'third_party/closure-library': checked out 'effb4062e34576a011e788a0d33c1433a677f940'
Cloning into 'third_party/grpc'...
remote: Counting objects: 219985, done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 219985 (delta 30), reused 0 (delta 0), pack-reused 219909
Receiving objects: 100% (219985/219985), 89.11 MiB | 1.31 MiB/s, done.
Resolving deltas: 100% (166212/166212), done.
Checking connectivity... done.
Submodule path 'third_party/grpc': checked out '6040b471bcd1d6bb05b25c126b6545180a1d3528'
Cloning into 'third_party/nginx/src'...
remote: Sending approximately 47.85 MiB ...
remote: Counting objects: 503, done
remote: Finding sources: 100% (17/17)
remote: Total 53998 (delta 43836), reused 53996 (delta 43836)
Receiving objects: 100% (53998/53998), 47.86 MiB | 1.40 MiB/s, done.
Resolving deltas: 100% (43836/43836), done.
Checking connectivity... done.
Submodule path 'third_party/nginx/src': checked out '2a881edaa3e60c9392e90efe9f6bfc25024e6e3c'
Cloning into 'third_party/openssl'...
remote: Counting objects: 223046, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 223046 (delta 0), reused 0 (delta 0), pack-reused 223042
Receiving objects: 100% (223046/223046), 97.61 MiB | 1.39 MiB/s, done.
Resolving deltas: 100% (172242/172242), done.
Checking connectivity... done.
Submodule path 'third_party/openssl': checked out '5dd94f1847c744929a3bd24819f1c99644bb18c7'
Cloning into 'third_party/protobuf'...
remote: Counting objects: 38177, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 38177 (delta 18), reused 0 (delta 0), pack-reused 38118
Receiving objects: 100% (38177/38177), 35.22 MiB | 1.30 MiB/s, done.
Resolving deltas: 100% (25604/25604), done.
Checking connectivity... done.
Submodule path 'third_party/protobuf': checked out '1a586735085e817b1f52e53feec92ce418049f69'
HEAD is now at effb406... Add an equals method to goog.math.Coordinate and make the existing equals method on goog.math.Vec2 take '*' instead of another goog.math.Vec2.
HEAD is now at 5dd94f1... Prepare for 1.0.2h release
HEAD is now at 1a58673... Merge pull request #2077 from pherl/3.0.x
HEAD is now at 6040b47... Merge pull request #8543 from apolcyn/fix_ruby_plugin_build
Submodule 'third_party/boringssl' (https://github.com/google/boringssl.git) registered for path 'third_party/boringssl'
Submodule 'third_party/gflags' (https://github.com/gflags/gflags.git) registered for path 'third_party/gflags'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'third_party/protobuf'
Submodule 'third_party/zlib' (https://github.com/madler/zlib) registered for path 'third_party/zlib'
Cloning into 'third_party/boringssl'...
remote: Counting objects: 34143, done.
remote: Total 34143 (delta 0), reused 0 (delta 0), pack-reused 34143
Receiving objects: 100% (34143/34143), 23.41 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (23379/23379), done.
Checking connectivity... done.
Submodule path 'third_party/boringssl': checked out 'c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9'
Cloning into 'third_party/gflags'...
remote: Counting objects: 2045, done.
remote: Total 2045 (delta 0), reused 0 (delta 0), pack-reused 2045
Receiving objects: 100% (2045/2045), 1.38 MiB | 620.00 KiB/s, done.
Resolving deltas: 100% (1187/1187), done.
Checking connectivity... done.
Submodule path 'third_party/gflags': checked out '05b155ff59114735ec8cd089f669c4c3d8f59029'
Cloning into 'third_party/googletest'...
remote: Counting objects: 7422, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 7422 (delta 4), reused 0 (delta 0), pack-reused 7407
Receiving objects: 100% (7422/7422), 2.52 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (5512/5512), done.
Checking connectivity... done.
Submodule path 'third_party/googletest': checked out 'c99458533a9b4c743ed51537e25989ea55944908'
Cloning into 'third_party/protobuf'...
remote: Counting objects: 38177, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 38177 (delta 18), reused 0 (delta 0), pack-reused 38118
Receiving objects: 100% (38177/38177), 35.22 MiB | 1.30 MiB/s, done.
Resolving deltas: 100% (25604/25604), done.
Checking connectivity... done.
Submodule path 'third_party/protobuf': checked out '1a586735085e817b1f52e53feec92ce418049f69'
Cloning into 'third_party/zlib'...
remote: Counting objects: 4462, done.
remote: Total 4462 (delta 0), reused 0 (delta 0), pack-reused 4462
Receiving objects: 100% (4462/4462), 2.42 MiB | 354.00 KiB/s, done.
Resolving deltas: 100% (3101/3101), done.
Checking connectivity... done.
Submodule path 'third_party/zlib': checked out '50893291621658f355bc5b4d450a8d06a563053d'
grpc-web$ make
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -rf objs gConnector gConnector_static \
third_party/nginx/src/objs third_party/openssl/.openssl
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -f gConnector.zip gConnector_static.zip \
"/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.cc "/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.h \
third_party/nginx/src/Makefile
cd "/Users/adrienjoly/dev/github/grpc-web"/net/grpc/gateway/examples/echo && make clean
rm -f *.grpc.pb.cc *.grpc.pb.h *.grpc.pb.o *.pb.cc *.pb.h *.pb.o \
echo_server echo_server.o compiled.js
rm -rf ./out
cd "/Users/adrienjoly/dev/github/grpc-web"/javascript/net/grpc/web && make clean
rm -f *.o protoc-gen-grpc-web
cd "/Users/adrienjoly/dev/github/grpc-web"
cd /Users/adrienjoly/dev/github/grpc-web && /Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src/protoc --proto_path="/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos" \
--proto_path="/Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src" "/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos/pair.proto" \
--cpp_out="/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"
/bin/sh: /Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src/protoc: No such file or directory
make: *** [protos] Error 127
from grpc-web.
@fengli79, same when I follow the install procedure you added in README.md:
grpc-web$ ./darwin_x86_64.sh
HEAD is now at effb406... Add an equals method to goog.math.Coordinate and make the existing equals method on goog.math.Vec2 take '*' instead of another goog.math.Vec2.
HEAD is now at 5dd94f1... Prepare for 1.0.2h release
HEAD is now at 1a58673... Merge pull request #2077 from pherl/3.0.x
HEAD is now at 6040b47... Merge pull request #8543 from apolcyn/fix_ruby_plugin_build
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -rf objs gConnector gConnector_static \
third_party/nginx/src/objs third_party/openssl/.openssl
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -f gConnector.zip gConnector_static.zip \
"/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.cc "/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.h \
third_party/nginx/src/Makefile
cd "/Users/adrienjoly/dev/github/grpc-web"/net/grpc/gateway/examples/echo && make clean
rm -f *.grpc.pb.cc *.grpc.pb.h *.grpc.pb.o *.pb.cc *.pb.h *.pb.o \
echo_server echo_server.o compiled.js
rm -rf ./out
cd "/Users/adrienjoly/dev/github/grpc-web"/javascript/net/grpc/web && make clean
rm -f *.o protoc-gen-grpc-web
cd "/Users/adrienjoly/dev/github/grpc-web"
./darwin_x86_64.sh: line 3: cd: /github/grpc-web/third_party/protobuf: No such file or directory
./darwin_x86_64.sh: line 4: cd: /github/grpc-web/third_party/grpc: No such file or directory
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -rf objs gConnector gConnector_static \
third_party/nginx/src/objs third_party/openssl/.openssl
cd "/Users/adrienjoly/dev/github/grpc-web" && rm -f gConnector.zip gConnector_static.zip \
"/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.cc "/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"/*.pb.h \
third_party/nginx/src/Makefile
cd "/Users/adrienjoly/dev/github/grpc-web"/net/grpc/gateway/examples/echo && make clean
rm -f *.grpc.pb.cc *.grpc.pb.h *.grpc.pb.o *.pb.cc *.pb.h *.pb.o \
echo_server echo_server.o compiled.js
rm -rf ./out
cd "/Users/adrienjoly/dev/github/grpc-web"/javascript/net/grpc/web && make clean
rm -f *.o protoc-gen-grpc-web
cd "/Users/adrienjoly/dev/github/grpc-web"
cd /Users/adrienjoly/dev/github/grpc-web && /Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src/protoc --proto_path="/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos" \
--proto_path="/Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src" "/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos/pair.proto" \
--cpp_out="/Users/adrienjoly/dev/github/grpc-web/net/grpc/gateway/protos"
/bin/sh: /Users/adrienjoly/dev/github/grpc-web/third_party/protobuf/src/protoc: No such file or directory
make: *** [protos] Error 127
=> same error: third_party/protobuf/src/protoc: No such file or directory
Is there anything I missed?
from grpc-web.
Hmm, it's bug in the ./darwin_x86_64.sh, fixed by #17.
from grpc-web.
This fix does allow me to go further! :-)
But I still can't build the whole thing...
It ends with the following errors:
/usr/local/Cellar/protobuf/3.0.0-beta-4/include/google/protobuf/wire_format_lite_inl.h:352:17: error:
comparison of integers of different signs: 'const uint32' (aka 'const unsigned int') and 'int'
[-Werror,-Wsign-compare]
if (new_bytes != length) return false;
~~~~~~~~~ ^ ~~~~~~
/usr/local/Cellar/protobuf/3.0.0-beta-4/include/google/protobuf/wire_format_lite_inl.h:420:1: note: in
instantiation of function template specialization
'google::protobuf::internal::WireFormatLite::ReadPackedFixedSizePrimitive<double,
google::protobuf::internal::WireFormatLite::FieldType::TYPE_DOUBLE>' requested here
READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
^
/usr/local/Cellar/protobuf/3.0.0-beta-4/include/google/protobuf/wire_format_lite_inl.h:411:10: note:
expanded from macro 'READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE'
return ReadPackedFixedSizePrimitive< \
^
6 errors generated.
make: *** [/Users/adrienjoly/Dev/github/grpc-web/third_party/grpc/objs/opt/src/cpp/ext/reflection.pb.o] Error 1
Am I using the wrong protobuf version, maybe?
Full log: http://pastebin.com/5iQ17dkb
from grpc-web.
It looks not right, if you use init_submodules.sh, it should pin to protobuf tags/v3.0.2.
Could you help to create a new github directory and retry?
from grpc-web.
@adrienjoly , does it work for you?
from grpc-web.
nope, still not, @fengli79 ...
here is my log from this morning, fresh clone:
from grpc-web.
from grpc-web.
Sorry for the delay, @fengli79, I've been very busy lately, with the launch of my product + of two crowdfunding campaigns.
I uninstalled "protobuf 3.0.0 beta4", tried again, and got:
checking for int size ...dyld: Library not loaded: libgrpc++_unsecure.dylib
Referenced from: /Users/adrienjoly/Dev/WEEKEND/grpc-web/third_party/nginx/src/./objs/autotest
Reason: image not found
bytes
auto/configure: error: can not detect int size
make: *** [nginx_config] Error 1
full trace: http://pastebin.com/txzrjGJQ
from grpc-web.
From El Cap, Mac starts to purge the DYLD_LIBRARY_PATH, thus I have to install grpc and protobuf into the default lib path for build.
Fixed by #28
from grpc-web.
Good job, @fengli79, the build seems to be working now! :-)
from grpc-web.
Now, I have no idea on how to test the project.
There used to be some samples mentioned in README, but I can't find them anymore...
from grpc-web.
https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/examples/echo/README.md
from grpc-web.
Thank you for the link, @fengli79
Unfortunately, I'm having problems to run the example, now:
- When I run
make example
, I get a message saying that I should use thedarwin
script. So I interrupted the script, and re-ran thedarwin
script. - To run
make
fromgrpc-web/net/grpc/gateway/examples/echo
, I had to re-installprotoc
(usingbrew install protobuf
), but then I got the following error:
echo$ make
protoc -I . --cpp_out=. echo.proto
g++ -std=c++11 -I/usr/local/include -I../../../../.. -pthread -c -o echo.pb.o echo.pb.cc
protoc -I . --grpc_out=. \
--plugin=protoc-gen-grpc=`which grpc_cpp_plugin` echo.proto
g++ -std=c++11 -I/usr/local/include -I../../../../.. -pthread -c -o echo.grpc.pb.o echo.grpc.pb.cc
g++ -std=c++11 -I/usr/local/include -I../../../../.. -pthread -c -o echo_server.o echo_server.cc
g++ echo.pb.o echo.grpc.pb.o echo_server.o -L/usr/local/lib -lgrpc++ -lgrpc -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -lprotobuf -lpthread -ldl -o echo_server
ld: unknown option: --no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [echo_server] Error 1
=> Should I open a new issue?
from grpc-web.
from grpc-web.
Related Issues (20)
- Compile & run helloworld: protoc-gen-js: Plugin failed with status code 126 HOT 1
- Status of streaming with the binary wire format HOT 4
- Client reconnection to long-running poll HOT 1
- Trailer metadata - repeated values only supported with "trailers-only" responses HOT 3
- Roadmap.md needs updating HOT 4
- Are there any plans to simplify the request HOT 2
- Is there a proto-loader for gRPC-web? HOT 2
- Please ignore...
- > It's working for grpc-web + protobuf.js. I hope it helps somebody. HOT 2
- stream.cancel doesn't close the stream HOT 2
- Why optional message types compile inconsistently? HOT 5
- Closure Migration & Typescript-ification HOT 4
- Grpc-web not return exactly grpc status always response 2 Incomplete response HOT 7
- Why generated files doesn't have implemented classes? HOT 2
- Difficulty building under Alpine 3.19 HOT 1
- How to connect a docker-run Go gRPC server to a React app?
- Client does not report correct error codes per the spec for HTTP status code mapping HOT 1
- Compression handling uses wrong error codes HOT 1
- Cardinality violations should use error code “unimplemented” HOT 2
- gRPC errors in nice-grpc-web come back as undefined in angular 18 in optimized builds with zonejs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-web.