Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX 10.12 build issues #18

Closed
pkieltyka opened this issue Nov 11, 2016 · 17 comments
Closed

OSX 10.12 build issues #18

pkieltyka opened this issue Nov 11, 2016 · 17 comments
Assignees

Comments

@pkieltyka
Copy link

Hey guys,

I tried the new build scripts for 10.12, that is just ./darwin_x86_64.sh and its certainly gotten better but I had a few issues. For one, I needed to prefix ./ before each path.. as so in this diff.

diff --git a/darwin_x86_64.sh b/darwin_x86_64.sh
index 98c2dd7..b7b469b 100755
--- a/darwin_x86_64.sh
+++ b/darwin_x86_64.sh
@@ -1,6 +1,6 @@
 ./init_submodules.sh
 make clean
-cd third_party/protobuf && ./autogen.sh && ./configure && make && cd ../..
-cd third_party/grpc && make && cd ../..
+cd ./third_party/protobuf && ./autogen.sh && ./configure && make && cd ../..
+cd ./third_party/grpc && make && cd ../..
 export KERNEL_BITS=64
 make
diff --git a/init_submodules.sh b/init_submodules.sh
index 4fc9728..cf8651a 100755
--- a/init_submodules.sh
+++ b/init_submodules.sh
@@ -1,5 +1,5 @@
 git submodule update --init
-cd third_party/closure-library && git checkout tags/v20160911 -f && cd ../..
-cd third_party/openssl && git checkout tags/OpenSSL_1_0_2h -f && cd ../..
-cd third_party/protobuf && git checkout tags/v3.0.2 -f && cd ../..
-cd third_party/grpc && git checkout tags/v1.0.1 -f && git submodule update --init && cd ../..
+cd ./third_party/closure-library && git checkout tags/v20160911 -f && cd ../..
+cd ./third_party/openssl && git checkout tags/OpenSSL_1_0_2h -f && cd ../..
+cd ./third_party/protobuf && git checkout tags/v3.0.2 -f && cd ../..
+cd ./third_party/grpc && git checkout tags/v1.0.1 -f && git submodule update --init && cd ../..

however, as this ran, during the make of grpc I ran into the following errors:

https://gist.github.com/pkieltyka/c0886b58de3c58af771693b45c61e163

one thing that is strange, is that its using my system protoc instead of the third_party/protobuf that was just built. I just wanted to show you the current results in the current state.

@fengli79
Copy link
Collaborator

I just try on 10.12.1 and build successfully.
You don't need to add "./".
Please make sure:

  1. You are using a clean github directory. I suggest you use a new directory and redo the git clone.
  2. Follow the build instructions and makes sure your working dir is the grpc-web folder when executing ./darwin_x86_64.sh.

@fengli79 fengli79 self-assigned this Nov 14, 2016
@fengli79
Copy link
Collaborator

@pkieltyka , does it work for you?

@pkieltyka
Copy link
Author

@fengli79 no, it still doesn't work on a very clean 10.12.1 with clean clone of grpc-web

I am using zsh btw, so perhaps that makes a difference. I still need to add ./ before each path.

It's been quite painful getting this to build.

@pkieltyka
Copy link
Author

another error Im receiving is: ./darwin_x86_64.sh: line 3: cd: third_party/protobuf: No such file or directory

I am sure I could mess around with all this tooling and fix it, but I'm just reporting that the default bootstrapping needs some work.

@fengli79
Copy link
Collaborator

I have no plan to support zsh, you should use the default bash instead.

@pkieltyka
Copy link
Author

pkieltyka commented Nov 30, 2016 via email

@fengli79
Copy link
Collaborator

fengli79 commented Dec 1, 2016

We don't need protobuf in third_party/protobuf any more, it will be replaced with the one comes from third_party/grpc submodule.
The protobuf compiling issue you met is a known issue of protobuf itself, and has been fixed by protocolbuffers/protobuf#2337.
However, grpc build script will try to link with the protobuf which is installed on your machine first, so, you need to either upgrade or remove the installed protobuf.

./darwin_x86_64.sh: line 3: cd: third_party/protobuf: No such file or directory is trivial and can be ignored safely, I'm going to fix it soon, and probably together with the additional ./ needed for zsh.

@fengli79
Copy link
Collaborator

fengli79 commented Dec 1, 2016

grpc/grpc#8466

@pkieltyka
Copy link
Author

pkieltyka commented Dec 1, 2016

thanks @fengli79 -- I keep trying to figure it out and make it work but unfortunately failing. I tried to remove protobuf from my local system, then continue with ./darwin_x86_64.sh (with bash), no luck. Then I tried to clone protobuf head to third_party/protobuf and run ./darwin_x86_64.sh again, and unfortunately it failed again.

I'll remain patient as other tickets close and try again in a few weeks. Im looking forward to the project!

@fengli79
Copy link
Collaborator

fengli79 commented Dec 1, 2016 via email

@pkieltyka
Copy link
Author

Here it is .. I deleted the directory again, cloned and did it all over again:

https://gist.github.com/pkieltyka/db71562f4ce81a72384549e2f733c9f0

@fengli79
Copy link
Collaborator

fengli79 commented Dec 1, 2016

Looks like you missed some prerequisites.
You need:

  1. Install brew.
  2. brew install autoconf automake libtool pcre
    It's documented here: https://github.com/grpc/grpc-web/blob/master/README.md

@pkieltyka
Copy link
Author

pkieltyka commented Dec 1, 2016

@fengli79 I had them all installed at time of running..

bash-3.2$ brew list
autoconf	go		libpng		openssl		readline	watchman
automake	htop		libtiff		pcre		redis		wget
flow		imagemagick	libtool		perl		ruby		xctool
freetype	jpeg		libyaml		pkg-config	sqlite		xz
gdbm		jpeg-turbo	mercurial	python		vim		z

... Im not sure how you're getting it to run on your machine. Can you try to clone grpc-web to another folder on your system, hopefully have no other protobuf in your system paths, and see if that works.

@fengli79
Copy link
Collaborator

fengli79 commented Dec 1, 2016

I just tried it by git clone to a new folder, it works fine on my mac.
I think the error you get is from the grpc build script (instead of grpc-web build script), which use cd third_party/protobuf without the ./ you mentioned.
However, I don't know why your environment need the ./ prefix.
You probably want to figure out that first.
Can you post your CDPATH variable?

@pkieltyka
Copy link
Author

@fengli79 we're getting warmer. After I unset the CDPATH, the build progressed much further to building grpc with protobuf within third_party/grpc/third_party/protobuf

btw, my CDPATH was set to /Users/peter/Dev/go/src and I am on xcode 8.1 (latest stable)

its surprising that anything would match the CDPATH, but I guess a simple unset CDPATH in the script can help for others too.

the failure output: https://gist.github.com/pkieltyka/f24cff2b5a5e694f633de2cb7bcb0cfb

@fengli79
Copy link
Collaborator

fengli79 commented Dec 2, 2016

Yes, you get that error with xcode 8.1, protobuf already fixed it on their head, but grpc builds its protobuf submodule with different CPPFLAGS. It also need to be fixed by GRPC.
grpc/grpc#8466

You can either apply the workaround by change the CPPFLAGS, or switch back to xcode 7.3.1.

@fengli79
Copy link
Collaborator

I'm closing this issue, since it has been verified by other people in #7.
Feel free to reopen if you still cannot build successfully.

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

No branches or pull requests

2 participants