jnthn / spreadsheet-xlsx

Work with Excel (XLSX) spreadsheets in Raku.
15 stars 10 forks source link

Cannot locate native library 'libarchive.13.dylib': dlopen(libarchive.13.dylib, 10): image not found #9

Open schueani opened 3 years ago

schueani commented 3 years ago

When I tried to execute the sample program (please see the attachment), there was an error. Any suggestions ?

Operating system : macOS 11.1 Raku : Implementing the Raku(tm) programming language v6.d. Built on MoarVM version 2020.11. Attachment : test.raku.zip

Detailed error message :

Cannot locate native library 'libarchive.13.dylib': dlopen(libarchive.13.dylib, 10): image not found in method setup at /usr/local/Cellar/rakudo/2020.11/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298 in block archive_write_new at /usr/local/Cellar/rakudo/2020.11/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 587 in method open at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/943F7EBAA952F84315C9C926056C30402F72CA4E (Libarchive::Write) line 97 in method new at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/943F7EBAA952F84315C9C926056C30402F72CA4E (Libarchive::Write) line 87 in sub archive-write at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/5B41F2FD7CE055B9A8303A4E9DC8BABEACF6AA72 (Libarchive::Simple) line 7 in method to-blob at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/788A745784D5EA4EF68F82C35BF0689F82D90701 (Spreadsheet::XLSX) line 154 in method save at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/788A745784D5EA4EF68F82C35BF0689F82D90701 (Spreadsheet::XLSX) line 170 in method save at /usr/local/Cellar/rakudo/2020.11/share/perl6/site/sources/788A745784D5EA4EF68F82C35BF0689F82D90701 (Spreadsheet::XLSX) line 165 in block at test.raku line 27

jnthn commented 3 years ago

Looks like the libarchive native dependency is not installed. I'm not familiar with MacOS, but this may help.

schueani commented 3 years ago

Thank you. I will try and rely if that works.

Jonathan Worthington notifications@github.com於 2020年12月26日 週六,15:22寫道:

Looks like the libarchive native dependency is not installed. I'm not familiar with MacOS, but this https://formulae.brew.sh/formula/libarchive may help.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jnthn/spreadsheet-xlsx/issues/9#issuecomment-751361013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMX77YKWFRZ77Z2GF2V2IRLSWXWTHANCNFSM4VJWVIZQ .

schueani commented 3 years ago

I tried to reinstall my raku and install libarchive with homebrew. When I tried zef install Spreadsheet::XLSX, there was an error message (It seemed that libarchive was not being located.) :

===> Building: Archive::Libarchive::Raw:ver<0.1.0>
===> Building [OK] for Archive::Libarchive::Raw:ver<0.1.0>
===> Building: LibXML:ver<0.5.14>:auth<cpan:WARRINGD>
===> Building [OK] for LibXML:ver<0.5.14>:auth<cpan:WARRINGD>
===> Testing: Archive::Libarchive::Raw:ver<0.1.0>
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/02-list.rakutest line 8
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/03-extract.rakutest line 9
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/04-archive.rakutest line 8
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/05-archive-read-disk.rakutest line 11
===> Testing [FAIL]: Archive::Libarchive::Raw:ver<0.1.0>
Aborting due to test failure: Archive::Libarchive::Raw:ver<0.1.0> (use --force-test to override)

Any help ?

xerox51 commented 2 years ago

I meet the same problem.I have installed Spreadsheet::XLSX package successfully.After meet the problem,I have installed the libarchive by homebrew. My running environment is big sur operating system on m1 macbook pro.Does this problem is a bug?Anyone knows how to fix it or solve it?

xerox51 commented 2 years ago

I also find a big problem, this package could hardly installed on windows. because this package rely on Libarchive and LibXML.but LibXML rely on libxml2.dll.I have searched so many solutions.It's very hard to compile libxml2 source code and configure correctly on windows.I have tried so many times,It always say could not locate native library : libxml2 and can't find the xm2.dll document.

xerox51 commented 2 years ago

I tried to reinstall my raku and install libarchive with homebrew. When I tried zef install Spreadsheet::XLSX, there was an error message (It seemed that libarchive was not being located.) :

===> Building: Archive::Libarchive::Raw:ver<0.1.0>
===> Building [OK] for Archive::Libarchive::Raw:ver<0.1.0>
===> Building: LibXML:ver<0.5.14>:auth<cpan:WARRINGD>
===> Building [OK] for LibXML:ver<0.5.14>:auth<cpan:WARRINGD>
===> Testing: Archive::Libarchive::Raw:ver<0.1.0>
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/02-list.rakutest line 8
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/03-extract.rakutest line 9
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/04-archive.rakutest line 8
[Archive::Libarchive::Raw] Cannot locate native library '(null)': dlopen(libarchive.13.dylib, 10): image not found
[Archive::Libarchive::Raw]   in method setup at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Archive::Libarchive::Raw]   in block  at /Applications/Rakudo/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Archive::Libarchive::Raw]   in block <unit> at t/05-archive-read-disk.rakutest line 11
===> Testing [FAIL]: Archive::Libarchive::Raw:ver<0.1.0>
Aborting due to test failure: Archive::Libarchive::Raw:ver<0.1.0> (use --force-test to override)

Any help ?

Spreadsheet::XLSX rely on LibXML and Libarchive. you can install the Libarchive firstly. If you meet problem, you can use "zef install --force-fetch --force-build --force-test --force-install Libarchive" instruction to install it. Then you could install Spreadsheet::XLSX in the same way.

jnthn commented 2 years ago

My running environment is big sur operating system on m1 macbook pro.Does this problem is a bug?Anyone knows how to fix it or solve it?

I've no idea about MacOS, I'm afraid.

I also find a big problem, this package could hardly installed on windows. because this package rely on Libarchive and LibXML.but LibXML rely on libxml2.dll.I have searched so many solutions.It's very hard to compile libxml2 source code and configure correctly on windows.I have tried so many times,It always say could not locate native library : libxml2 and can't find the xm2.dll document.

Given the pain of compiling things on Windows, quite a few modules ship a pre-built DLL as a resource and install it (or host pre-built DLLs somewhere and just ship a hash to check the download source wasn't tampered with). I'm pretty sure the OpenSSL distribution does that, among others; you may look there for the approach taken (I think some effort is needed in the module to supply a correct location to the is native trait, in order that it can locate the DLL). If you do get LibXML installing on Windows, and have time to put together a PR for the module, that would probably be appreciated (at least, I've found the LibXML author receptive to PRs I've sent).

you can use "zef install --force-fetch --force-build --force-test --force-install Libarchive" instruction to install it

You can, but if the tests fail with dependency problems, I'm doubtful anything is going to work.

xerox51 commented 2 years ago

You can, but if the tests fail with dependency problems, I'm doubtful anything is going to work.

I used "zef -v info Libarchive" to find the dependency at first. I installed the denpendent package one by one. I installed Libarchive lastly.

I'm not a professional programmer, I'm just a noob for Raku. I have not learned software engineering knowledge systematically. I just have learned a little bit of C in campus and learned a little bit of Python after school. Occasionally, I write some simple code to solve some problem automatically. You see, many people have given up Perl5 and Raku. I hope Perl7 will survive and save the Perl eco-system in the future. You are an expert who can write module and distribute it for developer to use . Best wishes for you.

xerox51 commented 2 years ago

My running environment is big sur operating system on m1 macbook pro.Does this problem is a bug?Anyone knows how to fix it or solve it?

I've no idea about MacOS, I'm afraid.

I also find a big problem, this package could hardly installed on windows. because this package rely on Libarchive and LibXML.but LibXML rely on libxml2.dll.I have searched so many solutions.It's very hard to compile libxml2 source code and configure correctly on windows.I have tried so many times,It always say could not locate native library : libxml2 and can't find the xm2.dll document.

Given the pain of compiling things on Windows, quite a few modules ship a pre-built DLL as a resource and install it (or host pre-built DLLs somewhere and just ship a hash to check the download source wasn't tampered with). I'm pretty sure the OpenSSL distribution does that, among others; you may look there for the approach taken (I think some effort is needed in the module to supply a correct location to the is native trait, in order that it can locate the DLL). If you do get LibXML installing on Windows, and have time to put together a PR for the module, that would probably be appreciated (at least, I've found the LibXML author receptive to PRs I've sent).

you can use "zef install --force-fetch --force-build --force-test --force-install Libarchive" instruction to install it

You can, but if the tests fail with dependency problems, I'm doubtful anything is going to work.

Hi, buddy I have solved the 'Cannot locate native library 'libarchive.13.dylib when install the Libarchive' 'problem. but I found another strange thing. I used --force-test instruction to install LibXML( A module you write),it said build ok, test failed. but miracle happened, I use --force-test instruction to install Spreadsheet::XLSX, it build ok and test passed without continuing with force test. I can use Spreadsheet::XLSX normally now on mac OS. Thanks!