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

[Ruby] Issues installing on Apple M1 with Rosetta #14945

Closed
joaquimadraz opened this issue Dec 14, 2022 · 3 comments · Fixed by #14960
Closed

[Ruby] Issues installing on Apple M1 with Rosetta #14945

joaquimadraz opened this issue Dec 14, 2022 · 3 comments · Fixed by #14960

Comments

@joaquimadraz
Copy link

Describe the bug, including details regarding any error messages, version, and platform.

Hello,

I'm having issues running gem install red-arrow on a M1 running in Rosetta.
Can I get some support? Happy to provide more information.

This is the output I'm getting:

Building native extensions. This could take a while...
ERROR:  Error installing red-arrow:
	ERROR: Failed to build gem native extension.

    current directory: /Users/joaquim/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/red-arrow-10.0.0/ext/arrow
/Users/joaquim/.asdf/installs/ruby/3.1.3/bin/ruby -I /Users/joaquim/.asdf/installs/ruby/3.1.3/lib/ruby/3.1.0 extconf.rb
checking --enable-debug-build option... no
checking C++ compiler... clang++
checking g++ version... 14 (gnu++17)
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... no
checking for -Wformat=2 option to compiler... yes
checking for -Winit-self option to compiler... yes
checking for -Wlarger-than-65500 option to compiler... yes
checking for -Wmissing-declarations option to compiler... yes
checking for -Wmissing-format-attribute option to compiler... yes
checking for -Wmissing-include-dirs option to compiler... yes
checking for -Wmissing-noreturn option to compiler... yes
checking for -Wmissing-prototypes option to compiler... yes
checking for -Wnested-externs option to compiler... yes
checking for -Wold-style-definition option to compiler... yes
checking for -Wpacked option to compiler... yes
checking for -Wp,-D_FORTIFY_SOURCE=2 option to compiler... yes
checking for -Wpointer-arith option to compiler... yes
checking for -Wundef option to compiler... yes
checking for -Wout-of-line-declaration option to compiler... yes
checking for -Wunsafe-loop-optimizations option to compiler... no
checking for -Wwrite-strings option to compiler... yes
checking for Homebrew... yes
checking for Homebrew... yes
checking for arrow version (>= 10.0.0)... yes (10.0.1)
checking for arrow-glib version (>= 10.0.0)... yes (10.0.1)
creating Makefile

current directory: /Users/joaquim/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/red-arrow-10.0.0/ext/arrow
make DESTDIR\= sitearchdir\=./.gem.20221214-24050-ftpiwz sitelibdir\=./.gem.20221214-24050-ftpiwz clean

current directory: /Users/joaquim/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/red-arrow-10.0.0/ext/arrow
make DESTDIR\= sitearchdir\=./.gem.20221214-24050-ftpiwz sitelibdir\=./.gem.20221214-24050-ftpiwz
compiling arrow.cpp
compiling converters.cpp
compiling memory-view.cpp
compiling raw-records.cpp
compiling values.cpp
linking shared-object arrow.bundle
Undefined symbols for architecture x86_64:
  "_rbgerr_gerror2exception", referenced from:
      red_arrow::check_status(arrow::Status const&&, char const*) in converters.o
      red_arrow::check_status(arrow::Status const&&, char const*) in raw-records.o
      red_arrow::check_status(arrow::Status const&&, char const*) in values.o
  "_rbgobj_instance_from_ruby_object", referenced from:
      red_arrow::memory_view::primitive_array_get(unsigned long, rb_memory_view_t*, int) in memory-view.o
      red_arrow::memory_view::buffer_get(unsigned long, rb_memory_view_t*, int) in memory-view.o
      red_arrow::record_batch_raw_records(unsigned long) in raw-records.o
      red_arrow::table_raw_records(unsigned long) in raw-records.o
      red_arrow::array_values(unsigned long) in values.o
      red_arrow::chunked_array_values(unsigned long) in values.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [arrow.bundle] Error 1

make failed, exit code 2

Component(s)

Ruby

@joaquimadraz
Copy link
Author

Just to note: Iv'e downgraded to ruby 3.0.5 and it installed successfully

@assignUser
Copy link
Member

Cc @kou

kou added a commit to kou/arrow that referenced this issue Dec 15, 2022
Xcode 14 shows a warning for "-undefined dynamic_lookup".

We need to use "-U${external_symbol_in_dynamic_loaded_library}"
explicitly for all external symbols in dynamic loaded library without
"-undefined dynamic_lookup".

In Red Arrow case, we use some symbols in Ruby/GLib2.
@kou
Copy link
Member

kou commented Dec 15, 2022

This is the same problem as ruby-gnome/ruby-gnome#1516 .

Workaround: gem install red-arrow -- --with-ldflags="-Wl,-undefined,dynamic_lookup"

kou added a commit that referenced this issue Dec 16, 2022
Xcode 14 shows a warning for "-undefined dynamic_lookup".

We need to use "-U${external_symbol_in_dynamic_loaded_library}" explicitly for all external symbols in dynamic loaded library without "-undefined dynamic_lookup".

In Red Arrow case, we use some symbols in Ruby/GLib2.
* Closes: #14945

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 11.0.0 milestone Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants