-
Notifications
You must be signed in to change notification settings - Fork 85
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
Can't install version 2.1.3 on MacOS 12.6 Monterey with ARM Apple Silicon #255
Comments
I found one of my colluegue that has the same architecture/same os but for which it did work. On the left : this Makefile compiles on my machine, on the right (pg_query_nic) is the one that does not work
|
I see that |
I've been having this same issue, I can install version 1.3.0 but not 2.1.3. |
See https://bugs.ruby-lang.org/issues/19005 for a workaround. |
This makes me wonder if the visibility setting in pg_query/ext/pg_query/pg_query_ruby.c Line 17 in e35800c
|
I've confirmed that reverting #232 works on macOS. In Linux, |
#256 fixes this issue. |
`Init_pg_query` isn't actually exported, but `_Init_pg_query` is: ``` % nm pg_query_ruby.o | grep Init 0000000000000000 T _Init_pg_query 0000000000003b40 b _Init_pg_query.rb_intern_id_cache ``` A Ruby compiler compiled with XCode 14 without the flag `-undefined,dynamic_lookup` will see this error: ``` linking shared-object pg_query/pg_query.bundle Undefined symbols for architecture arm64: "Init_pg_query", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Init_pg_query) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1 ``` Closes pganalyze#255
I can workaround the problem by doing: gem install pg_query -- --with-ldflags="-Wl,-undefined,dynamic_lookup" |
It looks like there is an upstream Ruby fix for this problem: ruby/ruby@6898984 It'd be nice if this were backported. |
`Init_pg_query` isn't actually exported, but `_Init_pg_query` is: ``` % nm pg_query_ruby.o | grep Init 0000000000000000 T _Init_pg_query 0000000000003b40 b _Init_pg_query.rb_intern_id_cache ``` A Ruby compiler compiled with XCode 14 without the flag `-undefined,dynamic_lookup` will see this error: ``` linking shared-object pg_query/pg_query.bundle Undefined symbols for architecture arm64: "Init_pg_query", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Init_pg_query) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1 ``` Closes pganalyze#255
`Init_pg_query` isn't actually exported, but `_Init_pg_query` is: ``` % nm pg_query_ruby.o | grep Init 0000000000000000 T _Init_pg_query 0000000000003b40 b _Init_pg_query.rb_intern_id_cache ``` A Ruby compiler compiled with XCode 14 without the flag `-undefined,dynamic_lookup` will see this error: ``` linking shared-object pg_query/pg_query.bundle Undefined symbols for architecture arm64: "Init_pg_query", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Init_pg_query) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1 ``` In pganalyze#222, FreeBSD needed `Init_pg_query`, so we FreeBSD uses its own exported symbols file. Closes pganalyze#255
`Init_pg_query` isn't actually exported, but `_Init_pg_query` is: ``` % nm pg_query_ruby.o | grep Init 0000000000000000 T _Init_pg_query 0000000000003b40 b _Init_pg_query.rb_intern_id_cache ``` A Ruby compiler compiled with XCode 14 without the flag `-undefined,dynamic_lookup` will see this error: ``` linking shared-object pg_query/pg_query.bundle Undefined symbols for architecture arm64: "Init_pg_query", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Init_pg_query) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1 ``` In pganalyze#222, FreeBSD needed `Init_pg_query`, so we uses a specific symbol map file for FreeBSD. Closes pganalyze#255
`Init_pg_query` isn't actually exported, but `_Init_pg_query` is: ``` % nm pg_query_ruby.o | grep Init 0000000000000000 T _Init_pg_query 0000000000003b40 b _Init_pg_query.rb_intern_id_cache ``` A Ruby compiler compiled with XCode 14 without the flag `-undefined,dynamic_lookup` will see this error: ``` linking shared-object pg_query/pg_query.bundle Undefined symbols for architecture arm64: "Init_pg_query", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Init_pg_query) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pg_query.bundle] Error 1 ``` In #222, FreeBSD needed `Init_pg_query`, so we uses a specific symbol map file for FreeBSD. Closes #255
Thanks for the quick fix |
Leaving this for anyone else that hits this issue - I couldn't update my pg_query version so downgrading the Xcode version from 14 to 13 fixed this issue for me. |
@asadakbar Thanks for adding the note - curious what was challenging about updating your pg_query version? (maybe another gem requiring a different protobuf gem version?) |
pg_query version 2.1.3 won't install on MacOS 12.6 Monterey with an arm64 Ruby 3.1.2
Here is the error message extracted from a
bundle install
More details about the environment :
Also if I try to run a
make
from the .rbenv folder =>Any help or ideas are welcome
The text was updated successfully, but these errors were encountered: