You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@arrow.apache.org by Sten Larsson <st...@burtcorp.com> on 2022/04/13 08:34:52 UTC

[Ruby] Cannot require 'parquet' on M1 Mac

Hi

I'm struggling to get Arrow working on my M1 MacBook Pro. The test program
simply consists of

require 'parquet'

This fails with

$ ruby arrow-test.rb
(null)-WARNING **: Failed to load shared library
'libparquet-glib.700.dylib' referenced by the typelib:
dlopen(libparquet-glib.700.dylib, 0x0009): tried:
'libparquet-glib.700.dylib' (no such file),
'/usr/local/lib/libparquet-glib.700.dylib' (no such file),
'/usr/lib/libparquet-glib.700.dylib' (no such file),
'/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
such file)
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
`load_object_info'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
`load_object_info'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
`load_info'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
`block (2 levels) in load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
`block (2 levels) in each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
`times'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
`block in each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
`each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
`each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
`block in load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
`prepare_class'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
`<module:Parquet>'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
`<top (required)>'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
`require'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
`rescue in require'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
`require'
from arrow-test.rb:1:in `<main>'
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
`load_object_info': uninitialized constant Parquet::ArrowFileReader
(NameError)
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
`load_info'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
`block (2 levels) in load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
`block (2 levels) in each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
`times'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
`block in each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
`each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
`each'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
`block in load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
`prepare_class'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
`load'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
`<module:Parquet>'
from
/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
`<top (required)>'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
`require'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
`rescue in require'
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
`require'
from arrow-test.rb:1:in `<main>'
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
`require': cannot load such file -- parquet (LoadError)
from
<internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
`require'
from arrow-test.rb:1:in `<main>'

I have installed the apache-arrow-glib Homebrew package, but it seems like
it is looking for the library in the wrong place, because on M1 it is
installed in /opt/homebrew. The libraries seems to be built correctly as
far as I can tell:

$ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
/opt/homebrew/lib/libparquet-glib.700.dylib:
/opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
(compatibility version 700.0.0, current version 700.0.0)
/opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
(compatibility version 700.0.0, current version 700.0.0)
/opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
version 700.0.0, current version 700.0.0)
/opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
version 700.0.0, current version 700.0.0)
/opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version
7001.0.0, current version 7001.3.0)
/opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
7001.0.0, current version 7001.3.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
1200.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1311.0.0)

$ otool -L /opt/homebrew/lib/libparquet.700.dylib
/opt/homebrew/lib/libparquet.700.dylib:
/opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
version 700.0.0, current version 700.0.0)
@rpath/libarrow.700.dylib (compatibility version 700.0.0, current version
700.0.0)
/opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility version
0.0.0, current version 0.0.0)
/opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version
1.1.0, current version 1.1.0)
/opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
version 1.1.0, current version 1.1.0)
/opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility version
1.0.0, current version 1.0.9)
/opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility version
1.0.0, current version 1.0.9)
/opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility version
1.0.0, current version 1.0.9)
/opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility version
31.0.0, current version 31.4.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
(compatibility version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
(compatibility version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
(compatibility version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
(compatibility version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib (compatibility
version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib (compatibility
version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib (compatibility
version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
version 0.0.0, current version 0.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib (compatibility
version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
(compatibility version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
(compatibility version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
(compatibility version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib (compatibility
version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib (compatibility
version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib (compatibility
version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
(compatibility version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib (compatibility
version 0.0.0, current version 1.0.0)
/opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib (compatibility
version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1311.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 1856.105.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security
(compatibility version 1.0.0, current version 60157.60.19)
/opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility version
2.0.0, current version 2.5.0)
/opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
current version 9.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
1200.3.0)

The strange thing is that if I change this to

require 'arrow'

It works correctly. So for some reason it is able to find the Arrow
library, but not the Parquet library. What is causing the difference?

Thanks
/Sten

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

> And now it works!

That's good to know. :-)

> I tried to see what has changed and found this which sounds related:
> https://github.com/Homebrew/homebrew-core/commit/0d53c4ddc79abc153967d0f903c5621eab59e422

Yes. This will replace `@rpath`.

> However, that change should already have been included in 7.0.0_3, so I'm
> confused...

https://github.com/Homebrew/homebrew-core/commits/master/Formula/apache-arrow.rb
shows a 7.0.0_3 bottle update after the commit but there is
also a 7.0.0_3 bottle update BEFORE the commit.

It seems that the commit misses revision bump like
https://github.com/Homebrew/homebrew-core/commit/ede84dd46a3bf3ac745c0cbc3580a2d44d04ea76
. So some(? all?) users such as you use the old 7.0.0_3
bottle that doesn't include the commit.


Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Fri, 22 Apr 2022 11:12:37 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi
> 
> I noticed this when building apache-arrow that Homebrew released a new
> patch version
> 
> ...
> ==> Upgrading apache-arrow
>   7.0.0_3 -> 7.0.0_4
> ...
> 
> And now it works!
> 
> I tried to see what has changed and found this which sounds related:
> https://github.com/Homebrew/homebrew-core/commit/0d53c4ddc79abc153967d0f903c5621eab59e422
> 
> However, that change should already have been included in 7.0.0_3, so I'm
> confused...
> 
> In any case it seems this was a Homebrew issue and that it is now fixed. I
> appreciate all your help, and I learned a lot about macOS along the way.
> 
> Thanks
> /Sten

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi

I noticed this when building apache-arrow that Homebrew released a new
patch version

...
==> Upgrading apache-arrow
  7.0.0_3 -> 7.0.0_4
...

And now it works!

I tried to see what has changed and found this which sounds related:
https://github.com/Homebrew/homebrew-core/commit/0d53c4ddc79abc153967d0f903c5621eab59e422

However, that change should already have been included in 7.0.0_3, so I'm
confused...

In any case it seems this was a Homebrew issue and that it is now fixed. I
appreciate all your help, and I learned a lot about macOS along the way.

Thanks
/Sten

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

Thanks for getting the log! I didn't know the "-b 100m" option!

>                                                           This seems to be
> the real problem:
> 
> open("@rpath/libarrow.700.dylib\0", 0x0, 0x0) = -1 Err#2
> open("@rpath\0", 0x100000, 0x0) = -1 Err#2

Yes.

It's caused by embedded information in libparquet.700.dylib:

> $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> /opt/homebrew/lib/libparquet.700.dylib:
> /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility version 700.0.0, current version 700.0.0)
> @rpath/libarrow.700.dylib (compatibility version 700.0.0, current version 700.0.0)

I don't know why @rpath is used here. Note that Homebrew
bottle on non M1 Mac doesn't use @rpath:

$ otool -L /usr/local/lib/libparquet.dylib
/usr/local/lib/libparquet.dylib:
	/usr/local/opt/apache-arrow/lib/libparquet.700.dylib (compatibility version 700.0.0, current version 700.0.0)
	/usr/local/Cellar/apache-arrow/7.0.0_4/lib/libarrow.700.dylib (compatibility version 700.0.0, current version 700.0.0)

This may be a Homebrew problem or our CMake script related
problem.

Could you try:

$ brew install --build-from-source --keep-tmp --apache-arrow

and:

$ otool -L $(brew --prefix)/lib/libparquet.dylib

?

If this still include @rpath, could you provide build
directory that is kept by --keep-tmp option?


Thanks,
-- 
kou


In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 21 Apr 2022 10:22:52 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi kou
> 
> I figured out that the reason the log was incomplete was that the dtruss
> buffer was too small. I ran the command with -b 100m and updated the gist.
> Note that the log file is truncated in the UI, so you need to download it
> to see the interesting parts:
> https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> 
> It seems like the error message is lying, and that it is actually trying to
> load /opt/homebrew/lib/libparquet-glib.700.dylib as well. This seems to be
> the real problem:
> 
> open("@rpath/libarrow.700.dylib\0", 0x0, 0x0) = -1 Err#2
> open("@rpath\0", 0x100000, 0x0) = -1 Err#2
> 
> Not sure what it means though?
> 
> Thanks
> /Sten
> 
> On Thu, 21 Apr 2022 at 07:30, Sutou Kouhei <ko...@clear-code.com> wrote:
> 
>> Hi,
>>
>> Thanks for the update! It seems that we need to know more
>> macOS tools to debug this case...
>>
>> If I have a M1 Mac, I can look into this more. But I don't
>> have it. Please use DYLD_FALLBACK_LIBRARY_PATH for now.
>>
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 20 Apr 2022
>> 09:49:31 +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi kou
>> >
>> > I rescued NameError instead of LoadError to catch the error, but
>> > unfortunately it still doesn't seem to show anything about loading
>> > libraries. I updated the gist with the output:
>> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
>> >
>> > Thanks
>> > /Sten
>> >
>> > On Wed, 20 Apr 2022 at 02:35, Sutou Kouhei <ko...@clear-code.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> Thanks for providing it!
>> >>
>> >> But it doesn't include information what I want to see (which
>> >> files are opened/stated)... It seems that dtruss log isn't
>> >> completed.
>> >>
>> >> Could you try again with the following arrow-test.rb
>> >> content?
>> >>
>> >> ----
>> >> begin
>> >>   require 'parquet'
>> >> rescue LoadError
>> >> end
>> >> sleep(10)
>> >> puts("done")
>> >> ---
>> >>
>> >> Thanks,
>> >> --
>> >> kou
>> >>
>> >> In <CA...@mail.gmail.com>
>> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Tue, 19 Apr 2022
>> >> 08:41:37 +0200,
>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >>
>> >> > Hi Kou
>> >> >
>> >> > I have uploaded the output of dtruss here:
>> >> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
>> >> >
>> >> > Thanks
>> >> > /Sten
>> >> >
>> >> > On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com>
>> wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> > I disabled SIP, but unfortunately dtrace didn't give anything
>> useful.
>> >> >> >
>> >> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> >> > dtrace: no probes specified
>> >> >>
>> >> >> Sorry... I told wrong command. We should use dtruss not
>> >> >> dtrace.
>> >> >>
>> >> >> Could you try the following?
>> >> >>
>> >> >>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
>> >> >>
>> >> >>
>> >> >> Thanks,
>> >> >> --
>> >> >> kou
>> >> >>
>> >> >> In <CA+EBNmHN-UEvsfLk+G2b-U8u=+
>> VwnDqS65UbPTD4QX07BOP75w@mail.gmail.com>
>> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> >> >> 09:58:47 +0200,
>> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >>
>> >> >> > Hi kou
>> >> >> >
>> >> >> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH
>> didn't
>> >> >> have
>> >> >> > any effect, so this command now works!
>> >> >> >
>> >> >> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> > --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >       $(rbenv which ruby) arrow-test.rb
>> >> >> >
>> >> >> > (It doesn't print anything since the script doesn't actually do
>> >> >> anything.)
>> >> >> >
>> >> >> > I disabled SIP, but unfortunately dtrace didn't give anything
>> useful.
>> >> >> >
>> >> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> >> > dtrace: no probes specified
>> >> >> >
>> >> >> > I have not used dtrace before so I don't know what probes I should
>> >> >> specify,
>> >> >> > sorry.
>> >> >> >
>> >> >> > Thanks
>> >> >> > /Sten
>> >> >> >
>> >> >> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com>
>> >> wrote:
>> >> >> >
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >> >     ruby arrow-test.rb
>> >> >> >>
>> >> >> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
>> >> >> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>> >> >> >> to a subprocess on macOS for security reason.
>> >> >> >>
>> >> >> >> Could you try the following?
>> >> >> >>
>> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >>       $(rbenv which ruby) arrow-test.rb
>> >> >> >>
>> >> >> >> If you can disable SIP (System Integrity Protection) on the
>> >> >> >> machine, could you provide dtrace log?
>> >> >> >>
>> >> >> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> >> >>
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> --
>> >> >> >> kou
>> >> >> >>
>> >> >> >> In <
>> >> CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com>
>> >> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr
>> 2022
>> >> >> >> 08:26:54 +0200,
>> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >> >>
>> >> >> >> > Hi kou
>> >> >> >> >
>> >> >> >> > Thanks for trying to help me with this
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 1. Yes
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 2. Note that I skipped the -r flag to get the result.
>> >> >> >> >
>> >> >> >> > $ grep -A 4 '<namespace' $(brew
>> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >> >> >   <namespace name="Arrow"
>> >> >> >> >              version="1.0"
>> >> >> >> >              shared-library="libarrow-glib.700.dylib"
>> >> >> >> >              c:identifier-prefixes="GArrow"
>> >> >> >> >              c:symbol-prefixes="garrow">
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 3. Same here
>> >> >> >> >
>> >> >> >> > $ grep -A 4 '<namespace' $(brew
>> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >> >> >   <namespace name="Parquet"
>> >> >> >> >              version="1.0"
>> >> >> >> >              shared-library="libparquet-glib.700.dylib"
>> >> >> >> >              c:identifier-prefixes="GParquet"
>> >> >> >> >              c:symbol-prefixes="gparquet">
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 4. No matches
>> >> >> >> >
>> >> >> >> > $ env | grep LIBRARY_PATH | sort
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 5. Nothing found
>> >> >> >> >
>> >> >> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
>> >> >> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 6. Nothing found
>> >> >> >> >
>> >> >> >> > $ ls /usr/lib/lib*-glib.*.dylib
>> >> >> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>> >> >> >> >
>> >> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib"
>> >> >> >> > ruby arrow-test.rb
>> >> >> >> > (null)-WARNING **: Failed to load shared library
>> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> >
>> >> >>
>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> >> >> (no
>> >> >> >> > such file)
>> >> >> >> > [...]
>> >> >> >> >
>> >> >> >> > Unfortunately it is still a mystery.
>> >> >> >> >
>> >> >> >> > Thanks
>> >> >> >> > /Sten
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>> >> >> wrote:
>> >> >> >> >
>> >> >> >> >> Hi,
>> >> >> >> >>
>> >> >> >> >> Could you tell the following?
>> >> >> >> >>
>> >> >> >> >> 1. Did you run the script in
>> >> >> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>> >> >> >> >>
>> >> >> >> >> 2. The output of
>> >> >> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> >> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >> >> >>
>> >> >> >> >> 3. The output of
>> >> >> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >> >> >>
>> >> >> >> >> 4. The output of
>> >> >> >> >>    env | grep LIBRARY_PATH | sort
>> >> >> >> >>
>> >> >> >> >> 5. The output of
>> >> >> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
>> >> >> >> >>
>> >> >> >> >> 6. The output of
>> >> >> >> >>    ls /usr/lib/lib*-glib.*.dylib
>> >> >> >> >>
>> >> >> >> >> The following command line may resolve this:
>> >> >> >> >>
>> >> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >> >>       ruby arrow-test.rb
>> >> >> >> >>
>> >> >> >> >> Thanks,
>> >> >> >> >> --
>> >> >> >> >> kou
>> >> >> >> >>
>> >> >> >> >> In <
>> >> >> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>> >> >> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr
>> 2022
>> >> >> >> 10:34:52
>> >> >> >> >> +0200,
>> >> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >> >> >>
>> >> >> >> >> > Hi
>> >> >> >> >> >
>> >> >> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The
>> >> test
>> >> >> >> >> program
>> >> >> >> >> > simply consists of
>> >> >> >> >> >
>> >> >> >> >> > require 'parquet'
>> >> >> >> >> >
>> >> >> >> >> > This fails with
>> >> >> >> >> >
>> >> >> >> >> > $ ruby arrow-test.rb
>> >> >> >> >> > (null)-WARNING **: Failed to load shared library
>> >> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> >> >
>> >> >> >>
>> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> >> >> >> (no
>> >> >> >> >> > such file)
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> >> >> >> >> > `load_object_info'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> >> >> >> >> > `load_object_info'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> >> >> > `load_info'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> >> >> > `block (2 levels) in load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> >> >> > `block (2 levels) in each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> >> > `times'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> >> > `block in each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> >> > `each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> >> > `each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> >> >> > `block in load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> >> >> > `prepare_class'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> >> >> > `<module:Parquet>'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> >> >> > `<top (required)>'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> >> > `require'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> >> > `rescue in require'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> >> >> > `require'
>> >> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> >> >> >> >> > `load_object_info': uninitialized constant
>> >> Parquet::ArrowFileReader
>> >> >> >> >> > (NameError)
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> >> >> > `load_info'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> >> >> > `block (2 levels) in load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> >> >> > `block (2 levels) in each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> >> > `times'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> >> > `block in each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> >> > `each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> >> > `each'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> >> >> > `block in load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> >> >> > `prepare_class'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> >> >> > `load'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> >> >> > `<module:Parquet>'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> >> >> > `<top (required)>'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> >> > `require'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> >> > `rescue in require'
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> >> >> > `require'
>> >> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> >> >> > `require': cannot load such file -- parquet (LoadError)
>> >> >> >> >> > from
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> >> >> > `require'
>> >> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >> >
>> >> >> >> >> > I have installed the apache-arrow-glib Homebrew package, but
>> it
>> >> >> seems
>> >> >> >> >> like
>> >> >> >> >> > it is looking for the library in the wrong place, because on
>> M1
>> >> it
>> >> >> is
>> >> >> >> >> > installed in /opt/homebrew. The libraries seems to be built
>> >> >> correctly
>> >> >> >> as
>> >> >> >> >> > far as I can tell:
>> >> >> >> >> >
>> >> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> >> >> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> >> >> >> >> >
>> >> /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> >> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> >> >> >
>> >> >> >>
>> >> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> >> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>> >> >> (compatibility
>> >> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> >> >> (compatibility
>> >> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>> >> >> version
>> >> >> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> >> >> version
>> >> >> >> >> > 1200.3.0)
>> >> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
>> current
>> >> >> >> version
>> >> >> >> >> > 1311.0.0)
>> >> >> >> >> >
>> >> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> >> >> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
>> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> >> >> (compatibility
>> >> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0,
>> >> current
>> >> >> >> version
>> >> >> >> >> > 700.0.0)
>> >> >> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib
>> >> (compatibility
>> >> >> >> >> version
>> >> >> >> >> > 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
>> >> (compatibility
>> >> >> >> >> version
>> >> >> >> >> > 1.1.0, current version 1.1.0)
>> >> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>> >> >> (compatibility
>> >> >> >> >> > version 1.1.0, current version 1.1.0)
>> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
>> >> (compatibility
>> >> >> >> >> version
>> >> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib
>> >> (compatibility
>> >> >> >> >> version
>> >> >> >> >> > 31.0.0, current version 31.4.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >> >
>> >> >> >>
>> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> >> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> >> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >> >
>> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> >> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> >> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >> >
>> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>> >> >> >> (compatibility
>> >> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>> >> >> >> (compatibility
>> >> >> >> >> > version 1.0.0, current version 1.0.0)
>> >> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
>> current
>> >> >> >> version
>> >> >> >> >> > 1311.0.0)
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> >> >> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
>> >> >> >> >> >
>> >> /System/Library/Frameworks/Security.framework/Versions/A/Security
>> >> >> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
>> >> >> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib
>> >> (compatibility
>> >> >> >> version
>> >> >> >> >> > 2.0.0, current version 2.5.0)
>> >> >> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility
>> version
>> >> >> 9.0.0,
>> >> >> >> >> > current version 9.0.0)
>> >> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> >> >> version
>> >> >> >> >> > 1200.3.0)
>> >> >> >> >> >
>> >> >> >> >> > The strange thing is that if I change this to
>> >> >> >> >> >
>> >> >> >> >> > require 'arrow'
>> >> >> >> >> >
>> >> >> >> >> > It works correctly. So for some reason it is able to find the
>> >> Arrow
>> >> >> >> >> > library, but not the Parquet library. What is causing the
>> >> >> difference?
>> >> >> >> >> >
>> >> >> >> >> > Thanks
>> >> >> >> >> > /Sten
>> >> >> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > <https://www.burt.ai/>
>> >> > Sten Larsson | Senior Software Engineer
>> >> > +46 730 41 92 07 | sten@burtcorp.com
>> >>
>> >
>> >
>> > --
>> > <https://www.burt.ai/>
>> > Sten Larsson | Senior Software Engineer
>> > +46 730 41 92 07 | sten@burtcorp.com
>>
> 
> 
> -- 
> <https://www.burt.ai/>
> Sten Larsson | Senior Software Engineer
> +46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi kou

I figured out that the reason the log was incomplete was that the dtruss
buffer was too small. I ran the command with -b 100m and updated the gist.
Note that the log file is truncated in the UI, so you need to download it
to see the interesting parts:
https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5

It seems like the error message is lying, and that it is actually trying to
load /opt/homebrew/lib/libparquet-glib.700.dylib as well. This seems to be
the real problem:

open("@rpath/libarrow.700.dylib\0", 0x0, 0x0) = -1 Err#2
open("@rpath\0", 0x100000, 0x0) = -1 Err#2

Not sure what it means though?

Thanks
/Sten

On Thu, 21 Apr 2022 at 07:30, Sutou Kouhei <ko...@clear-code.com> wrote:

> Hi,
>
> Thanks for the update! It seems that we need to know more
> macOS tools to debug this case...
>
> If I have a M1 Mac, I can look into this more. But I don't
> have it. Please use DYLD_FALLBACK_LIBRARY_PATH for now.
>
>
> Thanks,
> --
> kou
>
> In <CA...@mail.gmail.com>
>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 20 Apr 2022
> 09:49:31 +0200,
>   Sten Larsson <st...@burtcorp.com> wrote:
>
> > Hi kou
> >
> > I rescued NameError instead of LoadError to catch the error, but
> > unfortunately it still doesn't seem to show anything about loading
> > libraries. I updated the gist with the output:
> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> >
> > Thanks
> > /Sten
> >
> > On Wed, 20 Apr 2022 at 02:35, Sutou Kouhei <ko...@clear-code.com> wrote:
> >
> >> Hi,
> >>
> >> Thanks for providing it!
> >>
> >> But it doesn't include information what I want to see (which
> >> files are opened/stated)... It seems that dtruss log isn't
> >> completed.
> >>
> >> Could you try again with the following arrow-test.rb
> >> content?
> >>
> >> ----
> >> begin
> >>   require 'parquet'
> >> rescue LoadError
> >> end
> >> sleep(10)
> >> puts("done")
> >> ---
> >>
> >> Thanks,
> >> --
> >> kou
> >>
> >> In <CA...@mail.gmail.com>
> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Tue, 19 Apr 2022
> >> 08:41:37 +0200,
> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >>
> >> > Hi Kou
> >> >
> >> > I have uploaded the output of dtruss here:
> >> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> >> >
> >> > Thanks
> >> > /Sten
> >> >
> >> > On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com>
> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> > I disabled SIP, but unfortunately dtrace didn't give anything
> useful.
> >> >> >
> >> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> >> > dtrace: no probes specified
> >> >>
> >> >> Sorry... I told wrong command. We should use dtruss not
> >> >> dtrace.
> >> >>
> >> >> Could you try the following?
> >> >>
> >> >>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
> >> >>
> >> >>
> >> >> Thanks,
> >> >> --
> >> >> kou
> >> >>
> >> >> In <CA+EBNmHN-UEvsfLk+G2b-U8u=+
> VwnDqS65UbPTD4QX07BOP75w@mail.gmail.com>
> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> >> >> 09:58:47 +0200,
> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >>
> >> >> > Hi kou
> >> >> >
> >> >> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH
> didn't
> >> >> have
> >> >> > any effect, so this command now works!
> >> >> >
> >> >> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> > --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >       $(rbenv which ruby) arrow-test.rb
> >> >> >
> >> >> > (It doesn't print anything since the script doesn't actually do
> >> >> anything.)
> >> >> >
> >> >> > I disabled SIP, but unfortunately dtrace didn't give anything
> useful.
> >> >> >
> >> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> >> > dtrace: no probes specified
> >> >> >
> >> >> > I have not used dtrace before so I don't know what probes I should
> >> >> specify,
> >> >> > sorry.
> >> >> >
> >> >> > Thanks
> >> >> > /Sten
> >> >> >
> >> >> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com>
> >> wrote:
> >> >> >
> >> >> >> Hi,
> >> >> >>
> >> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >> >     ruby arrow-test.rb
> >> >> >>
> >> >> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
> >> >> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
> >> >> >> to a subprocess on macOS for security reason.
> >> >> >>
> >> >> >> Could you try the following?
> >> >> >>
> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >>       $(rbenv which ruby) arrow-test.rb
> >> >> >>
> >> >> >> If you can disable SIP (System Integrity Protection) on the
> >> >> >> machine, could you provide dtrace log?
> >> >> >>
> >> >> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> >> >>
> >> >> >>
> >> >> >> Thanks,
> >> >> >> --
> >> >> >> kou
> >> >> >>
> >> >> >> In <
> >> CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com>
> >> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr
> 2022
> >> >> >> 08:26:54 +0200,
> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >> >>
> >> >> >> > Hi kou
> >> >> >> >
> >> >> >> > Thanks for trying to help me with this
> >> >> >> >
> >> >> >> >
> >> >> >> > 1. Yes
> >> >> >> >
> >> >> >> >
> >> >> >> > 2. Note that I skipped the -r flag to get the result.
> >> >> >> >
> >> >> >> > $ grep -A 4 '<namespace' $(brew
> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >> >> >   <namespace name="Arrow"
> >> >> >> >              version="1.0"
> >> >> >> >              shared-library="libarrow-glib.700.dylib"
> >> >> >> >              c:identifier-prefixes="GArrow"
> >> >> >> >              c:symbol-prefixes="garrow">
> >> >> >> >
> >> >> >> >
> >> >> >> > 3. Same here
> >> >> >> >
> >> >> >> > $ grep -A 4 '<namespace' $(brew
> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >> >> >   <namespace name="Parquet"
> >> >> >> >              version="1.0"
> >> >> >> >              shared-library="libparquet-glib.700.dylib"
> >> >> >> >              c:identifier-prefixes="GParquet"
> >> >> >> >              c:symbol-prefixes="gparquet">
> >> >> >> >
> >> >> >> >
> >> >> >> > 4. No matches
> >> >> >> >
> >> >> >> > $ env | grep LIBRARY_PATH | sort
> >> >> >> >
> >> >> >> >
> >> >> >> > 5. Nothing found
> >> >> >> >
> >> >> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
> >> >> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
> >> >> >> >
> >> >> >> >
> >> >> >> > 6. Nothing found
> >> >> >> >
> >> >> >> > $ ls /usr/lib/lib*-glib.*.dylib
> >> >> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
> >> >> >> >
> >> >> >> >
> >> >> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
> >> >> >> >
> >> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib"
> >> >> >> > ruby arrow-test.rb
> >> >> >> > (null)-WARNING **: Failed to load shared library
> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> >
> >> >>
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> >> >> (no
> >> >> >> > such file)
> >> >> >> > [...]
> >> >> >> >
> >> >> >> > Unfortunately it is still a mystery.
> >> >> >> >
> >> >> >> > Thanks
> >> >> >> > /Sten
> >> >> >> >
> >> >> >> >
> >> >> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
> >> >> wrote:
> >> >> >> >
> >> >> >> >> Hi,
> >> >> >> >>
> >> >> >> >> Could you tell the following?
> >> >> >> >>
> >> >> >> >> 1. Did you run the script in
> >> >> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
> >> >> >> >>
> >> >> >> >> 2. The output of
> >> >> >> >>    grep -r -A 4 '<namespace' $(brew
> >> >> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >> >> >>
> >> >> >> >> 3. The output of
> >> >> >> >>    grep -r -A 4 '<namespace' $(brew
> >> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >> >> >>
> >> >> >> >> 4. The output of
> >> >> >> >>    env | grep LIBRARY_PATH | sort
> >> >> >> >>
> >> >> >> >> 5. The output of
> >> >> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
> >> >> >> >>
> >> >> >> >> 6. The output of
> >> >> >> >>    ls /usr/lib/lib*-glib.*.dylib
> >> >> >> >>
> >> >> >> >> The following command line may resolve this:
> >> >> >> >>
> >> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >> >>       ruby arrow-test.rb
> >> >> >> >>
> >> >> >> >> Thanks,
> >> >> >> >> --
> >> >> >> >> kou
> >> >> >> >>
> >> >> >> >> In <
> >> >> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
> >> >> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr
> 2022
> >> >> >> 10:34:52
> >> >> >> >> +0200,
> >> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >> >> >>
> >> >> >> >> > Hi
> >> >> >> >> >
> >> >> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The
> >> test
> >> >> >> >> program
> >> >> >> >> > simply consists of
> >> >> >> >> >
> >> >> >> >> > require 'parquet'
> >> >> >> >> >
> >> >> >> >> > This fails with
> >> >> >> >> >
> >> >> >> >> > $ ruby arrow-test.rb
> >> >> >> >> > (null)-WARNING **: Failed to load shared library
> >> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
> >> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> >> >
> >> >> >>
> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> >> >> >> (no
> >> >> >> >> > such file)
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> >> >> >> >> > `load_object_info'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> >> >> >> >> > `load_object_info'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> >> >> > `load_info'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> >> >> > `block (2 levels) in load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> >> >> > `block (2 levels) in each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> >> > `times'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> >> > `block in each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> >> > `each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> >> > `each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> >> >> > `block in load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> >> >> > `prepare_class'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> >> >> > `<module:Parquet>'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> >> >> > `<top (required)>'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> >> > `require'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> >> > `rescue in require'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> >> >> > `require'
> >> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> >> >> >> >> > `load_object_info': uninitialized constant
> >> Parquet::ArrowFileReader
> >> >> >> >> > (NameError)
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> >> >> > `load_info'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> >> >> > `block (2 levels) in load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> >> >> > `block (2 levels) in each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> >> > `times'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> >> > `block in each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> >> > `each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> >> > `each'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> >> >> > `block in load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> >> >> > `prepare_class'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> >> >> > `load'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> >> >> > `<module:Parquet>'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> >> >> > `<top (required)>'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> >> > `require'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> >> > `rescue in require'
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> >> >> > `require'
> >> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> >> >> > `require': cannot load such file -- parquet (LoadError)
> >> >> >> >> > from
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> >> >> > `require'
> >> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >> >
> >> >> >> >> > I have installed the apache-arrow-glib Homebrew package, but
> it
> >> >> seems
> >> >> >> >> like
> >> >> >> >> > it is looking for the library in the wrong place, because on
> M1
> >> it
> >> >> is
> >> >> >> >> > installed in /opt/homebrew. The libraries seems to be built
> >> >> correctly
> >> >> >> as
> >> >> >> >> > far as I can tell:
> >> >> >> >> >
> >> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> >> >> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
> >> >> >> >> >
> >> /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> >> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> >> >> >
> >> >> >>
> >> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> >> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
> >> >> (compatibility
> >> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> >> >> (compatibility
> >> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib
> (compatibility
> >> >> >> version
> >> >> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
> >> >> version
> >> >> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> >> >> version
> >> >> >> >> > 1200.3.0)
> >> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
> current
> >> >> >> version
> >> >> >> >> > 1311.0.0)
> >> >> >> >> >
> >> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> >> >> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
> >> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> >> >> (compatibility
> >> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0,
> >> current
> >> >> >> version
> >> >> >> >> > 700.0.0)
> >> >> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib
> >> (compatibility
> >> >> >> >> version
> >> >> >> >> > 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
> >> (compatibility
> >> >> >> >> version
> >> >> >> >> > 1.1.0, current version 1.1.0)
> >> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
> >> >> (compatibility
> >> >> >> >> > version 1.1.0, current version 1.1.0)
> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib
> (compatibility
> >> >> >> version
> >> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib
> (compatibility
> >> >> >> version
> >> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
> >> (compatibility
> >> >> >> >> version
> >> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib
> >> (compatibility
> >> >> >> >> version
> >> >> >> >> > 31.0.0, current version 31.4.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >> >
> >> >> >>
> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
> >> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
> >> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >> >
> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> >> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
> >> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
> >> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >> >
> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> >> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
> >> >> >> (compatibility
> >> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
> >> >> >> (compatibility
> >> >> >> >> > version 1.0.0, current version 1.0.0)
> >> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
> current
> >> >> >> version
> >> >> >> >> > 1311.0.0)
> >> >> >> >> >
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> >> >> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
> >> >> >> >> >
> >> /System/Library/Frameworks/Security.framework/Versions/A/Security
> >> >> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
> >> >> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib
> >> (compatibility
> >> >> >> version
> >> >> >> >> > 2.0.0, current version 2.5.0)
> >> >> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility
> version
> >> >> 9.0.0,
> >> >> >> >> > current version 9.0.0)
> >> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> >> >> version
> >> >> >> >> > 1200.3.0)
> >> >> >> >> >
> >> >> >> >> > The strange thing is that if I change this to
> >> >> >> >> >
> >> >> >> >> > require 'arrow'
> >> >> >> >> >
> >> >> >> >> > It works correctly. So for some reason it is able to find the
> >> Arrow
> >> >> >> >> > library, but not the Parquet library. What is causing the
> >> >> difference?
> >> >> >> >> >
> >> >> >> >> > Thanks
> >> >> >> >> > /Sten
> >> >> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > <https://www.burt.ai/>
> >> > Sten Larsson | Senior Software Engineer
> >> > +46 730 41 92 07 | sten@burtcorp.com
> >>
> >
> >
> > --
> > <https://www.burt.ai/>
> > Sten Larsson | Senior Software Engineer
> > +46 730 41 92 07 | sten@burtcorp.com
>


-- 
<https://www.burt.ai/>
Sten Larsson | Senior Software Engineer
+46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

Thanks for the update! It seems that we need to know more
macOS tools to debug this case...

If I have a M1 Mac, I can look into this more. But I don't
have it. Please use DYLD_FALLBACK_LIBRARY_PATH for now.


Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 20 Apr 2022 09:49:31 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi kou
> 
> I rescued NameError instead of LoadError to catch the error, but
> unfortunately it still doesn't seem to show anything about loading
> libraries. I updated the gist with the output:
> https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> 
> Thanks
> /Sten
> 
> On Wed, 20 Apr 2022 at 02:35, Sutou Kouhei <ko...@clear-code.com> wrote:
> 
>> Hi,
>>
>> Thanks for providing it!
>>
>> But it doesn't include information what I want to see (which
>> files are opened/stated)... It seems that dtruss log isn't
>> completed.
>>
>> Could you try again with the following arrow-test.rb
>> content?
>>
>> ----
>> begin
>>   require 'parquet'
>> rescue LoadError
>> end
>> sleep(10)
>> puts("done")
>> ---
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Tue, 19 Apr 2022
>> 08:41:37 +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi Kou
>> >
>> > I have uploaded the output of dtruss here:
>> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
>> >
>> > Thanks
>> > /Sten
>> >
>> > On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
>> >> >
>> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> > dtrace: no probes specified
>> >>
>> >> Sorry... I told wrong command. We should use dtruss not
>> >> dtrace.
>> >>
>> >> Could you try the following?
>> >>
>> >>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
>> >>
>> >>
>> >> Thanks,
>> >> --
>> >> kou
>> >>
>> >> In <CA...@mail.gmail.com>
>> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> >> 09:58:47 +0200,
>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >>
>> >> > Hi kou
>> >> >
>> >> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>> >> have
>> >> > any effect, so this command now works!
>> >> >
>> >> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> > --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >       $(rbenv which ruby) arrow-test.rb
>> >> >
>> >> > (It doesn't print anything since the script doesn't actually do
>> >> anything.)
>> >> >
>> >> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
>> >> >
>> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> > dtrace: no probes specified
>> >> >
>> >> > I have not used dtrace before so I don't know what probes I should
>> >> specify,
>> >> > sorry.
>> >> >
>> >> > Thanks
>> >> > /Sten
>> >> >
>> >> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com>
>> wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >     ruby arrow-test.rb
>> >> >>
>> >> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
>> >> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>> >> >> to a subprocess on macOS for security reason.
>> >> >>
>> >> >> Could you try the following?
>> >> >>
>> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >>       $(rbenv which ruby) arrow-test.rb
>> >> >>
>> >> >> If you can disable SIP (System Integrity Protection) on the
>> >> >> machine, could you provide dtrace log?
>> >> >>
>> >> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >> >>
>> >> >>
>> >> >> Thanks,
>> >> >> --
>> >> >> kou
>> >> >>
>> >> >> In <
>> CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com>
>> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> >> >> 08:26:54 +0200,
>> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >>
>> >> >> > Hi kou
>> >> >> >
>> >> >> > Thanks for trying to help me with this
>> >> >> >
>> >> >> >
>> >> >> > 1. Yes
>> >> >> >
>> >> >> >
>> >> >> > 2. Note that I skipped the -r flag to get the result.
>> >> >> >
>> >> >> > $ grep -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >> >   <namespace name="Arrow"
>> >> >> >              version="1.0"
>> >> >> >              shared-library="libarrow-glib.700.dylib"
>> >> >> >              c:identifier-prefixes="GArrow"
>> >> >> >              c:symbol-prefixes="garrow">
>> >> >> >
>> >> >> >
>> >> >> > 3. Same here
>> >> >> >
>> >> >> > $ grep -A 4 '<namespace' $(brew
>> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >> >   <namespace name="Parquet"
>> >> >> >              version="1.0"
>> >> >> >              shared-library="libparquet-glib.700.dylib"
>> >> >> >              c:identifier-prefixes="GParquet"
>> >> >> >              c:symbol-prefixes="gparquet">
>> >> >> >
>> >> >> >
>> >> >> > 4. No matches
>> >> >> >
>> >> >> > $ env | grep LIBRARY_PATH | sort
>> >> >> >
>> >> >> >
>> >> >> > 5. Nothing found
>> >> >> >
>> >> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
>> >> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>> >> >> >
>> >> >> >
>> >> >> > 6. Nothing found
>> >> >> >
>> >> >> > $ ls /usr/lib/lib*-glib.*.dylib
>> >> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>> >> >> >
>> >> >> >
>> >> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>> >> >> >
>> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> --prefix)/lib:/usr/local/lib:/usr/lib"
>> >> >> > ruby arrow-test.rb
>> >> >> > (null)-WARNING **: Failed to load shared library
>> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >
>> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> >> (no
>> >> >> > such file)
>> >> >> > [...]
>> >> >> >
>> >> >> > Unfortunately it is still a mystery.
>> >> >> >
>> >> >> > Thanks
>> >> >> > /Sten
>> >> >> >
>> >> >> >
>> >> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>> >> wrote:
>> >> >> >
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> Could you tell the following?
>> >> >> >>
>> >> >> >> 1. Did you run the script in
>> >> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>> >> >> >>
>> >> >> >> 2. The output of
>> >> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >> >>
>> >> >> >> 3. The output of
>> >> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >> >>
>> >> >> >> 4. The output of
>> >> >> >>    env | grep LIBRARY_PATH | sort
>> >> >> >>
>> >> >> >> 5. The output of
>> >> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
>> >> >> >>
>> >> >> >> 6. The output of
>> >> >> >>    ls /usr/lib/lib*-glib.*.dylib
>> >> >> >>
>> >> >> >> The following command line may resolve this:
>> >> >> >>
>> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >> >>       ruby arrow-test.rb
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> --
>> >> >> >> kou
>> >> >> >>
>> >> >> >> In <
>> >> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>> >> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>> >> >> 10:34:52
>> >> >> >> +0200,
>> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >> >>
>> >> >> >> > Hi
>> >> >> >> >
>> >> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The
>> test
>> >> >> >> program
>> >> >> >> > simply consists of
>> >> >> >> >
>> >> >> >> > require 'parquet'
>> >> >> >> >
>> >> >> >> > This fails with
>> >> >> >> >
>> >> >> >> > $ ruby arrow-test.rb
>> >> >> >> > (null)-WARNING **: Failed to load shared library
>> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >> >
>> >> >>
>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> >> >> (no
>> >> >> >> > such file)
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> >> >> >> > `load_object_info'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> >> >> >> > `load_object_info'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> >> > `load_info'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> >> > `block (2 levels) in load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> >> > `block (2 levels) in each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> > `times'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> > `block in each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> > `each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> > `each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> >> > `block in load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> >> > `prepare_class'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> >> > `<module:Parquet>'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> >> > `<top (required)>'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> > `require'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> > `rescue in require'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> >> > `require'
>> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> >> >> >> > `load_object_info': uninitialized constant
>> Parquet::ArrowFileReader
>> >> >> >> > (NameError)
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> >> > `load_info'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> >> > `block (2 levels) in load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> >> > `block (2 levels) in each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> > `times'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> >> > `block in each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> > `each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> >> > `each'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> >> > `block in load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> >> > `prepare_class'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> >> > `load'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> >> > `<module:Parquet>'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> >> > `<top (required)>'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> > `require'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> >> > `rescue in require'
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> >> > `require'
>> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> >> > `require': cannot load such file -- parquet (LoadError)
>> >> >> >> > from
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> >> > `require'
>> >> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >> >
>> >> >> >> > I have installed the apache-arrow-glib Homebrew package, but it
>> >> seems
>> >> >> >> like
>> >> >> >> > it is looking for the library in the wrong place, because on M1
>> it
>> >> is
>> >> >> >> > installed in /opt/homebrew. The libraries seems to be built
>> >> correctly
>> >> >> as
>> >> >> >> > far as I can tell:
>> >> >> >> >
>> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> >> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> >> >> >> >
>> /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> >> >
>> >> >>
>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>> >> (compatibility
>> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> >> (compatibility
>> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>> >> >> version
>> >> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>> >> version
>> >> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> >> version
>> >> >> >> > 1200.3.0)
>> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> >> >> version
>> >> >> >> > 1311.0.0)
>> >> >> >> >
>> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> >> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
>> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> >> (compatibility
>> >> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0,
>> current
>> >> >> version
>> >> >> >> > 700.0.0)
>> >> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> > 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> > 1.1.0, current version 1.1.0)
>> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>> >> (compatibility
>> >> >> >> > version 1.1.0, current version 1.1.0)
>> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>> >> >> version
>> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>> >> >> version
>> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> > 1.0.0, current version 1.0.9)
>> >> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib
>> (compatibility
>> >> >> >> version
>> >> >> >> > 31.0.0, current version 31.4.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> >
>> >> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> >> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>> >> (compatibility
>> >> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> >> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> >> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> >> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>> >> >> (compatibility
>> >> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>> >> >> (compatibility
>> >> >> >> > version 1.0.0, current version 1.0.0)
>> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> >> >> version
>> >> >> >> > 1311.0.0)
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> >> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
>> >> >> >> >
>> /System/Library/Frameworks/Security.framework/Versions/A/Security
>> >> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
>> >> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib
>> (compatibility
>> >> >> version
>> >> >> >> > 2.0.0, current version 2.5.0)
>> >> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>> >> 9.0.0,
>> >> >> >> > current version 9.0.0)
>> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> >> version
>> >> >> >> > 1200.3.0)
>> >> >> >> >
>> >> >> >> > The strange thing is that if I change this to
>> >> >> >> >
>> >> >> >> > require 'arrow'
>> >> >> >> >
>> >> >> >> > It works correctly. So for some reason it is able to find the
>> Arrow
>> >> >> >> > library, but not the Parquet library. What is causing the
>> >> difference?
>> >> >> >> >
>> >> >> >> > Thanks
>> >> >> >> > /Sten
>> >> >> >>
>> >>
>> >
>> >
>> > --
>> > <https://www.burt.ai/>
>> > Sten Larsson | Senior Software Engineer
>> > +46 730 41 92 07 | sten@burtcorp.com
>>
> 
> 
> -- 
> <https://www.burt.ai/>
> Sten Larsson | Senior Software Engineer
> +46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi kou

I rescued NameError instead of LoadError to catch the error, but
unfortunately it still doesn't seem to show anything about loading
libraries. I updated the gist with the output:
https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5

Thanks
/Sten

On Wed, 20 Apr 2022 at 02:35, Sutou Kouhei <ko...@clear-code.com> wrote:

> Hi,
>
> Thanks for providing it!
>
> But it doesn't include information what I want to see (which
> files are opened/stated)... It seems that dtruss log isn't
> completed.
>
> Could you try again with the following arrow-test.rb
> content?
>
> ----
> begin
>   require 'parquet'
> rescue LoadError
> end
> sleep(10)
> puts("done")
> ---
>
> Thanks,
> --
> kou
>
> In <CA...@mail.gmail.com>
>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Tue, 19 Apr 2022
> 08:41:37 +0200,
>   Sten Larsson <st...@burtcorp.com> wrote:
>
> > Hi Kou
> >
> > I have uploaded the output of dtruss here:
> > https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> >
> > Thanks
> > /Sten
> >
> > On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com> wrote:
> >
> >> Hi,
> >>
> >> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
> >> >
> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> > dtrace: no probes specified
> >>
> >> Sorry... I told wrong command. We should use dtruss not
> >> dtrace.
> >>
> >> Could you try the following?
> >>
> >>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
> >>
> >>
> >> Thanks,
> >> --
> >> kou
> >>
> >> In <CA...@mail.gmail.com>
> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> >> 09:58:47 +0200,
> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >>
> >> > Hi kou
> >> >
> >> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
> >> have
> >> > any effect, so this command now works!
> >> >
> >> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> > --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >       $(rbenv which ruby) arrow-test.rb
> >> >
> >> > (It doesn't print anything since the script doesn't actually do
> >> anything.)
> >> >
> >> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
> >> >
> >> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> > dtrace: no probes specified
> >> >
> >> > I have not used dtrace before so I don't know what probes I should
> >> specify,
> >> > sorry.
> >> >
> >> > Thanks
> >> > /Sten
> >> >
> >> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com>
> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >     ruby arrow-test.rb
> >> >>
> >> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
> >> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
> >> >> to a subprocess on macOS for security reason.
> >> >>
> >> >> Could you try the following?
> >> >>
> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >>       $(rbenv which ruby) arrow-test.rb
> >> >>
> >> >> If you can disable SIP (System Integrity Protection) on the
> >> >> machine, could you provide dtrace log?
> >> >>
> >> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >> >>
> >> >>
> >> >> Thanks,
> >> >> --
> >> >> kou
> >> >>
> >> >> In <
> CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com>
> >> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> >> >> 08:26:54 +0200,
> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >>
> >> >> > Hi kou
> >> >> >
> >> >> > Thanks for trying to help me with this
> >> >> >
> >> >> >
> >> >> > 1. Yes
> >> >> >
> >> >> >
> >> >> > 2. Note that I skipped the -r flag to get the result.
> >> >> >
> >> >> > $ grep -A 4 '<namespace' $(brew
> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >> >   <namespace name="Arrow"
> >> >> >              version="1.0"
> >> >> >              shared-library="libarrow-glib.700.dylib"
> >> >> >              c:identifier-prefixes="GArrow"
> >> >> >              c:symbol-prefixes="garrow">
> >> >> >
> >> >> >
> >> >> > 3. Same here
> >> >> >
> >> >> > $ grep -A 4 '<namespace' $(brew
> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >> >   <namespace name="Parquet"
> >> >> >              version="1.0"
> >> >> >              shared-library="libparquet-glib.700.dylib"
> >> >> >              c:identifier-prefixes="GParquet"
> >> >> >              c:symbol-prefixes="gparquet">
> >> >> >
> >> >> >
> >> >> > 4. No matches
> >> >> >
> >> >> > $ env | grep LIBRARY_PATH | sort
> >> >> >
> >> >> >
> >> >> > 5. Nothing found
> >> >> >
> >> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
> >> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
> >> >> >
> >> >> >
> >> >> > 6. Nothing found
> >> >> >
> >> >> > $ ls /usr/lib/lib*-glib.*.dylib
> >> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
> >> >> >
> >> >> >
> >> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
> >> >> >
> >> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> --prefix)/lib:/usr/local/lib:/usr/lib"
> >> >> > ruby arrow-test.rb
> >> >> > (null)-WARNING **: Failed to load shared library
> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> >> > 'libparquet-glib.700.dylib' (no such file),
> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >
> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> >> (no
> >> >> > such file)
> >> >> > [...]
> >> >> >
> >> >> > Unfortunately it is still a mystery.
> >> >> >
> >> >> > Thanks
> >> >> > /Sten
> >> >> >
> >> >> >
> >> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
> >> wrote:
> >> >> >
> >> >> >> Hi,
> >> >> >>
> >> >> >> Could you tell the following?
> >> >> >>
> >> >> >> 1. Did you run the script in
> >> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
> >> >> >>
> >> >> >> 2. The output of
> >> >> >>    grep -r -A 4 '<namespace' $(brew
> >> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >> >>
> >> >> >> 3. The output of
> >> >> >>    grep -r -A 4 '<namespace' $(brew
> >> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >> >>
> >> >> >> 4. The output of
> >> >> >>    env | grep LIBRARY_PATH | sort
> >> >> >>
> >> >> >> 5. The output of
> >> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
> >> >> >>
> >> >> >> 6. The output of
> >> >> >>    ls /usr/lib/lib*-glib.*.dylib
> >> >> >>
> >> >> >> The following command line may resolve this:
> >> >> >>
> >> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >> >>       ruby arrow-test.rb
> >> >> >>
> >> >> >> Thanks,
> >> >> >> --
> >> >> >> kou
> >> >> >>
> >> >> >> In <
> >> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
> >> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
> >> >> 10:34:52
> >> >> >> +0200,
> >> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >> >>
> >> >> >> > Hi
> >> >> >> >
> >> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The
> test
> >> >> >> program
> >> >> >> > simply consists of
> >> >> >> >
> >> >> >> > require 'parquet'
> >> >> >> >
> >> >> >> > This fails with
> >> >> >> >
> >> >> >> > $ ruby arrow-test.rb
> >> >> >> > (null)-WARNING **: Failed to load shared library
> >> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> >> >> > 'libparquet-glib.700.dylib' (no such file),
> >> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >> >
> >> >>
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> >> >> (no
> >> >> >> > such file)
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> >> >> >> > `load_object_info'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> >> >> >> > `load_object_info'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> >> > `load_info'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> >> > `block (2 levels) in load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> >> > `block (2 levels) in each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> > `times'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> > `block in each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> > `each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> > `each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> >> > `block in load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> >> > `prepare_class'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> >> > `<module:Parquet>'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> >> > `<top (required)>'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> > `require'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> > `rescue in require'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> >> > `require'
> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> >> >> >> > `load_object_info': uninitialized constant
> Parquet::ArrowFileReader
> >> >> >> > (NameError)
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> >> > `load_info'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> >> > `block (2 levels) in load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> >> > `block (2 levels) in each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> > `times'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> >> > `block in each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> > `each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> >> > `each'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> >> > `block in load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> >> > `prepare_class'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> >> > `load'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> >> > `<module:Parquet>'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> >> > `<top (required)>'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> > `require'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> >> > `rescue in require'
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> >> > `require'
> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> >> > `require': cannot load such file -- parquet (LoadError)
> >> >> >> > from
> >> >> >> >
> >> >> >>
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> >> > `require'
> >> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >> >
> >> >> >> > I have installed the apache-arrow-glib Homebrew package, but it
> >> seems
> >> >> >> like
> >> >> >> > it is looking for the library in the wrong place, because on M1
> it
> >> is
> >> >> >> > installed in /opt/homebrew. The libraries seems to be built
> >> correctly
> >> >> as
> >> >> >> > far as I can tell:
> >> >> >> >
> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> >> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
> >> >> >> >
> /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> >> >
> >> >>
> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> >> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
> >> (compatibility
> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> >> (compatibility
> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
> >> >> version
> >> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
> >> version
> >> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> >> version
> >> >> >> > 1200.3.0)
> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> >> >> version
> >> >> >> > 1311.0.0)
> >> >> >> >
> >> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> >> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
> >> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> >> (compatibility
> >> >> >> > version 700.0.0, current version 700.0.0)
> >> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0,
> current
> >> >> version
> >> >> >> > 700.0.0)
> >> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib
> (compatibility
> >> >> >> version
> >> >> >> > 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
> (compatibility
> >> >> >> version
> >> >> >> > 1.1.0, current version 1.1.0)
> >> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
> >> (compatibility
> >> >> >> > version 1.1.0, current version 1.1.0)
> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
> >> >> version
> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
> >> >> version
> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
> (compatibility
> >> >> >> version
> >> >> >> > 1.0.0, current version 1.0.9)
> >> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib
> (compatibility
> >> >> >> version
> >> >> >> > 31.0.0, current version 31.4.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> >
> >> >>
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> >> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
> >> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
> >> (compatibility
> >> >> >> > version 0.0.0, current version 0.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
> >> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
> >> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
> >> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> >> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
> >> >> (compatibility
> >> >> >> > version 0.0.0, current version 1.0.0)
> >> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
> >> >> (compatibility
> >> >> >> > version 1.0.0, current version 1.0.0)
> >> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> >> >> version
> >> >> >> > 1311.0.0)
> >> >> >> >
> >> >> >>
> >> >>
> >>
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> >> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
> >> >> >> >
> /System/Library/Frameworks/Security.framework/Versions/A/Security
> >> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
> >> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib
> (compatibility
> >> >> version
> >> >> >> > 2.0.0, current version 2.5.0)
> >> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
> >> 9.0.0,
> >> >> >> > current version 9.0.0)
> >> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> >> version
> >> >> >> > 1200.3.0)
> >> >> >> >
> >> >> >> > The strange thing is that if I change this to
> >> >> >> >
> >> >> >> > require 'arrow'
> >> >> >> >
> >> >> >> > It works correctly. So for some reason it is able to find the
> Arrow
> >> >> >> > library, but not the Parquet library. What is causing the
> >> difference?
> >> >> >> >
> >> >> >> > Thanks
> >> >> >> > /Sten
> >> >> >>
> >>
> >
> >
> > --
> > <https://www.burt.ai/>
> > Sten Larsson | Senior Software Engineer
> > +46 730 41 92 07 | sten@burtcorp.com
>


-- 
<https://www.burt.ai/>
Sten Larsson | Senior Software Engineer
+46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

Thanks for providing it!

But it doesn't include information what I want to see (which
files are opened/stated)... It seems that dtruss log isn't
completed.

Could you try again with the following arrow-test.rb
content?

----
begin
  require 'parquet'
rescue LoadError
end
sleep(10)
puts("done")
---

Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Tue, 19 Apr 2022 08:41:37 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi Kou
> 
> I have uploaded the output of dtruss here:
> https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5
> 
> Thanks
> /Sten
> 
> On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com> wrote:
> 
>> Hi,
>>
>> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
>> >
>> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> > dtrace: no probes specified
>>
>> Sorry... I told wrong command. We should use dtruss not
>> dtrace.
>>
>> Could you try the following?
>>
>>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
>>
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> 09:58:47 +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi kou
>> >
>> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>> have
>> > any effect, so this command now works!
>> >
>> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> > --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >       $(rbenv which ruby) arrow-test.rb
>> >
>> > (It doesn't print anything since the script doesn't actually do
>> anything.)
>> >
>> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
>> >
>> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> > dtrace: no probes specified
>> >
>> > I have not used dtrace before so I don't know what probes I should
>> specify,
>> > sorry.
>> >
>> > Thanks
>> > /Sten
>> >
>> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >     ruby arrow-test.rb
>> >>
>> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
>> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>> >> to a subprocess on macOS for security reason.
>> >>
>> >> Could you try the following?
>> >>
>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >>       $(rbenv which ruby) arrow-test.rb
>> >>
>> >> If you can disable SIP (System Integrity Protection) on the
>> >> machine, could you provide dtrace log?
>> >>
>> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> >>
>> >>
>> >> Thanks,
>> >> --
>> >> kou
>> >>
>> >> In <CA...@mail.gmail.com>
>> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> >> 08:26:54 +0200,
>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >>
>> >> > Hi kou
>> >> >
>> >> > Thanks for trying to help me with this
>> >> >
>> >> >
>> >> > 1. Yes
>> >> >
>> >> >
>> >> > 2. Note that I skipped the -r flag to get the result.
>> >> >
>> >> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >   <namespace name="Arrow"
>> >> >              version="1.0"
>> >> >              shared-library="libarrow-glib.700.dylib"
>> >> >              c:identifier-prefixes="GArrow"
>> >> >              c:symbol-prefixes="garrow">
>> >> >
>> >> >
>> >> > 3. Same here
>> >> >
>> >> > $ grep -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >   <namespace name="Parquet"
>> >> >              version="1.0"
>> >> >              shared-library="libparquet-glib.700.dylib"
>> >> >              c:identifier-prefixes="GParquet"
>> >> >              c:symbol-prefixes="gparquet">
>> >> >
>> >> >
>> >> > 4. No matches
>> >> >
>> >> > $ env | grep LIBRARY_PATH | sort
>> >> >
>> >> >
>> >> > 5. Nothing found
>> >> >
>> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
>> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>> >> >
>> >> >
>> >> > 6. Nothing found
>> >> >
>> >> > $ ls /usr/lib/lib*-glib.*.dylib
>> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>> >> >
>> >> >
>> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>> >> >
>> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> --prefix)/lib:/usr/local/lib:/usr/lib"
>> >> > ruby arrow-test.rb
>> >> > (null)-WARNING **: Failed to load shared library
>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >
>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> (no
>> >> > such file)
>> >> > [...]
>> >> >
>> >> > Unfortunately it is still a mystery.
>> >> >
>> >> > Thanks
>> >> > /Sten
>> >> >
>> >> >
>> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>> wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> Could you tell the following?
>> >> >>
>> >> >> 1. Did you run the script in
>> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>> >> >>
>> >> >> 2. The output of
>> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >> >>
>> >> >> 3. The output of
>> >> >>    grep -r -A 4 '<namespace' $(brew
>> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >> >>
>> >> >> 4. The output of
>> >> >>    env | grep LIBRARY_PATH | sort
>> >> >>
>> >> >> 5. The output of
>> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
>> >> >>
>> >> >> 6. The output of
>> >> >>    ls /usr/lib/lib*-glib.*.dylib
>> >> >>
>> >> >> The following command line may resolve this:
>> >> >>
>> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >> >>       ruby arrow-test.rb
>> >> >>
>> >> >> Thanks,
>> >> >> --
>> >> >> kou
>> >> >>
>> >> >> In <
>> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>> >> 10:34:52
>> >> >> +0200,
>> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >> >>
>> >> >> > Hi
>> >> >> >
>> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>> >> >> program
>> >> >> > simply consists of
>> >> >> >
>> >> >> > require 'parquet'
>> >> >> >
>> >> >> > This fails with
>> >> >> >
>> >> >> > $ ruby arrow-test.rb
>> >> >> > (null)-WARNING **: Failed to load shared library
>> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >> >
>> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> >> (no
>> >> >> > such file)
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> >> >> > `load_object_info'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> >> >> > `load_object_info'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> > `load_info'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> > `block (2 levels) in load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> > `block (2 levels) in each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> > `times'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> > `block in each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> > `each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> > `each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> > `block in load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> > `prepare_class'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> > `<module:Parquet>'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> > `<top (required)>'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> > `require'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> > `rescue in require'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> > `require'
>> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> >> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>> >> >> > (NameError)
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> >> > `load_info'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> >> > `block (2 levels) in load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> >> > `block (2 levels) in each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> > `times'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> >> > `block in each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> > `each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> >> > `each'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> >> > `block in load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> >> > `prepare_class'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> >> > `load'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> >> > `<module:Parquet>'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> >> > `<top (required)>'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> > `require'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> >> > `rescue in require'
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> >> > `require'
>> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> > `require': cannot load such file -- parquet (LoadError)
>> >> >> > from
>> >> >> >
>> >> >>
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> >> > `require'
>> >> >> > from arrow-test.rb:1:in `<main>'
>> >> >> >
>> >> >> > I have installed the apache-arrow-glib Homebrew package, but it
>> seems
>> >> >> like
>> >> >> > it is looking for the library in the wrong place, because on M1 it
>> is
>> >> >> > installed in /opt/homebrew. The libraries seems to be built
>> correctly
>> >> as
>> >> >> > far as I can tell:
>> >> >> >
>> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> >> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> >
>> >> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> >> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>> (compatibility
>> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> (compatibility
>> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>> >> version
>> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>> version
>> >> >> > 7001.0.0, current version 7001.3.0)
>> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> version
>> >> >> > 1200.3.0)
>> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> >> version
>> >> >> > 1311.0.0)
>> >> >> >
>> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
>> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> (compatibility
>> >> >> > version 700.0.0, current version 700.0.0)
>> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>> >> version
>> >> >> > 700.0.0)
>> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>> >> >> version
>> >> >> > 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>> >> >> version
>> >> >> > 1.1.0, current version 1.1.0)
>> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>> (compatibility
>> >> >> > version 1.1.0, current version 1.1.0)
>> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>> >> version
>> >> >> > 1.0.0, current version 1.0.9)
>> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>> >> version
>> >> >> > 1.0.0, current version 1.0.9)
>> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>> >> >> version
>> >> >> > 1.0.0, current version 1.0.9)
>> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>> >> >> version
>> >> >> > 31.0.0, current version 31.4.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >
>> >> >>
>> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> >
>> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> >> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>> >> (compatibility
>> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>> >> (compatibility
>> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> >> >> (compatibility
>> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>> (compatibility
>> >> >> > version 0.0.0, current version 0.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> >> >> (compatibility
>> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> >> >> (compatibility
>> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> >> >> (compatibility
>> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>> >> (compatibility
>> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> >> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>> >> (compatibility
>> >> >> > version 0.0.0, current version 1.0.0)
>> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>> >> (compatibility
>> >> >> > version 1.0.0, current version 1.0.0)
>> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> >> version
>> >> >> > 1311.0.0)
>> >> >> >
>> >> >>
>> >>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
>> >> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
>> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>> >> version
>> >> >> > 2.0.0, current version 2.5.0)
>> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>> 9.0.0,
>> >> >> > current version 9.0.0)
>> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>> version
>> >> >> > 1200.3.0)
>> >> >> >
>> >> >> > The strange thing is that if I change this to
>> >> >> >
>> >> >> > require 'arrow'
>> >> >> >
>> >> >> > It works correctly. So for some reason it is able to find the Arrow
>> >> >> > library, but not the Parquet library. What is causing the
>> difference?
>> >> >> >
>> >> >> > Thanks
>> >> >> > /Sten
>> >> >>
>>
> 
> 
> -- 
> <https://www.burt.ai/>
> Sten Larsson | Senior Software Engineer
> +46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi Kou

I have uploaded the output of dtruss here:
https://gist.github.com/stenlarsson/02d777e4c3b9e485b6e0f80f834ed8f5

Thanks
/Sten

On Fri, 15 Apr 2022 at 02:50, Sutou Kouhei <ko...@clear-code.com> wrote:

> Hi,
>
> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
> >
> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> > dtrace: no probes specified
>
> Sorry... I told wrong command. We should use dtruss not
> dtrace.
>
> Could you try the following?
>
>   $ sudo dtruss $(rbenv which ruby) arrow-test.rb
>
>
> Thanks,
> --
> kou
>
> In <CA...@mail.gmail.com>
>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> 09:58:47 +0200,
>   Sten Larsson <st...@burtcorp.com> wrote:
>
> > Hi kou
> >
> > Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
> have
> > any effect, so this command now works!
> >
> >   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> > --prefix)/lib:/usr/local/lib:/usr/lib" \
> >       $(rbenv which ruby) arrow-test.rb
> >
> > (It doesn't print anything since the script doesn't actually do
> anything.)
> >
> > I disabled SIP, but unfortunately dtrace didn't give anything useful.
> >
> > $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> > dtrace: no probes specified
> >
> > I have not used dtrace before so I don't know what probes I should
> specify,
> > sorry.
> >
> > Thanks
> > /Sten
> >
> > On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
> >
> >> Hi,
> >>
> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >     ruby arrow-test.rb
> >>
> >> Ah, I forgot that you use rbenv. rbenv runs ruby from
> >> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
> >> to a subprocess on macOS for security reason.
> >>
> >> Could you try the following?
> >>
> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >>       $(rbenv which ruby) arrow-test.rb
> >>
> >> If you can disable SIP (System Integrity Protection) on the
> >> machine, could you provide dtrace log?
> >>
> >>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> >>
> >>
> >> Thanks,
> >> --
> >> kou
> >>
> >> In <CA...@mail.gmail.com>
> >>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> >> 08:26:54 +0200,
> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >>
> >> > Hi kou
> >> >
> >> > Thanks for trying to help me with this
> >> >
> >> >
> >> > 1. Yes
> >> >
> >> >
> >> > 2. Note that I skipped the -r flag to get the result.
> >> >
> >> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >   <namespace name="Arrow"
> >> >              version="1.0"
> >> >              shared-library="libarrow-glib.700.dylib"
> >> >              c:identifier-prefixes="GArrow"
> >> >              c:symbol-prefixes="garrow">
> >> >
> >> >
> >> > 3. Same here
> >> >
> >> > $ grep -A 4 '<namespace' $(brew
> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >   <namespace name="Parquet"
> >> >              version="1.0"
> >> >              shared-library="libparquet-glib.700.dylib"
> >> >              c:identifier-prefixes="GParquet"
> >> >              c:symbol-prefixes="gparquet">
> >> >
> >> >
> >> > 4. No matches
> >> >
> >> > $ env | grep LIBRARY_PATH | sort
> >> >
> >> >
> >> > 5. Nothing found
> >> >
> >> > $ ls /usr/local/lib/lib*-glib.*.dylib
> >> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
> >> >
> >> >
> >> > 6. Nothing found
> >> >
> >> > $ ls /usr/lib/lib*-glib.*.dylib
> >> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
> >> >
> >> >
> >> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
> >> >
> >> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> --prefix)/lib:/usr/local/lib:/usr/lib"
> >> > ruby arrow-test.rb
> >> > (null)-WARNING **: Failed to load shared library
> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> > 'libparquet-glib.700.dylib' (no such file),
> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> (no
> >> > such file)
> >> > [...]
> >> >
> >> > Unfortunately it is still a mystery.
> >> >
> >> > Thanks
> >> > /Sten
> >> >
> >> >
> >> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> Could you tell the following?
> >> >>
> >> >> 1. Did you run the script in
> >> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
> >> >>
> >> >> 2. The output of
> >> >>    grep -r -A 4 '<namespace' $(brew
> >> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >> >>
> >> >> 3. The output of
> >> >>    grep -r -A 4 '<namespace' $(brew
> >> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >> >>
> >> >> 4. The output of
> >> >>    env | grep LIBRARY_PATH | sort
> >> >>
> >> >> 5. The output of
> >> >>    ls /usr/local/lib/lib*-glib.*.dylib
> >> >>
> >> >> 6. The output of
> >> >>    ls /usr/lib/lib*-glib.*.dylib
> >> >>
> >> >> The following command line may resolve this:
> >> >>
> >> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >> >>       ruby arrow-test.rb
> >> >>
> >> >> Thanks,
> >> >> --
> >> >> kou
> >> >>
> >> >> In <
> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
> >> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
> >> 10:34:52
> >> >> +0200,
> >> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >> >>
> >> >> > Hi
> >> >> >
> >> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
> >> >> program
> >> >> > simply consists of
> >> >> >
> >> >> > require 'parquet'
> >> >> >
> >> >> > This fails with
> >> >> >
> >> >> > $ ruby arrow-test.rb
> >> >> > (null)-WARNING **: Failed to load shared library
> >> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> >> > 'libparquet-glib.700.dylib' (no such file),
> >> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >> >
> >> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> >> (no
> >> >> > such file)
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> >> >> > `load_object_info'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> >> >> > `load_object_info'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> > `load_info'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> > `block (2 levels) in load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> > `block (2 levels) in each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> > `times'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> > `block in each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> > `each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> > `each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> > `block in load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> > `prepare_class'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> > `<module:Parquet>'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> > `<top (required)>'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> > `require'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> > `rescue in require'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> > `require'
> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> >> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
> >> >> > (NameError)
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> >> > `load_info'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> >> > `block (2 levels) in load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> >> > `block (2 levels) in each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> > `times'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> >> > `block in each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> > `each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> >> > `each'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> >> > `block in load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> >> > `prepare_class'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> >> > `load'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> >> > `<module:Parquet>'
> >> >> > from
> >> >> >
> >> >>
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> >> > `<top (required)>'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> > `require'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> >> > `rescue in require'
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> >> > `require'
> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> > `require': cannot load such file -- parquet (LoadError)
> >> >> > from
> >> >> >
> >> >>
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> >> > `require'
> >> >> > from arrow-test.rb:1:in `<main>'
> >> >> >
> >> >> > I have installed the apache-arrow-glib Homebrew package, but it
> seems
> >> >> like
> >> >> > it is looking for the library in the wrong place, because on M1 it
> is
> >> >> > installed in /opt/homebrew. The libraries seems to be built
> correctly
> >> as
> >> >> > far as I can tell:
> >> >> >
> >> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> >> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
> >> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> >
> >> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> >> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
> (compatibility
> >> >> > version 700.0.0, current version 700.0.0)
> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> (compatibility
> >> >> > version 700.0.0, current version 700.0.0)
> >> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
> >> version
> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
> version
> >> >> > 7001.0.0, current version 7001.3.0)
> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> version
> >> >> > 1200.3.0)
> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> >> version
> >> >> > 1311.0.0)
> >> >> >
> >> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> >> >> > /opt/homebrew/lib/libparquet.700.dylib:
> >> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
> (compatibility
> >> >> > version 700.0.0, current version 700.0.0)
> >> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
> >> version
> >> >> > 700.0.0)
> >> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
> >> >> version
> >> >> > 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
> >> >> version
> >> >> > 1.1.0, current version 1.1.0)
> >> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
> (compatibility
> >> >> > version 1.1.0, current version 1.1.0)
> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
> >> version
> >> >> > 1.0.0, current version 1.0.9)
> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
> >> version
> >> >> > 1.0.0, current version 1.0.9)
> >> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
> >> >> version
> >> >> > 1.0.0, current version 1.0.9)
> >> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
> >> >> version
> >> >> > 31.0.0, current version 31.4.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >
> >> >>
> >>
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> >
> >> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> >> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
> >> (compatibility
> >> >> > version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
> >> (compatibility
> >> >> > version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
> >> >> (compatibility
> >> >> > version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
> (compatibility
> >> >> > version 0.0.0, current version 0.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
> >> >> (compatibility
> >> >> > version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
> >> >> (compatibility
> >> >> > version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
> >> >> (compatibility
> >> >> > version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
> >> (compatibility
> >> >> > version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> >> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
> >> (compatibility
> >> >> > version 0.0.0, current version 1.0.0)
> >> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
> >> (compatibility
> >> >> > version 1.0.0, current version 1.0.0)
> >> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> >> version
> >> >> > 1311.0.0)
> >> >> >
> >> >>
> >>
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> >> >> > (compatibility version 150.0.0, current version 1856.105.0)
> >> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
> >> >> > (compatibility version 1.0.0, current version 60157.60.19)
> >> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
> >> version
> >> >> > 2.0.0, current version 2.5.0)
> >> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
> 9.0.0,
> >> >> > current version 9.0.0)
> >> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
> version
> >> >> > 1200.3.0)
> >> >> >
> >> >> > The strange thing is that if I change this to
> >> >> >
> >> >> > require 'arrow'
> >> >> >
> >> >> > It works correctly. So for some reason it is able to find the Arrow
> >> >> > library, but not the Parquet library. What is causing the
> difference?
> >> >> >
> >> >> > Thanks
> >> >> > /Sten
> >> >>
>


-- 
<https://www.burt.ai/>
Sten Larsson | Senior Software Engineer
+46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

> I disabled SIP, but unfortunately dtrace didn't give anything useful.
> 
> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> dtrace: no probes specified

Sorry... I told wrong command. We should use dtruss not
dtrace.

Could you try the following?

  $ sudo dtruss $(rbenv which ruby) arrow-test.rb


Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022 09:58:47 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi kou
> 
> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't have
> any effect, so this command now works!
> 
>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib" \
>       $(rbenv which ruby) arrow-test.rb
> 
> (It doesn't print anything since the script doesn't actually do anything.)
> 
> I disabled SIP, but unfortunately dtrace didn't give anything useful.
> 
> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> dtrace: no probes specified
> 
> I have not used dtrace before so I don't know what probes I should specify,
> sorry.
> 
> Thanks
> /Sten
> 
> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
> 
>> Hi,
>>
>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >     ruby arrow-test.rb
>>
>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>> to a subprocess on macOS for security reason.
>>
>> Could you try the following?
>>
>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>       $(rbenv which ruby) arrow-test.rb
>>
>> If you can disable SIP (System Integrity Protection) on the
>> machine, could you provide dtrace log?
>>
>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> 08:26:54 +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi kou
>> >
>> > Thanks for trying to help me with this
>> >
>> >
>> > 1. Yes
>> >
>> >
>> > 2. Note that I skipped the -r flag to get the result.
>> >
>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >   <namespace name="Arrow"
>> >              version="1.0"
>> >              shared-library="libarrow-glib.700.dylib"
>> >              c:identifier-prefixes="GArrow"
>> >              c:symbol-prefixes="garrow">
>> >
>> >
>> > 3. Same here
>> >
>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >   <namespace name="Parquet"
>> >              version="1.0"
>> >              shared-library="libparquet-glib.700.dylib"
>> >              c:identifier-prefixes="GParquet"
>> >              c:symbol-prefixes="gparquet">
>> >
>> >
>> > 4. No matches
>> >
>> > $ env | grep LIBRARY_PATH | sort
>> >
>> >
>> > 5. Nothing found
>> >
>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>> >
>> >
>> > 6. Nothing found
>> >
>> > $ ls /usr/lib/lib*-glib.*.dylib
>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>> >
>> >
>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>> >
>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib"
>> > ruby arrow-test.rb
>> > (null)-WARNING **: Failed to load shared library
>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> > 'libparquet-glib.700.dylib' (no such file),
>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> > '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> (no
>> > such file)
>> > [...]
>> >
>> > Unfortunately it is still a mystery.
>> >
>> > Thanks
>> > /Sten
>> >
>> >
>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> Could you tell the following?
>> >>
>> >> 1. Did you run the script in
>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>> >>
>> >> 2. The output of
>> >>    grep -r -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >>
>> >> 3. The output of
>> >>    grep -r -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >>
>> >> 4. The output of
>> >>    env | grep LIBRARY_PATH | sort
>> >>
>> >> 5. The output of
>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>> >>
>> >> 6. The output of
>> >>    ls /usr/lib/lib*-glib.*.dylib
>> >>
>> >> The following command line may resolve this:
>> >>
>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >>       ruby arrow-test.rb
>> >>
>> >> Thanks,
>> >> --
>> >> kou
>> >>
>> >> In <CA...@mail.gmail.com>
>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>> 10:34:52
>> >> +0200,
>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >>
>> >> > Hi
>> >> >
>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>> >> program
>> >> > simply consists of
>> >> >
>> >> > require 'parquet'
>> >> >
>> >> > This fails with
>> >> >
>> >> > $ ruby arrow-test.rb
>> >> > (null)-WARNING **: Failed to load shared library
>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >
>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> (no
>> >> > such file)
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> >> > `load_object_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> >> > `load_object_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> > `load_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> > `block (2 levels) in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> > `block (2 levels) in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `times'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `block in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> > `block in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> > `prepare_class'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> > `<module:Parquet>'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> > `<top (required)>'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `rescue in require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>> >> > (NameError)
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> > `load_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> > `block (2 levels) in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> > `block (2 levels) in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `times'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `block in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> > `block in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> > `prepare_class'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> > `<module:Parquet>'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> > `<top (required)>'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `rescue in require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> > `require': cannot load such file -- parquet (LoadError)
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >> > I have installed the apache-arrow-glib Homebrew package, but it seems
>> >> like
>> >> > it is looking for the library in the wrong place, because on M1 it is
>> >> > installed in /opt/homebrew. The libraries seems to be built correctly
>> as
>> >> > far as I can tell:
>> >> >
>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >
>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>> version
>> >> > 7001.0.0, current version 7001.3.0)
>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
>> >> > 7001.0.0, current version 7001.3.0)
>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> >> > 1200.3.0)
>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version
>> >> > 1311.0.0)
>> >> >
>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>> version
>> >> > 700.0.0)
>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>> >> version
>> >> > 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>> >> version
>> >> > 1.1.0, current version 1.1.0)
>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
>> >> > version 1.1.0, current version 1.1.0)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>> >> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>> >> version
>> >> > 31.0.0, current version 31.4.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >
>> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>> (compatibility
>> >> > version 1.0.0, current version 1.0.0)
>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version
>> >> > 1311.0.0)
>> >> >
>> >>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>> version
>> >> > 2.0.0, current version 2.5.0)
>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
>> >> > current version 9.0.0)
>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> >> > 1200.3.0)
>> >> >
>> >> > The strange thing is that if I change this to
>> >> >
>> >> > require 'arrow'
>> >> >
>> >> > It works correctly. So for some reason it is able to find the Arrow
>> >> > library, but not the Parquet library. What is causing the difference?
>> >> >
>> >> > Thanks
>> >> > /Sten
>> >>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Will Spurgin <wi...@stitchfix.com>.
Thanks Sten,

One other assumption to check, after the require 'arrow' which seemed to be
working, what is in $LOAD_PATH?

If it's indeed loading the `red-arrow` gem we should see it in the load
path.

On Thu, Apr 14, 2022 at 9:28 AM Sten Larsson <st...@burtcorp.com> wrote:

> Hi Will
>
> Yes, this seems to report the correct location:
>
> $ pkg-config --variable=libdir parquet-glib
> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib
>
> Thanks
> /Sten
>
> On Thu, 14 Apr 2022 at 16:18, Will Spurgin <wi...@stitchfix.com>
> wrote:
>
>> Hi Sten,
>>
>> Sorry read too fast (oof) and missed that you're on apple silicon.
>> Exporting DYLD_FALLBACK_LIBRARY_PATH as part of the ENV as kou suggested
>> is the best workaround.
>>
>> Just to check an assumption I have, does the native `pkg-config` return
>> the correct info about `parquet-glib` (namely, does it show the
>> /opt/homebrew) location?
>>
>> pkg-config --variable=libdir parquet-glib
>>
>> for me, that command returns (not on apple silicon)
>> /usr/local/Cellar/apache-arrow-glib/7.0.0/lib
>>
>> On Thu, Apr 14, 2022 at 8:42 AM Sten Larsson <st...@burtcorp.com> wrote:
>>
>>> Hi Will
>>>
>>> Thanks for your suggestion. Unfortunately `bundle doctor` did not
>>> mention this library, and `gem pristine red-parquet` did not resolve
>>> the issue.
>>>
>>> To be completely sure I removed the Ruby installation (with `rbenv
>>> uninstall 3.0.3`) and installed it again, but unfortunately I still get the
>>> same error.
>>>
>>> Thanks
>>> /Sten
>>>
>>> On Thu, 14 Apr 2022 at 14:02, Will Spurgin <wi...@stitchfix.com>
>>> wrote:
>>>
>>>> Usually that error comes from the extensions being built with one
>>>> version of the dynamic library, but then the library is upgraded or changed
>>>> (say by brew upgrade).
>>>>
>>>> If using Bundler, try `bundle doctor` (it gives more useful error info
>>>> for this specific situation). If it does say the library dependency
>>>> referenced is the issue, try rebuilding the gem
>>>>
>>>> `gem pristine parquet`
>>>>
>>>> On Thu, Apr 14, 2022, 02:59 Sten Larsson <st...@burtcorp.com> wrote:
>>>>
>>>>> Hi kou
>>>>>
>>>>> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>>>>> have any effect, so this command now works!
>>>>>
>>>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>>       $(rbenv which ruby) arrow-test.rb
>>>>>
>>>>> (It doesn't print anything since the script doesn't actually do
>>>>> anything.)
>>>>>
>>>>> I disabled SIP, but unfortunately dtrace didn't give anything useful.
>>>>>
>>>>> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>>> dtrace: no probes specified
>>>>>
>>>>> I have not used dtrace before so I don't know what probes I should
>>>>> specify, sorry.
>>>>>
>>>>> Thanks
>>>>> /Sten
>>>>>
>>>>> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>>> >     ruby arrow-test.rb
>>>>>>
>>>>>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>>>>>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>>>>>> to a subprocess on macOS for security reason.
>>>>>>
>>>>>> Could you try the following?
>>>>>>
>>>>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>>>       $(rbenv which ruby) arrow-test.rb
>>>>>>
>>>>>> If you can disable SIP (System Integrity Protection) on the
>>>>>> machine, could you provide dtrace log?
>>>>>>
>>>>>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> --
>>>>>> kou
>>>>>>
>>>>>> In <
>>>>>> CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com>
>>>>>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>>>>>> 08:26:54 +0200,
>>>>>>   Sten Larsson <st...@burtcorp.com> wrote:
>>>>>>
>>>>>> > Hi kou
>>>>>> >
>>>>>> > Thanks for trying to help me with this
>>>>>> >
>>>>>> >
>>>>>> > 1. Yes
>>>>>> >
>>>>>> >
>>>>>> > 2. Note that I skipped the -r flag to get the result.
>>>>>> >
>>>>>> > $ grep -A 4 '<namespace' $(brew
>>>>>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>>>> >   <namespace name="Arrow"
>>>>>> >              version="1.0"
>>>>>> >              shared-library="libarrow-glib.700.dylib"
>>>>>> >              c:identifier-prefixes="GArrow"
>>>>>> >              c:symbol-prefixes="garrow">
>>>>>> >
>>>>>> >
>>>>>> > 3. Same here
>>>>>> >
>>>>>> > $ grep -A 4 '<namespace' $(brew
>>>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>>>> >   <namespace name="Parquet"
>>>>>> >              version="1.0"
>>>>>> >              shared-library="libparquet-glib.700.dylib"
>>>>>> >              c:identifier-prefixes="GParquet"
>>>>>> >              c:symbol-prefixes="gparquet">
>>>>>> >
>>>>>> >
>>>>>> > 4. No matches
>>>>>> >
>>>>>> > $ env | grep LIBRARY_PATH | sort
>>>>>> >
>>>>>> >
>>>>>> > 5. Nothing found
>>>>>> >
>>>>>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>>>>>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>>>>>> >
>>>>>> >
>>>>>> > 6. Nothing found
>>>>>> >
>>>>>> > $ ls /usr/lib/lib*-glib.*.dylib
>>>>>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>>>>>> >
>>>>>> >
>>>>>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>>>>>> >
>>>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>>> --prefix)/lib:/usr/local/lib:/usr/lib"
>>>>>> > ruby arrow-test.rb
>>>>>> > (null)-WARNING **: Failed to load shared library
>>>>>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>>>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>>>> > 'libparquet-glib.700.dylib' (no such file),
>>>>>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>>>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>>>> >
>>>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
>>>>>> > such file)
>>>>>> > [...]
>>>>>> >
>>>>>> > Unfortunately it is still a mystery.
>>>>>> >
>>>>>> > Thanks
>>>>>> > /Sten
>>>>>> >
>>>>>> >
>>>>>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>>>>>> wrote:
>>>>>> >
>>>>>> >> Hi,
>>>>>> >>
>>>>>> >> Could you tell the following?
>>>>>> >>
>>>>>> >> 1. Did you run the script in
>>>>>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>>>>>> >>
>>>>>> >> 2. The output of
>>>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>>>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>>>> >>
>>>>>> >> 3. The output of
>>>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>>>> >>
>>>>>> >> 4. The output of
>>>>>> >>    env | grep LIBRARY_PATH | sort
>>>>>> >>
>>>>>> >> 5. The output of
>>>>>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>>>>>> >>
>>>>>> >> 6. The output of
>>>>>> >>    ls /usr/lib/lib*-glib.*.dylib
>>>>>> >>
>>>>>> >> The following command line may resolve this:
>>>>>> >>
>>>>>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>>> >>       ruby arrow-test.rb
>>>>>> >>
>>>>>> >> Thanks,
>>>>>> >> --
>>>>>> >> kou
>>>>>> >>
>>>>>> >> In <
>>>>>> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>>>>>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>>>>>> 10:34:52
>>>>>> >> +0200,
>>>>>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>>>>>> >>
>>>>>> >> > Hi
>>>>>> >> >
>>>>>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The
>>>>>> test
>>>>>> >> program
>>>>>> >> > simply consists of
>>>>>> >> >
>>>>>> >> > require 'parquet'
>>>>>> >> >
>>>>>> >> > This fails with
>>>>>> >> >
>>>>>> >> > $ ruby arrow-test.rb
>>>>>> >> > (null)-WARNING **: Failed to load shared library
>>>>>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>>>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>>>> >> > 'libparquet-glib.700.dylib' (no such file),
>>>>>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>>>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>>>> >> >
>>>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>>>>>> >> (no
>>>>>> >> > such file)
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>>>>>> >> > `load_object_info'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>>>>>> >> > `load_object_info'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>>>> >> > `load_info'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>>>> >> > `block (2 levels) in load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>>>> >> > `block (2 levels) in each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>>> >> > `times'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>>> >> > `block in each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>>> >> > `each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>>> >> > `each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>>>> >> > `block in load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>>>> >> > `prepare_class'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>>>> >> > `<module:Parquet>'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>>>> >> > `<top (required)>'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>>> >> > `require'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>>> >> > `rescue in require'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>>>> >> > `require'
>>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>>>>>> >> > `load_object_info': uninitialized constant
>>>>>> Parquet::ArrowFileReader
>>>>>> >> > (NameError)
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>>>> >> > `load_info'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>>>> >> > `block (2 levels) in load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>>>> >> > `block (2 levels) in each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>>> >> > `times'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>>> >> > `block in each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>>> >> > `each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>>> >> > `each'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>>>> >> > `block in load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>>>> >> > `prepare_class'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>>>> >> > `load'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>>>> >> > `<module:Parquet>'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>>>> >> > `<top (required)>'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>>> >> > `require'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>>> >> > `rescue in require'
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>>>> >> > `require'
>>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>>>> >> > `require': cannot load such file -- parquet (LoadError)
>>>>>> >> > from
>>>>>> >> >
>>>>>> >>
>>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>>>> >> > `require'
>>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>>> >> >
>>>>>> >> > I have installed the apache-arrow-glib Homebrew package, but it
>>>>>> seems
>>>>>> >> like
>>>>>> >> > it is looking for the library in the wrong place, because on M1
>>>>>> it is
>>>>>> >> > installed in /opt/homebrew. The libraries seems to be built
>>>>>> correctly as
>>>>>> >> > far as I can tell:
>>>>>> >> >
>>>>>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>>>>>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>>>>>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>>>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>>>> >> >
>>>>>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>>>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>>>>>> (compatibility
>>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>>>> (compatibility
>>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>>>>>> version
>>>>>> >> > 7001.0.0, current version 7001.3.0)
>>>>>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>>>>>> version
>>>>>> >> > 7001.0.0, current version 7001.3.0)
>>>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>>>> version
>>>>>> >> > 1200.3.0)
>>>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>>>> version
>>>>>> >> > 1311.0.0)
>>>>>> >> >
>>>>>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>>>>>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>>>> (compatibility
>>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0,
>>>>>> current version
>>>>>> >> > 700.0.0)
>>>>>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib
>>>>>> (compatibility
>>>>>> >> version
>>>>>> >> > 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
>>>>>> (compatibility
>>>>>> >> version
>>>>>> >> > 1.1.0, current version 1.1.0)
>>>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>>>>>> (compatibility
>>>>>> >> > version 1.1.0, current version 1.1.0)
>>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>>>>>> version
>>>>>> >> > 1.0.0, current version 1.0.9)
>>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>>>>>> version
>>>>>> >> > 1.0.0, current version 1.0.9)
>>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
>>>>>> (compatibility
>>>>>> >> version
>>>>>> >> > 1.0.0, current version 1.0.9)
>>>>>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib
>>>>>> (compatibility
>>>>>> >> version
>>>>>> >> > 31.0.0, current version 31.4.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>>> >> >
>>>>>> >>
>>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>>> >> >
>>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>>>>>> (compatibility
>>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>>>>>> (compatibility
>>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>>>>>> >> (compatibility
>>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>>>>>> (compatibility
>>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>>>>>> >> (compatibility
>>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>>> >> >
>>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>>>>>> >> (compatibility
>>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>>>>>> >> (compatibility
>>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>>>>>> (compatibility
>>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>>> >> >
>>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>>>>>> (compatibility
>>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>>>>>> (compatibility
>>>>>> >> > version 1.0.0, current version 1.0.0)
>>>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>>>> version
>>>>>> >> > 1311.0.0)
>>>>>> >> >
>>>>>> >>
>>>>>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>>>>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>>>>>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>>>>>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>>>>>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib
>>>>>> (compatibility version
>>>>>> >> > 2.0.0, current version 2.5.0)
>>>>>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>>>>>> 9.0.0,
>>>>>> >> > current version 9.0.0)
>>>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>>>> version
>>>>>> >> > 1200.3.0)
>>>>>> >> >
>>>>>> >> > The strange thing is that if I change this to
>>>>>> >> >
>>>>>> >> > require 'arrow'
>>>>>> >> >
>>>>>> >> > It works correctly. So for some reason it is able to find the
>>>>>> Arrow
>>>>>> >> > library, but not the Parquet library. What is causing the
>>>>>> difference?
>>>>>> >> >
>>>>>> >> > Thanks
>>>>>> >> > /Sten
>>>>>> >>
>>>>>
>>>>>
>>>
>>
>> --
>> *Will Spurgin*
>> *Engineer, Erch *| Stitch Fix
>>
>> One Montgomery Tower Suite 1500
>> San Francisco, CA 94104
>>
>
>
> --
>
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.burt.ai_&d=DwMFaQ&c=WvG0b4OO_RKn2Vh2-dPugJnzhcJIUGi6W5c7NffLkfo&r=0tNblSyOezdAG_nSQ41PgYlnFqImhC27kLuRp0YZkiI&m=KCSo_h0GvE-GRA2kJUIqGdzQ0G7XxJRBqhwVk1WUFeG80UiMwpLkTSfuDsHzxaWm&s=ZHnek6BjRK_0YuLYP9c7VPUIe-ZFdMn8xG7cZf_7VAk&e=>
> Sten Larsson | Senior Software Engineer
> +46 730 41 92 07 | sten@burtcorp.com
>


-- 
*Will Spurgin*
*Engineer, Erch *| Stitch Fix

One Montgomery Tower Suite 1500
San Francisco, CA 94104

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi Will

Yes, this seems to report the correct location:

$ pkg-config --variable=libdir parquet-glib
/opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib

Thanks
/Sten

On Thu, 14 Apr 2022 at 16:18, Will Spurgin <wi...@stitchfix.com>
wrote:

> Hi Sten,
>
> Sorry read too fast (oof) and missed that you're on apple silicon.
> Exporting DYLD_FALLBACK_LIBRARY_PATH as part of the ENV as kou suggested
> is the best workaround.
>
> Just to check an assumption I have, does the native `pkg-config` return
> the correct info about `parquet-glib` (namely, does it show the
> /opt/homebrew) location?
>
> pkg-config --variable=libdir parquet-glib
>
> for me, that command returns (not on apple silicon)
> /usr/local/Cellar/apache-arrow-glib/7.0.0/lib
>
> On Thu, Apr 14, 2022 at 8:42 AM Sten Larsson <st...@burtcorp.com> wrote:
>
>> Hi Will
>>
>> Thanks for your suggestion. Unfortunately `bundle doctor` did not mention
>> this library, and `gem pristine red-parquet` did not resolve the issue.
>>
>> To be completely sure I removed the Ruby installation (with `rbenv
>> uninstall 3.0.3`) and installed it again, but unfortunately I still get the
>> same error.
>>
>> Thanks
>> /Sten
>>
>> On Thu, 14 Apr 2022 at 14:02, Will Spurgin <wi...@stitchfix.com>
>> wrote:
>>
>>> Usually that error comes from the extensions being built with one
>>> version of the dynamic library, but then the library is upgraded or changed
>>> (say by brew upgrade).
>>>
>>> If using Bundler, try `bundle doctor` (it gives more useful error info
>>> for this specific situation). If it does say the library dependency
>>> referenced is the issue, try rebuilding the gem
>>>
>>> `gem pristine parquet`
>>>
>>> On Thu, Apr 14, 2022, 02:59 Sten Larsson <st...@burtcorp.com> wrote:
>>>
>>>> Hi kou
>>>>
>>>> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>>>> have any effect, so this command now works!
>>>>
>>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>       $(rbenv which ruby) arrow-test.rb
>>>>
>>>> (It doesn't print anything since the script doesn't actually do
>>>> anything.)
>>>>
>>>> I disabled SIP, but unfortunately dtrace didn't give anything useful.
>>>>
>>>> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>> dtrace: no probes specified
>>>>
>>>> I have not used dtrace before so I don't know what probes I should
>>>> specify, sorry.
>>>>
>>>> Thanks
>>>> /Sten
>>>>
>>>> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>> >     ruby arrow-test.rb
>>>>>
>>>>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>>>>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>>>>> to a subprocess on macOS for security reason.
>>>>>
>>>>> Could you try the following?
>>>>>
>>>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>>       $(rbenv which ruby) arrow-test.rb
>>>>>
>>>>> If you can disable SIP (System Integrity Protection) on the
>>>>> machine, could you provide dtrace log?
>>>>>
>>>>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>>>
>>>>>
>>>>> Thanks,
>>>>> --
>>>>> kou
>>>>>
>>>>> In <CA+EBNmE0tpXKNapaxMeqjwPPi8Qi8ubmQi1M-yG6FOQWcP4ZiQ@mail.gmail.com
>>>>> >
>>>>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>>>>> 08:26:54 +0200,
>>>>>   Sten Larsson <st...@burtcorp.com> wrote:
>>>>>
>>>>> > Hi kou
>>>>> >
>>>>> > Thanks for trying to help me with this
>>>>> >
>>>>> >
>>>>> > 1. Yes
>>>>> >
>>>>> >
>>>>> > 2. Note that I skipped the -r flag to get the result.
>>>>> >
>>>>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>>> >   <namespace name="Arrow"
>>>>> >              version="1.0"
>>>>> >              shared-library="libarrow-glib.700.dylib"
>>>>> >              c:identifier-prefixes="GArrow"
>>>>> >              c:symbol-prefixes="garrow">
>>>>> >
>>>>> >
>>>>> > 3. Same here
>>>>> >
>>>>> > $ grep -A 4 '<namespace' $(brew
>>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>>> >   <namespace name="Parquet"
>>>>> >              version="1.0"
>>>>> >              shared-library="libparquet-glib.700.dylib"
>>>>> >              c:identifier-prefixes="GParquet"
>>>>> >              c:symbol-prefixes="gparquet">
>>>>> >
>>>>> >
>>>>> > 4. No matches
>>>>> >
>>>>> > $ env | grep LIBRARY_PATH | sort
>>>>> >
>>>>> >
>>>>> > 5. Nothing found
>>>>> >
>>>>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>>>>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>>>>> >
>>>>> >
>>>>> > 6. Nothing found
>>>>> >
>>>>> > $ ls /usr/lib/lib*-glib.*.dylib
>>>>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>>>>> >
>>>>> >
>>>>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>>>>> >
>>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>> --prefix)/lib:/usr/local/lib:/usr/lib"
>>>>> > ruby arrow-test.rb
>>>>> > (null)-WARNING **: Failed to load shared library
>>>>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>>> > 'libparquet-glib.700.dylib' (no such file),
>>>>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>>> >
>>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
>>>>> > such file)
>>>>> > [...]
>>>>> >
>>>>> > Unfortunately it is still a mystery.
>>>>> >
>>>>> > Thanks
>>>>> > /Sten
>>>>> >
>>>>> >
>>>>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>>>>> wrote:
>>>>> >
>>>>> >> Hi,
>>>>> >>
>>>>> >> Could you tell the following?
>>>>> >>
>>>>> >> 1. Did you run the script in
>>>>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>>>>> >>
>>>>> >> 2. The output of
>>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>>> >>
>>>>> >> 3. The output of
>>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>>> >>
>>>>> >> 4. The output of
>>>>> >>    env | grep LIBRARY_PATH | sort
>>>>> >>
>>>>> >> 5. The output of
>>>>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>>>>> >>
>>>>> >> 6. The output of
>>>>> >>    ls /usr/lib/lib*-glib.*.dylib
>>>>> >>
>>>>> >> The following command line may resolve this:
>>>>> >>
>>>>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>> >>       ruby arrow-test.rb
>>>>> >>
>>>>> >> Thanks,
>>>>> >> --
>>>>> >> kou
>>>>> >>
>>>>> >> In <
>>>>> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>>>>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>>>>> 10:34:52
>>>>> >> +0200,
>>>>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>>>>> >>
>>>>> >> > Hi
>>>>> >> >
>>>>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>>>>> >> program
>>>>> >> > simply consists of
>>>>> >> >
>>>>> >> > require 'parquet'
>>>>> >> >
>>>>> >> > This fails with
>>>>> >> >
>>>>> >> > $ ruby arrow-test.rb
>>>>> >> > (null)-WARNING **: Failed to load shared library
>>>>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>>> >> > 'libparquet-glib.700.dylib' (no such file),
>>>>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>>> >> >
>>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>>>>> >> (no
>>>>> >> > such file)
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>>>>> >> > `load_object_info'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>>>>> >> > `load_object_info'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>>> >> > `load_info'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>>> >> > `block (2 levels) in load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>>> >> > `block (2 levels) in each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>> >> > `times'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>> >> > `block in each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>> >> > `each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>> >> > `each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>>> >> > `block in load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>>> >> > `prepare_class'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>>> >> > `<module:Parquet>'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>>> >> > `<top (required)>'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>> >> > `require'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>> >> > `rescue in require'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>>> >> > `require'
>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>>>>> >> > `load_object_info': uninitialized constant
>>>>> Parquet::ArrowFileReader
>>>>> >> > (NameError)
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>>> >> > `load_info'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>>> >> > `block (2 levels) in load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>>> >> > `block (2 levels) in each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>> >> > `times'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>>> >> > `block in each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>> >> > `each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>>> >> > `each'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>>> >> > `block in load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>>> >> > `prepare_class'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>>> >> > `load'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>>> >> > `<module:Parquet>'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>>> >> > `<top (required)>'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>> >> > `require'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>>> >> > `rescue in require'
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>>> >> > `require'
>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>>> >> > `require': cannot load such file -- parquet (LoadError)
>>>>> >> > from
>>>>> >> >
>>>>> >>
>>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>>> >> > `require'
>>>>> >> > from arrow-test.rb:1:in `<main>'
>>>>> >> >
>>>>> >> > I have installed the apache-arrow-glib Homebrew package, but it
>>>>> seems
>>>>> >> like
>>>>> >> > it is looking for the library in the wrong place, because on M1
>>>>> it is
>>>>> >> > installed in /opt/homebrew. The libraries seems to be built
>>>>> correctly as
>>>>> >> > far as I can tell:
>>>>> >> >
>>>>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>>>>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>>>>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>>> >> >
>>>>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>>>>> (compatibility
>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>>> (compatibility
>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>>>>> version
>>>>> >> > 7001.0.0, current version 7001.3.0)
>>>>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>>>>> version
>>>>> >> > 7001.0.0, current version 7001.3.0)
>>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>>> version
>>>>> >> > 1200.3.0)
>>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>>> version
>>>>> >> > 1311.0.0)
>>>>> >> >
>>>>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>>>>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>>> (compatibility
>>>>> >> > version 700.0.0, current version 700.0.0)
>>>>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>>>>> version
>>>>> >> > 700.0.0)
>>>>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>>>>> >> version
>>>>> >> > 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>>>>> >> version
>>>>> >> > 1.1.0, current version 1.1.0)
>>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>>>>> (compatibility
>>>>> >> > version 1.1.0, current version 1.1.0)
>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>>>>> version
>>>>> >> > 1.0.0, current version 1.0.9)
>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>>>>> version
>>>>> >> > 1.0.0, current version 1.0.9)
>>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib
>>>>> (compatibility
>>>>> >> version
>>>>> >> > 1.0.0, current version 1.0.9)
>>>>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>>>>> >> version
>>>>> >> > 31.0.0, current version 31.4.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>> >> >
>>>>> >>
>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>> >> >
>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>>>>> (compatibility
>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>>>>> (compatibility
>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>>>>> >> (compatibility
>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>>>>> (compatibility
>>>>> >> > version 0.0.0, current version 0.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>>>>> >> (compatibility
>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>> >> >
>>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>>>>> >> (compatibility
>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>>>>> >> (compatibility
>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>>>>> (compatibility
>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>>>>> (compatibility
>>>>> >> > version 0.0.0, current version 1.0.0)
>>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>>>>> (compatibility
>>>>> >> > version 1.0.0, current version 1.0.0)
>>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>>> version
>>>>> >> > 1311.0.0)
>>>>> >> >
>>>>> >>
>>>>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>>>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>>>>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>>>>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>>>>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>>>>> version
>>>>> >> > 2.0.0, current version 2.5.0)
>>>>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>>>>> 9.0.0,
>>>>> >> > current version 9.0.0)
>>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>>> version
>>>>> >> > 1200.3.0)
>>>>> >> >
>>>>> >> > The strange thing is that if I change this to
>>>>> >> >
>>>>> >> > require 'arrow'
>>>>> >> >
>>>>> >> > It works correctly. So for some reason it is able to find the
>>>>> Arrow
>>>>> >> > library, but not the Parquet library. What is causing the
>>>>> difference?
>>>>> >> >
>>>>> >> > Thanks
>>>>> >> > /Sten
>>>>> >>
>>>>
>>>>
>>
>
> --
> *Will Spurgin*
> *Engineer, Erch *| Stitch Fix
>
> One Montgomery Tower Suite 1500
> San Francisco, CA 94104
>


-- 
<https://www.burt.ai/>
Sten Larsson | Senior Software Engineer
+46 730 41 92 07 | sten@burtcorp.com

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Will Spurgin <wi...@stitchfix.com>.
Hi Sten,

Sorry read too fast (oof) and missed that you're on apple silicon.
Exporting DYLD_FALLBACK_LIBRARY_PATH as part of the ENV as kou suggested is
the best workaround.

Just to check an assumption I have, does the native `pkg-config` return the
correct info about `parquet-glib` (namely, does it show the /opt/homebrew)
location?

pkg-config --variable=libdir parquet-glib

for me, that command returns (not on apple silicon)
/usr/local/Cellar/apache-arrow-glib/7.0.0/lib

On Thu, Apr 14, 2022 at 8:42 AM Sten Larsson <st...@burtcorp.com> wrote:

> Hi Will
>
> Thanks for your suggestion. Unfortunately `bundle doctor` did not mention
> this library, and `gem pristine red-parquet` did not resolve the issue.
>
> To be completely sure I removed the Ruby installation (with `rbenv
> uninstall 3.0.3`) and installed it again, but unfortunately I still get the
> same error.
>
> Thanks
> /Sten
>
> On Thu, 14 Apr 2022 at 14:02, Will Spurgin <wi...@stitchfix.com>
> wrote:
>
>> Usually that error comes from the extensions being built with one version
>> of the dynamic library, but then the library is upgraded or changed (say by
>> brew upgrade).
>>
>> If using Bundler, try `bundle doctor` (it gives more useful error info
>> for this specific situation). If it does say the library dependency
>> referenced is the issue, try rebuilding the gem
>>
>> `gem pristine parquet`
>>
>> On Thu, Apr 14, 2022, 02:59 Sten Larsson <st...@burtcorp.com> wrote:
>>
>>> Hi kou
>>>
>>> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>>> have any effect, so this command now works!
>>>
>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>       $(rbenv which ruby) arrow-test.rb
>>>
>>> (It doesn't print anything since the script doesn't actually do
>>> anything.)
>>>
>>> I disabled SIP, but unfortunately dtrace didn't give anything useful.
>>>
>>> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>> dtrace: no probes specified
>>>
>>> I have not used dtrace before so I don't know what probes I should
>>> specify, sorry.
>>>
>>> Thanks
>>> /Sten
>>>
>>> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>> >     ruby arrow-test.rb
>>>>
>>>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>>>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>>>> to a subprocess on macOS for security reason.
>>>>
>>>> Could you try the following?
>>>>
>>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>>       $(rbenv which ruby) arrow-test.rb
>>>>
>>>> If you can disable SIP (System Integrity Protection) on the
>>>> machine, could you provide dtrace log?
>>>>
>>>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>>
>>>>
>>>> Thanks,
>>>> --
>>>> kou
>>>>
>>>> In <CA...@mail.gmail.com>
>>>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>>>> 08:26:54 +0200,
>>>>   Sten Larsson <st...@burtcorp.com> wrote:
>>>>
>>>> > Hi kou
>>>> >
>>>> > Thanks for trying to help me with this
>>>> >
>>>> >
>>>> > 1. Yes
>>>> >
>>>> >
>>>> > 2. Note that I skipped the -r flag to get the result.
>>>> >
>>>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>> >   <namespace name="Arrow"
>>>> >              version="1.0"
>>>> >              shared-library="libarrow-glib.700.dylib"
>>>> >              c:identifier-prefixes="GArrow"
>>>> >              c:symbol-prefixes="garrow">
>>>> >
>>>> >
>>>> > 3. Same here
>>>> >
>>>> > $ grep -A 4 '<namespace' $(brew
>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>> >   <namespace name="Parquet"
>>>> >              version="1.0"
>>>> >              shared-library="libparquet-glib.700.dylib"
>>>> >              c:identifier-prefixes="GParquet"
>>>> >              c:symbol-prefixes="gparquet">
>>>> >
>>>> >
>>>> > 4. No matches
>>>> >
>>>> > $ env | grep LIBRARY_PATH | sort
>>>> >
>>>> >
>>>> > 5. Nothing found
>>>> >
>>>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>>>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>>>> >
>>>> >
>>>> > 6. Nothing found
>>>> >
>>>> > $ ls /usr/lib/lib*-glib.*.dylib
>>>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>>>> >
>>>> >
>>>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>>>> >
>>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>> --prefix)/lib:/usr/local/lib:/usr/lib"
>>>> > ruby arrow-test.rb
>>>> > (null)-WARNING **: Failed to load shared library
>>>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>> > 'libparquet-glib.700.dylib' (no such file),
>>>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>> >
>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
>>>> > such file)
>>>> > [...]
>>>> >
>>>> > Unfortunately it is still a mystery.
>>>> >
>>>> > Thanks
>>>> > /Sten
>>>> >
>>>> >
>>>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com>
>>>> wrote:
>>>> >
>>>> >> Hi,
>>>> >>
>>>> >> Could you tell the following?
>>>> >>
>>>> >> 1. Did you run the script in
>>>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>>>> >>
>>>> >> 2. The output of
>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>>>> >>
>>>> >> 3. The output of
>>>> >>    grep -r -A 4 '<namespace' $(brew
>>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>>> >>
>>>> >> 4. The output of
>>>> >>    env | grep LIBRARY_PATH | sort
>>>> >>
>>>> >> 5. The output of
>>>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>>>> >>
>>>> >> 6. The output of
>>>> >>    ls /usr/lib/lib*-glib.*.dylib
>>>> >>
>>>> >> The following command line may resolve this:
>>>> >>
>>>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>> >>       ruby arrow-test.rb
>>>> >>
>>>> >> Thanks,
>>>> >> --
>>>> >> kou
>>>> >>
>>>> >> In <
>>>> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>>>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>>>> 10:34:52
>>>> >> +0200,
>>>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>>>> >>
>>>> >> > Hi
>>>> >> >
>>>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>>>> >> program
>>>> >> > simply consists of
>>>> >> >
>>>> >> > require 'parquet'
>>>> >> >
>>>> >> > This fails with
>>>> >> >
>>>> >> > $ ruby arrow-test.rb
>>>> >> > (null)-WARNING **: Failed to load shared library
>>>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>>> >> > 'libparquet-glib.700.dylib' (no such file),
>>>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>>> >> >
>>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>>>> >> (no
>>>> >> > such file)
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>>>> >> > `load_object_info'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>>>> >> > `load_object_info'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>> >> > `load_info'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>> >> > `block (2 levels) in load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>> >> > `block (2 levels) in each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>> >> > `times'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>> >> > `block in each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>> >> > `each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>> >> > `each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>> >> > `block in load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>> >> > `prepare_class'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>> >> > `<module:Parquet>'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>> >> > `<top (required)>'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>> >> > `require'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>> >> > `rescue in require'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>> >> > `require'
>>>> >> > from arrow-test.rb:1:in `<main>'
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>>>> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>>>> >> > (NameError)
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>>> >> > `load_info'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>>> >> > `block (2 levels) in load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>>> >> > `block (2 levels) in each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>> >> > `times'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>>> >> > `block in each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>> >> > `each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>>> >> > `each'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>>> >> > `block in load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>>> >> > `prepare_class'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>>> >> > `load'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>>> >> > `<module:Parquet>'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>>> >> > `<top (required)>'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>> >> > `require'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>>> >> > `rescue in require'
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>>> >> > `require'
>>>> >> > from arrow-test.rb:1:in `<main>'
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>> >> > `require': cannot load such file -- parquet (LoadError)
>>>> >> > from
>>>> >> >
>>>> >>
>>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>>> >> > `require'
>>>> >> > from arrow-test.rb:1:in `<main>'
>>>> >> >
>>>> >> > I have installed the apache-arrow-glib Homebrew package, but it
>>>> seems
>>>> >> like
>>>> >> > it is looking for the library in the wrong place, because on M1 it
>>>> is
>>>> >> > installed in /opt/homebrew. The libraries seems to be built
>>>> correctly as
>>>> >> > far as I can tell:
>>>> >> >
>>>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>>>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>>>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>> >> >
>>>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib
>>>> (compatibility
>>>> >> > version 700.0.0, current version 700.0.0)
>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>> (compatibility
>>>> >> > version 700.0.0, current version 700.0.0)
>>>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>>>> version
>>>> >> > 7001.0.0, current version 7001.3.0)
>>>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>>>> version
>>>> >> > 7001.0.0, current version 7001.3.0)
>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>> version
>>>> >> > 1200.3.0)
>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>> version
>>>> >> > 1311.0.0)
>>>> >> >
>>>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>>>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>>> (compatibility
>>>> >> > version 700.0.0, current version 700.0.0)
>>>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>>>> version
>>>> >> > 700.0.0)
>>>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>>>> >> version
>>>> >> > 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>>>> >> version
>>>> >> > 1.1.0, current version 1.1.0)
>>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>>>> (compatibility
>>>> >> > version 1.1.0, current version 1.1.0)
>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>>>> version
>>>> >> > 1.0.0, current version 1.0.9)
>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>>>> version
>>>> >> > 1.0.0, current version 1.0.9)
>>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>>>> >> version
>>>> >> > 1.0.0, current version 1.0.9)
>>>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>>>> >> version
>>>> >> > 31.0.0, current version 31.4.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>> >> >
>>>> >>
>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>> >> >
>>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>>>> (compatibility
>>>> >> > version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>>>> (compatibility
>>>> >> > version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>>>> >> (compatibility
>>>> >> > version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>>>> (compatibility
>>>> >> > version 0.0.0, current version 0.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>>>> >> (compatibility
>>>> >> > version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>>>> >> (compatibility
>>>> >> > version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>>>> >> (compatibility
>>>> >> > version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>>>> (compatibility
>>>> >> > version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>>>> (compatibility
>>>> >> > version 0.0.0, current version 1.0.0)
>>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>>>> (compatibility
>>>> >> > version 1.0.0, current version 1.0.0)
>>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>> version
>>>> >> > 1311.0.0)
>>>> >> >
>>>> >>
>>>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>>>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>>>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>>>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>>>> version
>>>> >> > 2.0.0, current version 2.5.0)
>>>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>>>> 9.0.0,
>>>> >> > current version 9.0.0)
>>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>>> version
>>>> >> > 1200.3.0)
>>>> >> >
>>>> >> > The strange thing is that if I change this to
>>>> >> >
>>>> >> > require 'arrow'
>>>> >> >
>>>> >> > It works correctly. So for some reason it is able to find the Arrow
>>>> >> > library, but not the Parquet library. What is causing the
>>>> difference?
>>>> >> >
>>>> >> > Thanks
>>>> >> > /Sten
>>>> >>
>>>
>>>
>

-- 
*Will Spurgin*
*Engineer, Erch *| Stitch Fix

One Montgomery Tower Suite 1500
San Francisco, CA 94104

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi Will

Thanks for your suggestion. Unfortunately `bundle doctor` did not mention
this library, and `gem pristine red-parquet` did not resolve the issue.

To be completely sure I removed the Ruby installation (with `rbenv
uninstall 3.0.3`) and installed it again, but unfortunately I still get the
same error.

Thanks
/Sten

On Thu, 14 Apr 2022 at 14:02, Will Spurgin <wi...@stitchfix.com>
wrote:

> Usually that error comes from the extensions being built with one version
> of the dynamic library, but then the library is upgraded or changed (say by
> brew upgrade).
>
> If using Bundler, try `bundle doctor` (it gives more useful error info for
> this specific situation). If it does say the library dependency referenced
> is the issue, try rebuilding the gem
>
> `gem pristine parquet`
>
> On Thu, Apr 14, 2022, 02:59 Sten Larsson <st...@burtcorp.com> wrote:
>
>> Hi kou
>>
>> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't
>> have any effect, so this command now works!
>>
>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>       $(rbenv which ruby) arrow-test.rb
>>
>> (It doesn't print anything since the script doesn't actually do anything.)
>>
>> I disabled SIP, but unfortunately dtrace didn't give anything useful.
>>
>> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>> dtrace: no probes specified
>>
>> I have not used dtrace before so I don't know what probes I should
>> specify, sorry.
>>
>> Thanks
>> /Sten
>>
>> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>>
>>> Hi,
>>>
>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>> >     ruby arrow-test.rb
>>>
>>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>>> to a subprocess on macOS for security reason.
>>>
>>> Could you try the following?
>>>
>>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>>       $(rbenv which ruby) arrow-test.rb
>>>
>>> If you can disable SIP (System Integrity Protection) on the
>>> machine, could you provide dtrace log?
>>>
>>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>>
>>>
>>> Thanks,
>>> --
>>> kou
>>>
>>> In <CA...@mail.gmail.com>
>>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>>> 08:26:54 +0200,
>>>   Sten Larsson <st...@burtcorp.com> wrote:
>>>
>>> > Hi kou
>>> >
>>> > Thanks for trying to help me with this
>>> >
>>> >
>>> > 1. Yes
>>> >
>>> >
>>> > 2. Note that I skipped the -r flag to get the result.
>>> >
>>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>>> >   <namespace name="Arrow"
>>> >              version="1.0"
>>> >              shared-library="libarrow-glib.700.dylib"
>>> >              c:identifier-prefixes="GArrow"
>>> >              c:symbol-prefixes="garrow">
>>> >
>>> >
>>> > 3. Same here
>>> >
>>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>>> >   <namespace name="Parquet"
>>> >              version="1.0"
>>> >              shared-library="libparquet-glib.700.dylib"
>>> >              c:identifier-prefixes="GParquet"
>>> >              c:symbol-prefixes="gparquet">
>>> >
>>> >
>>> > 4. No matches
>>> >
>>> > $ env | grep LIBRARY_PATH | sort
>>> >
>>> >
>>> > 5. Nothing found
>>> >
>>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>>> >
>>> >
>>> > 6. Nothing found
>>> >
>>> > $ ls /usr/lib/lib*-glib.*.dylib
>>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>>> >
>>> >
>>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>>> >
>>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>> --prefix)/lib:/usr/local/lib:/usr/lib"
>>> > ruby arrow-test.rb
>>> > (null)-WARNING **: Failed to load shared library
>>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>> > 'libparquet-glib.700.dylib' (no such file),
>>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>> >
>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
>>> > such file)
>>> > [...]
>>> >
>>> > Unfortunately it is still a mystery.
>>> >
>>> > Thanks
>>> > /Sten
>>> >
>>> >
>>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> Could you tell the following?
>>> >>
>>> >> 1. Did you run the script in
>>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>>> >>
>>> >> 2. The output of
>>> >>    grep -r -A 4 '<namespace' $(brew
>>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>>> >>
>>> >> 3. The output of
>>> >>    grep -r -A 4 '<namespace' $(brew
>>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>>> >>
>>> >> 4. The output of
>>> >>    env | grep LIBRARY_PATH | sort
>>> >>
>>> >> 5. The output of
>>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>>> >>
>>> >> 6. The output of
>>> >>    ls /usr/lib/lib*-glib.*.dylib
>>> >>
>>> >> The following command line may resolve this:
>>> >>
>>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>> >>       ruby arrow-test.rb
>>> >>
>>> >> Thanks,
>>> >> --
>>> >> kou
>>> >>
>>> >> In <
>>> CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com>
>>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>>> 10:34:52
>>> >> +0200,
>>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>>> >>
>>> >> > Hi
>>> >> >
>>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>>> >> program
>>> >> > simply consists of
>>> >> >
>>> >> > require 'parquet'
>>> >> >
>>> >> > This fails with
>>> >> >
>>> >> > $ ruby arrow-test.rb
>>> >> > (null)-WARNING **: Failed to load shared library
>>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>>> >> > 'libparquet-glib.700.dylib' (no such file),
>>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>>> >> >
>>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>>> >> (no
>>> >> > such file)
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>>> >> > `load_object_info'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>>> >> > `load_object_info'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>> >> > `load_info'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>> >> > `block (2 levels) in load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>> >> > `block (2 levels) in each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>> >> > `times'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>> >> > `block in each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>> >> > `each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>> >> > `each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>> >> > `block in load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>> >> > `prepare_class'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>> >> > `<module:Parquet>'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>> >> > `<top (required)>'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>> >> > `require'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>> >> > `rescue in require'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>> >> > `require'
>>> >> > from arrow-test.rb:1:in `<main>'
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>>> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>>> >> > (NameError)
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>>> >> > `load_info'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>>> >> > `block (2 levels) in load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>>> >> > `block (2 levels) in each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>> >> > `times'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>>> >> > `block in each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>> >> > `each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>>> >> > `each'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>>> >> > `block in load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>>> >> > `prepare_class'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>>> >> > `load'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>>> >> > `<module:Parquet>'
>>> >> > from
>>> >> >
>>> >>
>>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>>> >> > `<top (required)>'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>> >> > `require'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>>> >> > `rescue in require'
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>>> >> > `require'
>>> >> > from arrow-test.rb:1:in `<main>'
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>> >> > `require': cannot load such file -- parquet (LoadError)
>>> >> > from
>>> >> >
>>> >>
>>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>>> >> > `require'
>>> >> > from arrow-test.rb:1:in `<main>'
>>> >> >
>>> >> > I have installed the apache-arrow-glib Homebrew package, but it
>>> seems
>>> >> like
>>> >> > it is looking for the library in the wrong place, because on M1 it
>>> is
>>> >> > installed in /opt/homebrew. The libraries seems to be built
>>> correctly as
>>> >> > far as I can tell:
>>> >> >
>>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>> >> >
>>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>>> >> > (compatibility version 700.0.0, current version 700.0.0)
>>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
>>> >> > version 700.0.0, current version 700.0.0)
>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>> (compatibility
>>> >> > version 700.0.0, current version 700.0.0)
>>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>>> version
>>> >> > 7001.0.0, current version 7001.3.0)
>>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility
>>> version
>>> >> > 7001.0.0, current version 7001.3.0)
>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>> version
>>> >> > 1200.3.0)
>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>> version
>>> >> > 1311.0.0)
>>> >> >
>>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>>> (compatibility
>>> >> > version 700.0.0, current version 700.0.0)
>>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>>> version
>>> >> > 700.0.0)
>>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>>> >> version
>>> >> > 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>>> >> version
>>> >> > 1.1.0, current version 1.1.0)
>>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib
>>> (compatibility
>>> >> > version 1.1.0, current version 1.1.0)
>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>>> version
>>> >> > 1.0.0, current version 1.0.9)
>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>>> version
>>> >> > 1.0.0, current version 1.0.9)
>>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>>> >> version
>>> >> > 1.0.0, current version 1.0.9)
>>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>>> >> version
>>> >> > 31.0.0, current version 31.4.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>> >> >
>>> >>
>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>> >> >
>>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>>> >> > (compatibility version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>>> (compatibility
>>> >> > version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>>> (compatibility
>>> >> > version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>>> >> (compatibility
>>> >> > version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib
>>> (compatibility
>>> >> > version 0.0.0, current version 0.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>>> >> (compatibility
>>> >> > version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>>> >> (compatibility
>>> >> > version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>>> >> (compatibility
>>> >> > version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>>> (compatibility
>>> >> > version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>>> >> > (compatibility version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>>> (compatibility
>>> >> > version 0.0.0, current version 1.0.0)
>>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>>> (compatibility
>>> >> > version 1.0.0, current version 1.0.0)
>>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>> version
>>> >> > 1311.0.0)
>>> >> >
>>> >>
>>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>>> version
>>> >> > 2.0.0, current version 2.5.0)
>>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>>> 9.0.0,
>>> >> > current version 9.0.0)
>>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
>>> version
>>> >> > 1200.3.0)
>>> >> >
>>> >> > The strange thing is that if I change this to
>>> >> >
>>> >> > require 'arrow'
>>> >> >
>>> >> > It works correctly. So for some reason it is able to find the Arrow
>>> >> > library, but not the Parquet library. What is causing the
>>> difference?
>>> >> >
>>> >> > Thanks
>>> >> > /Sten
>>> >>
>>
>>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Will Spurgin <wi...@stitchfix.com>.
Usually that error comes from the extensions being built with one version
of the dynamic library, but then the library is upgraded or changed (say by
brew upgrade).

If using Bundler, try `bundle doctor` (it gives more useful error info for
this specific situation). If it does say the library dependency referenced
is the issue, try rebuilding the gem

`gem pristine parquet`

On Thu, Apr 14, 2022, 02:59 Sten Larsson <st...@burtcorp.com> wrote:

> Hi kou
>
> Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't have
> any effect, so this command now works!
>
>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib" \
>       $(rbenv which ruby) arrow-test.rb
>
> (It doesn't print anything since the script doesn't actually do anything.)
>
> I disabled SIP, but unfortunately dtrace didn't give anything useful.
>
> $ sudo dtrace $(rbenv which ruby) arrow-test.rb
> dtrace: no probes specified
>
> I have not used dtrace before so I don't know what probes I should
> specify, sorry.
>
> Thanks
> /Sten
>
> On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:
>
>> Hi,
>>
>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >     ruby arrow-test.rb
>>
>> Ah, I forgot that you use rbenv. rbenv runs ruby from
>> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
>> to a subprocess on macOS for security reason.
>>
>> Could you try the following?
>>
>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>       $(rbenv which ruby) arrow-test.rb
>>
>> If you can disable SIP (System Integrity Protection) on the
>> machine, could you provide dtrace log?
>>
>>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>>
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
>> 08:26:54 +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi kou
>> >
>> > Thanks for trying to help me with this
>> >
>> >
>> > 1. Yes
>> >
>> >
>> > 2. Note that I skipped the -r flag to get the result.
>> >
>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >   <namespace name="Arrow"
>> >              version="1.0"
>> >              shared-library="libarrow-glib.700.dylib"
>> >              c:identifier-prefixes="GArrow"
>> >              c:symbol-prefixes="garrow">
>> >
>> >
>> > 3. Same here
>> >
>> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >   <namespace name="Parquet"
>> >              version="1.0"
>> >              shared-library="libparquet-glib.700.dylib"
>> >              c:identifier-prefixes="GParquet"
>> >              c:symbol-prefixes="gparquet">
>> >
>> >
>> > 4. No matches
>> >
>> > $ env | grep LIBRARY_PATH | sort
>> >
>> >
>> > 5. Nothing found
>> >
>> > $ ls /usr/local/lib/lib*-glib.*.dylib
>> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
>> >
>> >
>> > 6. Nothing found
>> >
>> > $ ls /usr/lib/lib*-glib.*.dylib
>> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
>> >
>> >
>> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
>> >
>> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib"
>> > ruby arrow-test.rb
>> > (null)-WARNING **: Failed to load shared library
>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> > 'libparquet-glib.700.dylib' (no such file),
>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> > '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> (no
>> > such file)
>> > [...]
>> >
>> > Unfortunately it is still a mystery.
>> >
>> > Thanks
>> > /Sten
>> >
>> >
>> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> Could you tell the following?
>> >>
>> >> 1. Did you run the script in
>> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>> >>
>> >> 2. The output of
>> >>    grep -r -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Arrow-1.0.gir
>> >>
>> >> 3. The output of
>> >>    grep -r -A 4 '<namespace' $(brew
>> --prefix)/share/gir-1.0/Parquet-1.0.gir
>> >>
>> >> 4. The output of
>> >>    env | grep LIBRARY_PATH | sort
>> >>
>> >> 5. The output of
>> >>    ls /usr/local/lib/lib*-glib.*.dylib
>> >>
>> >> 6. The output of
>> >>    ls /usr/lib/lib*-glib.*.dylib
>> >>
>> >> The following command line may resolve this:
>> >>
>> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
>> >>       ruby arrow-test.rb
>> >>
>> >> Thanks,
>> >> --
>> >> kou
>> >>
>> >> In <CA+EBNmFQgyJwRxrDLhD4QWBNHz0n3P-Cd_esSE1+b5Ctk3GVzQ@mail.gmail.com
>> >
>> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
>> 10:34:52
>> >> +0200,
>> >>   Sten Larsson <st...@burtcorp.com> wrote:
>> >>
>> >> > Hi
>> >> >
>> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>> >> program
>> >> > simply consists of
>> >> >
>> >> > require 'parquet'
>> >> >
>> >> > This fails with
>> >> >
>> >> > $ ruby arrow-test.rb
>> >> > (null)-WARNING **: Failed to load shared library
>> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> >> > 'libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> >> >
>> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> >> (no
>> >> > such file)
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> >> > `load_object_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> >> > `load_object_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> > `load_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> > `block (2 levels) in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> > `block (2 levels) in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `times'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `block in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> > `block in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> > `prepare_class'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> > `<module:Parquet>'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> > `<top (required)>'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `rescue in require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>> >> > (NameError)
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> >> > `load_info'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> >> > `block (2 levels) in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> >> > `block (2 levels) in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `times'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> >> > `block in each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> >> > `each'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> >> > `block in load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> >> > `prepare_class'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> >> > `load'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> >> > `<module:Parquet>'
>> >> > from
>> >> >
>> >>
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> >> > `<top (required)>'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> >> > `rescue in require'
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> > `require': cannot load such file -- parquet (LoadError)
>> >> > from
>> >> >
>> >>
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> >> > `require'
>> >> > from arrow-test.rb:1:in `<main>'
>> >> >
>> >> > I have installed the apache-arrow-glib Homebrew package, but it seems
>> >> like
>> >> > it is looking for the library in the wrong place, because on M1 it is
>> >> > installed in /opt/homebrew. The libraries seems to be built
>> correctly as
>> >> > far as I can tell:
>> >> >
>> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> >
>> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> >> > (compatibility version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
>> version
>> >> > 7001.0.0, current version 7001.3.0)
>> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
>> >> > 7001.0.0, current version 7001.3.0)
>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> >> > 1200.3.0)
>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version
>> >> > 1311.0.0)
>> >> >
>> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> >> > /opt/homebrew/lib/libparquet.700.dylib:
>> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib
>> (compatibility
>> >> > version 700.0.0, current version 700.0.0)
>> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
>> version
>> >> > 700.0.0)
>> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>> >> version
>> >> > 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>> >> version
>> >> > 1.1.0, current version 1.1.0)
>> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
>> >> > version 1.1.0, current version 1.1.0)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
>> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
>> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>> >> version
>> >> > 1.0.0, current version 1.0.9)
>> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>> >> version
>> >> > 31.0.0, current version 31.4.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >
>> >>
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> >> > (compatibility version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
>> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
>> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
>> >> > version 0.0.0, current version 0.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> >> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
>> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> >> > (compatibility version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
>> (compatibility
>> >> > version 0.0.0, current version 1.0.0)
>> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
>> (compatibility
>> >> > version 1.0.0, current version 1.0.0)
>> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version
>> >> > 1311.0.0)
>> >> >
>> >>
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> >> > (compatibility version 150.0.0, current version 1856.105.0)
>> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>> >> > (compatibility version 1.0.0, current version 60157.60.19)
>> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
>> version
>> >> > 2.0.0, current version 2.5.0)
>> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version
>> 9.0.0,
>> >> > current version 9.0.0)
>> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> >> > 1200.3.0)
>> >> >
>> >> > The strange thing is that if I change this to
>> >> >
>> >> > require 'arrow'
>> >> >
>> >> > It works correctly. So for some reason it is able to find the Arrow
>> >> > library, but not the Parquet library. What is causing the difference?
>> >> >
>> >> > Thanks
>> >> > /Sten
>> >>
>
>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi kou

Thanks, rbenv was indeed the reason DYLD_FALLBACK_LIBRARY_PATH didn't have
any effect, so this command now works!

  $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
--prefix)/lib:/usr/local/lib:/usr/lib" \
      $(rbenv which ruby) arrow-test.rb

(It doesn't print anything since the script doesn't actually do anything.)

I disabled SIP, but unfortunately dtrace didn't give anything useful.

$ sudo dtrace $(rbenv which ruby) arrow-test.rb
dtrace: no probes specified

I have not used dtrace before so I don't know what probes I should specify,
sorry.

Thanks
/Sten

On Thu, 14 Apr 2022 at 09:29, Sutou Kouhei <ko...@clear-code.com> wrote:

> Hi,
>
> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >     ruby arrow-test.rb
>
> Ah, I forgot that you use rbenv. rbenv runs ruby from
> a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
> to a subprocess on macOS for security reason.
>
> Could you try the following?
>
>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib" \
>       $(rbenv which ruby) arrow-test.rb
>
> If you can disable SIP (System Integrity Protection) on the
> machine, could you provide dtrace log?
>
>   $ sudo dtrace $(rbenv which ruby) arrow-test.rb
>
>
> Thanks,
> --
> kou
>
> In <CA...@mail.gmail.com>
>   "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022
> 08:26:54 +0200,
>   Sten Larsson <st...@burtcorp.com> wrote:
>
> > Hi kou
> >
> > Thanks for trying to help me with this
> >
> >
> > 1. Yes
> >
> >
> > 2. Note that I skipped the -r flag to get the result.
> >
> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
> >   <namespace name="Arrow"
> >              version="1.0"
> >              shared-library="libarrow-glib.700.dylib"
> >              c:identifier-prefixes="GArrow"
> >              c:symbol-prefixes="garrow">
> >
> >
> > 3. Same here
> >
> > $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
> >   <namespace name="Parquet"
> >              version="1.0"
> >              shared-library="libparquet-glib.700.dylib"
> >              c:identifier-prefixes="GParquet"
> >              c:symbol-prefixes="gparquet">
> >
> >
> > 4. No matches
> >
> > $ env | grep LIBRARY_PATH | sort
> >
> >
> > 5. Nothing found
> >
> > $ ls /usr/local/lib/lib*-glib.*.dylib
> > zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
> >
> >
> > 6. Nothing found
> >
> > $ ls /usr/lib/lib*-glib.*.dylib
> > zsh: no matches found: /usr/lib/lib*-glib.*.dylib
> >
> >
> > DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
> >
> > $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib"
> > ruby arrow-test.rb
> > (null)-WARNING **: Failed to load shared library
> > 'libparquet-glib.700.dylib' referenced by the typelib:
> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> > 'libparquet-glib.700.dylib' (no such file),
> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> > '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> (no
> > such file)
> > [...]
> >
> > Unfortunately it is still a mystery.
> >
> > Thanks
> > /Sten
> >
> >
> > On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:
> >
> >> Hi,
> >>
> >> Could you tell the following?
> >>
> >> 1. Did you run the script in
> >>    /Users/stenlarsson/Documents/src/arrow-test/ ?
> >>
> >> 2. The output of
> >>    grep -r -A 4 '<namespace' $(brew
> --prefix)/share/gir-1.0/Arrow-1.0.gir
> >>
> >> 3. The output of
> >>    grep -r -A 4 '<namespace' $(brew
> --prefix)/share/gir-1.0/Parquet-1.0.gir
> >>
> >> 4. The output of
> >>    env | grep LIBRARY_PATH | sort
> >>
> >> 5. The output of
> >>    ls /usr/local/lib/lib*-glib.*.dylib
> >>
> >> 6. The output of
> >>    ls /usr/lib/lib*-glib.*.dylib
> >>
> >> The following command line may resolve this:
> >>
> >>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> >> --prefix)/lib:/usr/local/lib:/usr/lib" \
> >>       ruby arrow-test.rb
> >>
> >> Thanks,
> >> --
> >> kou
> >>
> >> In <CA...@mail.gmail.com>
> >>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022
> 10:34:52
> >> +0200,
> >>   Sten Larsson <st...@burtcorp.com> wrote:
> >>
> >> > Hi
> >> >
> >> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
> >> program
> >> > simply consists of
> >> >
> >> > require 'parquet'
> >> >
> >> > This fails with
> >> >
> >> > $ ruby arrow-test.rb
> >> > (null)-WARNING **: Failed to load shared library
> >> > 'libparquet-glib.700.dylib' referenced by the typelib:
> >> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> >> > 'libparquet-glib.700.dylib' (no such file),
> >> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> >> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> >> >
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> >> (no
> >> > such file)
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> >> > `load_object_info'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> >> > `load_object_info'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> > `load_info'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> > `block (2 levels) in load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> > `block (2 levels) in each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> > `times'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> > `block in each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> > `each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> > `each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> > `block in load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> > `prepare_class'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> > `<module:Parquet>'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> > `<top (required)>'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> > `require'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> > `rescue in require'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> > `require'
> >> > from arrow-test.rb:1:in `<main>'
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> >> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
> >> > (NameError)
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> >> > `load_info'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> >> > `block (2 levels) in load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> >> > `block (2 levels) in each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> > `times'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> >> > `block in each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> > `each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> >> > `each'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> >> > `block in load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> >> > `prepare_class'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> >> > `load'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> >> > `<module:Parquet>'
> >> > from
> >> >
> >>
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> >> > `<top (required)>'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> > `require'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> >> > `rescue in require'
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> >> > `require'
> >> > from arrow-test.rb:1:in `<main>'
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> > `require': cannot load such file -- parquet (LoadError)
> >> > from
> >> >
> >>
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> >> > `require'
> >> > from arrow-test.rb:1:in `<main>'
> >> >
> >> > I have installed the apache-arrow-glib Homebrew package, but it seems
> >> like
> >> > it is looking for the library in the wrong place, because on M1 it is
> >> > installed in /opt/homebrew. The libraries seems to be built correctly
> as
> >> > far as I can tell:
> >> >
> >> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> >> > /opt/homebrew/lib/libparquet-glib.700.dylib:
> >> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> >
> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> >> > (compatibility version 700.0.0, current version 700.0.0)
> >> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
> >> > version 700.0.0, current version 700.0.0)
> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> >> > version 700.0.0, current version 700.0.0)
> >> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility
> version
> >> > 7001.0.0, current version 7001.3.0)
> >> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
> >> > 7001.0.0, current version 7001.3.0)
> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> >> > 1200.3.0)
> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version
> >> > 1311.0.0)
> >> >
> >> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> >> > /opt/homebrew/lib/libparquet.700.dylib:
> >> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> >> > version 700.0.0, current version 700.0.0)
> >> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current
> version
> >> > 700.0.0)
> >> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
> >> version
> >> > 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
> >> version
> >> > 1.1.0, current version 1.1.0)
> >> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
> >> > version 1.1.0, current version 1.1.0)
> >> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility
> version
> >> > 1.0.0, current version 1.0.9)
> >> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility
> version
> >> > 1.0.0, current version 1.0.9)
> >> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
> >> version
> >> > 1.0.0, current version 1.0.9)
> >> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
> >> version
> >> > 31.0.0, current version 31.4.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >
> >>
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> >> > (compatibility version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib
> (compatibility
> >> > version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib
> (compatibility
> >> > version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
> >> (compatibility
> >> > version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
> >> > version 0.0.0, current version 0.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
> >> (compatibility
> >> > version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
> >> (compatibility
> >> > version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
> >> (compatibility
> >> > version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib
> (compatibility
> >> > version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> >> > (compatibility version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib
> (compatibility
> >> > version 0.0.0, current version 1.0.0)
> >> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib
> (compatibility
> >> > version 1.0.0, current version 1.0.0)
> >> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version
> >> > 1311.0.0)
> >> >
> >>
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> >> > (compatibility version 150.0.0, current version 1856.105.0)
> >> > /System/Library/Frameworks/Security.framework/Versions/A/Security
> >> > (compatibility version 1.0.0, current version 60157.60.19)
> >> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility
> version
> >> > 2.0.0, current version 2.5.0)
> >> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
> >> > current version 9.0.0)
> >> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> >> > 1200.3.0)
> >> >
> >> > The strange thing is that if I change this to
> >> >
> >> > require 'arrow'
> >> >
> >> > It works correctly. So for some reason it is able to find the Arrow
> >> > library, but not the Parquet library. What is causing the difference?
> >> >
> >> > Thanks
> >> > /Sten
> >>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

> $ DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib" \
>     ruby arrow-test.rb

Ah, I forgot that you use rbenv. rbenv runs ruby from
a wrapper script. DYLD_FALLBACK_LIBRARY_PATH isn't inherited
to a subprocess on macOS for security reason.

Could you try the following?

  $ DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib" \
      $(rbenv which ruby) arrow-test.rb

If you can disable SIP (System Integrity Protection) on the
machine, could you provide dtrace log?

  $ sudo dtrace $(rbenv which ruby) arrow-test.rb


Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "Re: [Ruby] Cannot require 'parquet' on M1 Mac" on Thu, 14 Apr 2022 08:26:54 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi kou
> 
> Thanks for trying to help me with this
> 
> 
> 1. Yes
> 
> 
> 2. Note that I skipped the -r flag to get the result.
> 
> $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>   <namespace name="Arrow"
>              version="1.0"
>              shared-library="libarrow-glib.700.dylib"
>              c:identifier-prefixes="GArrow"
>              c:symbol-prefixes="garrow">
> 
> 
> 3. Same here
> 
> $ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>   <namespace name="Parquet"
>              version="1.0"
>              shared-library="libparquet-glib.700.dylib"
>              c:identifier-prefixes="GParquet"
>              c:symbol-prefixes="gparquet">
> 
> 
> 4. No matches
> 
> $ env | grep LIBRARY_PATH | sort
> 
> 
> 5. Nothing found
> 
> $ ls /usr/local/lib/lib*-glib.*.dylib
> zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib
> 
> 
> 6. Nothing found
> 
> $ ls /usr/lib/lib*-glib.*.dylib
> zsh: no matches found: /usr/lib/lib*-glib.*.dylib
> 
> 
> DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect
> 
> $ DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib"
> ruby arrow-test.rb
> (null)-WARNING **: Failed to load shared library
> 'libparquet-glib.700.dylib' referenced by the typelib:
> dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> 'libparquet-glib.700.dylib' (no such file),
> '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> '/usr/lib/libparquet-glib.700.dylib' (no such file),
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
> such file)
> [...]
> 
> Unfortunately it is still a mystery.
> 
> Thanks
> /Sten
> 
> 
> On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:
> 
>> Hi,
>>
>> Could you tell the following?
>>
>> 1. Did you run the script in
>>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>>
>> 2. The output of
>>    grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>>
>> 3. The output of
>>    grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>>
>> 4. The output of
>>    env | grep LIBRARY_PATH | sort
>>
>> 5. The output of
>>    ls /usr/local/lib/lib*-glib.*.dylib
>>
>> 6. The output of
>>    ls /usr/lib/lib*-glib.*.dylib
>>
>> The following command line may resolve this:
>>
>>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
>> --prefix)/lib:/usr/local/lib:/usr/lib" \
>>       ruby arrow-test.rb
>>
>> Thanks,
>> --
>> kou
>>
>> In <CA...@mail.gmail.com>
>>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022 10:34:52
>> +0200,
>>   Sten Larsson <st...@burtcorp.com> wrote:
>>
>> > Hi
>> >
>> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
>> program
>> > simply consists of
>> >
>> > require 'parquet'
>> >
>> > This fails with
>> >
>> > $ ruby arrow-test.rb
>> > (null)-WARNING **: Failed to load shared library
>> > 'libparquet-glib.700.dylib' referenced by the typelib:
>> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
>> > 'libparquet-glib.700.dylib' (no such file),
>> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
>> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
>> > '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
>> (no
>> > such file)
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
>> > `load_object_info'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
>> > `load_object_info'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> > `load_info'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> > `block (2 levels) in load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> > `block (2 levels) in each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> > `times'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> > `block in each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> > `each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> > `each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> > `block in load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> > `prepare_class'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> > `<module:Parquet>'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> > `<top (required)>'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> > `require'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> > `rescue in require'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> > `require'
>> > from arrow-test.rb:1:in `<main>'
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
>> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
>> > (NameError)
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
>> > `load_info'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
>> > `block (2 levels) in load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
>> > `block (2 levels) in each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> > `times'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
>> > `block in each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> > `each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
>> > `each'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
>> > `block in load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
>> > `prepare_class'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
>> > `load'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
>> > `<module:Parquet>'
>> > from
>> >
>> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
>> > `<top (required)>'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> > `require'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
>> > `rescue in require'
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
>> > `require'
>> > from arrow-test.rb:1:in `<main>'
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> > `require': cannot load such file -- parquet (LoadError)
>> > from
>> >
>> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
>> > `require'
>> > from arrow-test.rb:1:in `<main>'
>> >
>> > I have installed the apache-arrow-glib Homebrew package, but it seems
>> like
>> > it is looking for the library in the wrong place, because on M1 it is
>> > installed in /opt/homebrew. The libraries seems to be built correctly as
>> > far as I can tell:
>> >
>> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
>> > /opt/homebrew/lib/libparquet-glib.700.dylib:
>> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
>> > (compatibility version 700.0.0, current version 700.0.0)
>> > /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
>> > (compatibility version 700.0.0, current version 700.0.0)
>> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
>> > version 700.0.0, current version 700.0.0)
>> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
>> > version 700.0.0, current version 700.0.0)
>> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version
>> > 7001.0.0, current version 7001.3.0)
>> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
>> > 7001.0.0, current version 7001.3.0)
>> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> > 1200.3.0)
>> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
>> > 1311.0.0)
>> >
>> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
>> > /opt/homebrew/lib/libparquet.700.dylib:
>> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
>> > version 700.0.0, current version 700.0.0)
>> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current version
>> > 700.0.0)
>> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
>> version
>> > 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
>> version
>> > 1.1.0, current version 1.1.0)
>> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
>> > version 1.1.0, current version 1.1.0)
>> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility version
>> > 1.0.0, current version 1.0.9)
>> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility version
>> > 1.0.0, current version 1.0.9)
>> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
>> version
>> > 1.0.0, current version 1.0.9)
>> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
>> version
>> > 31.0.0, current version 31.4.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
>> > (compatibility version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
>> > (compatibility version 0.0.0, current version 0.0.0)
>> >
>> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
>> > (compatibility version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
>> > (compatibility version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib (compatibility
>> > version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib (compatibility
>> > version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
>> (compatibility
>> > version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
>> > version 0.0.0, current version 0.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
>> (compatibility
>> > version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
>> > (compatibility version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
>> > (compatibility version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
>> > (compatibility version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
>> (compatibility
>> > version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
>> (compatibility
>> > version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib (compatibility
>> > version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
>> > (compatibility version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib (compatibility
>> > version 0.0.0, current version 1.0.0)
>> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib (compatibility
>> > version 1.0.0, current version 1.0.0)
>> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
>> > 1311.0.0)
>> >
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>> > (compatibility version 150.0.0, current version 1856.105.0)
>> > /System/Library/Frameworks/Security.framework/Versions/A/Security
>> > (compatibility version 1.0.0, current version 60157.60.19)
>> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility version
>> > 2.0.0, current version 2.5.0)
>> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
>> > current version 9.0.0)
>> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
>> > 1200.3.0)
>> >
>> > The strange thing is that if I change this to
>> >
>> > require 'arrow'
>> >
>> > It works correctly. So for some reason it is able to find the Arrow
>> > library, but not the Parquet library. What is causing the difference?
>> >
>> > Thanks
>> > /Sten
>>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sten Larsson <st...@burtcorp.com>.
Hi kou

Thanks for trying to help me with this


1. Yes


2. Note that I skipped the -r flag to get the result.

$ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
  <namespace name="Arrow"
             version="1.0"
             shared-library="libarrow-glib.700.dylib"
             c:identifier-prefixes="GArrow"
             c:symbol-prefixes="garrow">


3. Same here

$ grep -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
  <namespace name="Parquet"
             version="1.0"
             shared-library="libparquet-glib.700.dylib"
             c:identifier-prefixes="GParquet"
             c:symbol-prefixes="gparquet">


4. No matches

$ env | grep LIBRARY_PATH | sort


5. Nothing found

$ ls /usr/local/lib/lib*-glib.*.dylib
zsh: no matches found: /usr/local/lib/lib*-glib.*.dylib


6. Nothing found

$ ls /usr/lib/lib*-glib.*.dylib
zsh: no matches found: /usr/lib/lib*-glib.*.dylib


DYLD_FALLBACK_LIBRARY_PATH doesn't seem to have any effect

$ DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib"
ruby arrow-test.rb
(null)-WARNING **: Failed to load shared library
'libparquet-glib.700.dylib' referenced by the typelib:
dlopen(libparquet-glib.700.dylib, 0x0009): tried:
'libparquet-glib.700.dylib' (no such file),
'/usr/local/lib/libparquet-glib.700.dylib' (no such file),
'/usr/lib/libparquet-glib.700.dylib' (no such file),
'/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
such file)
[...]

Unfortunately it is still a mystery.

Thanks
/Sten


On Wed, 13 Apr 2022 at 23:47, Sutou Kouhei <ko...@clear-code.com> wrote:

> Hi,
>
> Could you tell the following?
>
> 1. Did you run the script in
>    /Users/stenlarsson/Documents/src/arrow-test/ ?
>
> 2. The output of
>    grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir
>
> 3. The output of
>    grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir
>
> 4. The output of
>    env | grep LIBRARY_PATH | sort
>
> 5. The output of
>    ls /usr/local/lib/lib*-glib.*.dylib
>
> 6. The output of
>    ls /usr/lib/lib*-glib.*.dylib
>
> The following command line may resolve this:
>
>   $ DYLD_FALLBACK_LIBRARY_PATH="$(brew
> --prefix)/lib:/usr/local/lib:/usr/lib" \
>       ruby arrow-test.rb
>
> Thanks,
> --
> kou
>
> In <CA...@mail.gmail.com>
>   "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022 10:34:52
> +0200,
>   Sten Larsson <st...@burtcorp.com> wrote:
>
> > Hi
> >
> > I'm struggling to get Arrow working on my M1 MacBook Pro. The test
> program
> > simply consists of
> >
> > require 'parquet'
> >
> > This fails with
> >
> > $ ruby arrow-test.rb
> > (null)-WARNING **: Failed to load shared library
> > 'libparquet-glib.700.dylib' referenced by the typelib:
> > dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> > 'libparquet-glib.700.dylib' (no such file),
> > '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> > '/usr/lib/libparquet-glib.700.dylib' (no such file),
> > '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib'
> (no
> > such file)
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> > `load_object_info'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> > `load_object_info'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> > `load_info'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> > `block (2 levels) in load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> > `block (2 levels) in each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> > `times'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> > `block in each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> > `each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> > `each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> > `block in load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> > `prepare_class'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> > `<module:Parquet>'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> > `<top (required)>'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> > `require'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> > `rescue in require'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> > `require'
> > from arrow-test.rb:1:in `<main>'
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> > `load_object_info': uninitialized constant Parquet::ArrowFileReader
> > (NameError)
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> > `load_info'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> > `block (2 levels) in load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> > `block (2 levels) in each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> > `times'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> > `block in each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> > `each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> > `each'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> > `block in load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> > `prepare_class'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> > `load'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> > `<module:Parquet>'
> > from
> >
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> > `<top (required)>'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> > `require'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> > `rescue in require'
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> > `require'
> > from arrow-test.rb:1:in `<main>'
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> > `require': cannot load such file -- parquet (LoadError)
> > from
> >
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> > `require'
> > from arrow-test.rb:1:in `<main>'
> >
> > I have installed the apache-arrow-glib Homebrew package, but it seems
> like
> > it is looking for the library in the wrong place, because on M1 it is
> > installed in /opt/homebrew. The libraries seems to be built correctly as
> > far as I can tell:
> >
> > $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> > /opt/homebrew/lib/libparquet-glib.700.dylib:
> > /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> > (compatibility version 700.0.0, current version 700.0.0)
> > /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> > (compatibility version 700.0.0, current version 700.0.0)
> > /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
> > version 700.0.0, current version 700.0.0)
> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> > version 700.0.0, current version 700.0.0)
> > /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version
> > 7001.0.0, current version 7001.3.0)
> > /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
> > 7001.0.0, current version 7001.3.0)
> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> > 1200.3.0)
> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> > 1311.0.0)
> >
> > $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> > /opt/homebrew/lib/libparquet.700.dylib:
> > /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> > version 700.0.0, current version 700.0.0)
> > @rpath/libarrow.700.dylib (compatibility version 700.0.0, current version
> > 700.0.0)
> > /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility
> version
> > 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility
> version
> > 1.1.0, current version 1.1.0)
> > /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
> > version 1.1.0, current version 1.1.0)
> > /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility version
> > 1.0.0, current version 1.0.9)
> > /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility version
> > 1.0.0, current version 1.0.9)
> > /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility
> version
> > 1.0.0, current version 1.0.9)
> > /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility
> version
> > 31.0.0, current version 31.4.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> > (compatibility version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> > (compatibility version 0.0.0, current version 0.0.0)
> >
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> > (compatibility version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> > (compatibility version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib (compatibility
> > version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib (compatibility
> > version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib
> (compatibility
> > version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
> > version 0.0.0, current version 0.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib
> (compatibility
> > version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> > (compatibility version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> > (compatibility version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> > (compatibility version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib
> (compatibility
> > version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib
> (compatibility
> > version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib (compatibility
> > version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> > (compatibility version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib (compatibility
> > version 0.0.0, current version 1.0.0)
> > /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib (compatibility
> > version 1.0.0, current version 1.0.0)
> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> > 1311.0.0)
> >
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> > (compatibility version 150.0.0, current version 1856.105.0)
> > /System/Library/Frameworks/Security.framework/Versions/A/Security
> > (compatibility version 1.0.0, current version 60157.60.19)
> > /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility version
> > 2.0.0, current version 2.5.0)
> > /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
> > current version 9.0.0)
> > /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> > 1200.3.0)
> >
> > The strange thing is that if I change this to
> >
> > require 'arrow'
> >
> > It works correctly. So for some reason it is able to find the Arrow
> > library, but not the Parquet library. What is causing the difference?
> >
> > Thanks
> > /Sten
>

Re: [Ruby] Cannot require 'parquet' on M1 Mac

Posted by Sutou Kouhei <ko...@clear-code.com>.
Hi,

Could you tell the following?

1. Did you run the script in
   /Users/stenlarsson/Documents/src/arrow-test/ ?

2. The output of
   grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Arrow-1.0.gir

3. The output of
   grep -r -A 4 '<namespace' $(brew --prefix)/share/gir-1.0/Parquet-1.0.gir

4. The output of
   env | grep LIBRARY_PATH | sort

5. The output of
   ls /usr/local/lib/lib*-glib.*.dylib

6. The output of
   ls /usr/lib/lib*-glib.*.dylib

The following command line may resolve this:

  $ DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib" \
      ruby arrow-test.rb

Thanks,
-- 
kou

In <CA...@mail.gmail.com>
  "[Ruby] Cannot require 'parquet' on M1 Mac" on Wed, 13 Apr 2022 10:34:52 +0200,
  Sten Larsson <st...@burtcorp.com> wrote:

> Hi
> 
> I'm struggling to get Arrow working on my M1 MacBook Pro. The test program
> simply consists of
> 
> require 'parquet'
> 
> This fails with
> 
> $ ruby arrow-test.rb
> (null)-WARNING **: Failed to load shared library
> 'libparquet-glib.700.dylib' referenced by the typelib:
> dlopen(libparquet-glib.700.dylib, 0x0009): tried:
> 'libparquet-glib.700.dylib' (no such file),
> '/usr/local/lib/libparquet-glib.700.dylib' (no such file),
> '/usr/lib/libparquet-glib.700.dylib' (no such file),
> '/Users/stenlarsson/Documents/src/arrow-test/libparquet-glib.700.dylib' (no
> such file)
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:234:in
> `load_object_info'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:38:in
> `load_object_info'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> `load_info'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> `block (2 levels) in load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> `block (2 levels) in each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> `times'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> `block in each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> `each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> `each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> `block in load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> `prepare_class'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> `<module:Parquet>'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> `<top (required)>'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> `require'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> `rescue in require'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> `require'
> from arrow-test.rb:1:in `<main>'
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:40:in
> `load_object_info': uninitialized constant Parquet::ArrowFileReader
> (NameError)
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:73:in
> `load_info'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:47:in
> `block (2 levels) in load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:34:in
> `block (2 levels) in each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> `times'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:33:in
> `block in each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> `each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/repository.rb:32:in
> `each'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:46:in
> `block in load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:622:in
> `prepare_class'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:41:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/gobject-introspection-3.5.1/lib/gobject-introspection/loader.rb:25:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet/loader.rb:22:in
> `load'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:28:in
> `<module:Parquet>'
> from
> /Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/red-parquet-7.0.0/lib/parquet.rb:24:in
> `<top (required)>'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> `require'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in
> `rescue in require'
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in
> `require'
> from arrow-test.rb:1:in `<main>'
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> `require': cannot load such file -- parquet (LoadError)
> from
> <internal:/Users/stenlarsson/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
> `require'
> from arrow-test.rb:1:in `<main>'
> 
> I have installed the apache-arrow-glib Homebrew package, but it seems like
> it is looking for the library in the wrong place, because on M1 it is
> installed in /opt/homebrew. The libraries seems to be built correctly as
> far as I can tell:
> 
> $ otool -L /opt/homebrew/lib/libparquet-glib.700.dylib
> /opt/homebrew/lib/libparquet-glib.700.dylib:
> /opt/homebrew/opt/apache-arrow-glib/lib/libparquet-glib.700.dylib
> (compatibility version 700.0.0, current version 700.0.0)
> /opt/homebrew/Cellar/apache-arrow-glib/7.0.0/lib/libarrow-glib.700.dylib
> (compatibility version 700.0.0, current version 700.0.0)
> /opt/homebrew/opt/apache-arrow/lib/libarrow.700.dylib (compatibility
> version 700.0.0, current version 700.0.0)
> /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> version 700.0.0, current version 700.0.0)
> /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version
> 7001.0.0, current version 7001.3.0)
> /opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version
> 7001.0.0, current version 7001.3.0)
> /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> 1200.3.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 1311.0.0)
> 
> $ otool -L /opt/homebrew/lib/libparquet.700.dylib
> /opt/homebrew/lib/libparquet.700.dylib:
> /opt/homebrew/opt/apache-arrow/lib/libparquet.700.dylib (compatibility
> version 700.0.0, current version 700.0.0)
> @rpath/libarrow.700.dylib (compatibility version 700.0.0, current version
> 700.0.0)
> /opt/homebrew/opt/thrift/lib/libthrift-0.16.0.dylib (compatibility version
> 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version
> 1.1.0, current version 1.1.0)
> /opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility
> version 1.1.0, current version 1.1.0)
> /opt/homebrew/opt/brotli/lib/libbrotlienc.1.dylib (compatibility version
> 1.0.0, current version 1.0.9)
> /opt/homebrew/opt/brotli/lib/libbrotlidec.1.dylib (compatibility version
> 1.0.0, current version 1.0.9)
> /opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib (compatibility version
> 1.0.0, current version 1.0.9)
> /opt/homebrew/opt/protobuf/lib/libprotobuf.30.dylib (compatibility version
> 31.0.0, current version 31.4.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-config.dylib
> (compatibility version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-transfer.dylib
> (compatibility version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-identity-management.dylib
> (compatibility version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-cognito-identity.dylib
> (compatibility version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-sts.dylib (compatibility
> version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-s3.dylib (compatibility
> version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-cpp-sdk-core.dylib (compatibility
> version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-crt-cpp.dylib (compatibility
> version 0.0.0, current version 0.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-mqtt.1.0.0.dylib (compatibility
> version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-event-stream.1.0.0.dylib
> (compatibility version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-checksums.1.0.0.dylib
> (compatibility version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-s3.0unstable.dylib
> (compatibility version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-auth.1.0.0.dylib (compatibility
> version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-http.1.0.0.dylib (compatibility
> version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-io.1.0.0.dylib (compatibility
> version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-compression.1.0.0.dylib
> (compatibility version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-cal.1.0.0.dylib (compatibility
> version 0.0.0, current version 1.0.0)
> /opt/homebrew/opt/aws-sdk-cpp/lib/libaws-c-common.1.dylib (compatibility
> version 1.0.0, current version 1.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 1311.0.0)
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> (compatibility version 150.0.0, current version 1856.105.0)
> /System/Library/Frameworks/Security.framework/Versions/A/Security
> (compatibility version 1.0.0, current version 60157.60.19)
> /opt/homebrew/opt/utf8proc/lib/libutf8proc.2.dylib (compatibility version
> 2.0.0, current version 2.5.0)
> /opt/homebrew/opt/re2/lib/libre2.9.dylib (compatibility version 9.0.0,
> current version 9.0.0)
> /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> 1200.3.0)
> 
> The strange thing is that if I change this to
> 
> require 'arrow'
> 
> It works correctly. So for some reason it is able to find the Arrow
> library, but not the Parquet library. What is causing the difference?
> 
> Thanks
> /Sten