-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Ruby gem cannot build on ruby 2.7.2 on Mac M1 #8372
Comments
I get the error message you report, but on step 4, when issuing the |
127 means that |
|
I already have a
Allows the steps you suggested to work. |
Switching to
However, when I modified the |
#8000 (comment) appears related |
Switching to
|
@bbuchalter it seems the rakefile also builds a bunch of well_known proto files: https://github.com/protocolbuffers/protobuf/blob/master/ruby/Rakefile So that's also needed |
I have a working branch here: https://github.com/bouk/protobuf/tree/ruby-build You can use it with: gem 'google-protobuf', github: 'bouk/protobuf', branch: 'ruby-build', submodules: true |
This bug isn't M1 specific. I can reproduce on a 2013 MacBook Air running macOS 11.2.3 and Ruby 2.7.2 building the |
I agree with @jamesgecko, none of the reports on this bug are M1-specific. I think they are seen on M1 due to #8199 I think the best fix is to ship M1 binary gems, which should fix #8199. However, I see two other independent issues raised in this bug:
If anybody knows of proper fixes for these issues I am happy to merge them. Regarding bouk@e7edc92, will this work properly when building a gem from source? Since the source gem will only contain the contents of the |
It does work, because of the find_header invocation. That makes sure the gem builder can find the correct header. |
@bouk I know it works when building from a git client. But the Ruby source gem only contains these files:
I was worried that I tried adding
In that case, adding this |
First, a clarification: Next, I've got a branch here with the wyhash fix. I've also made it use a version of protoc found in the PATH if disregardBut I think I've found another issue. The build process works as expected when I run source 'https://rubygems.org'
gem 'google-protobuf', github: 'jamesgecko/protobuf', branch: 'jd/fix-ruby-compile', submodules: true When I run
Visiting the location indicated by
I'm not very familiar with how building gems works, but it looks like it's skipping some steps in the Edit: Ah, apparently the reason I'm still having trouble building my branch with bundler after these changes is because I've been sourcing the gem directly from git. Bundler wants the gemspec file to be in the root directory of the repo. Because bundler and gem make a lot of assumptions about directory structure, the |
What version of protobuf and what language are you using?
Version: 3.15.4
Language: Ruby
What operating system (Linux, Windows, ...) and version?
Mac OS 11.2.2 on an M1
What runtime / compiler are you using (e.g., python version or gcc version)
Ruby: 2.7.2 (using RVM)
GCC:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
What did you do?
git clone [email protected]:protocolbuffers/protobuf.git
cd protobuf/ruby
bundle config set force_ruby_platform true
rake
rake clobber_package gem
ls pkg/google-protobuf-*.gem
What did you expect to see
A successful build
What did you see instead?
The text was updated successfully, but these errors were encountered: