raku-community-modules / DBIish

Database interface for Raku
89 stars 31 forks source link

zef install test failures #234

Open masukomi opened 2 years ago

masukomi commented 2 years ago

There are multiple problems in the error trace below.

===> Testing: DBIish:ver<0.6.5>:auth<zef:raku-community-modules>:api<1>
[DBIish] Use of uninitialized value element of type Any in string context.
[DBIish] Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
[DBIish]   in block <unit> at t/03-lib-util.t line 16
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # Testing DBDish::mysql
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::mysql needs '', not found.
[DBIish] #  Detail: Cannot locate symbol 'mysql_init' in native library ''
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # Testing DBDish::Pg
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # DBIish: DBDish::Pg needs 'pq', not found.
[DBIish] #  Detail: Cannot locate native library 'pq': dlopen(pq, 0x000A): tried: '/usr/local/opt/llvm/lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), '/opt/homebrew/Cellar/rakudo-star/2022.07/bin/../lib/pq' (no such file), 'pq' (no such file), '/usr/local/lib/pq' (no such file), '/usr/lib/pq' (no such file), '/usr/local/opt/llvm/lib/pq' (no such file), '/Users/masukomi/.zef/store/DBIish.git/0880d805203c1ee5a0797373a55077d7423dc469/pq' (no such file)
[DBIish] # Can't continue.
[DBIish] # Testing DBDish::SQLite
[DBIish] # Testing DBDish::SQLite
[DBIish] # Testing DBDish::Oracle
===> Testing [FAIL]: DBIish:ver<0.6.5>:auth<zef:raku-community-modules>:api<1>
Aborting due to test failure: DBIish:ver<0.6.5>:auth<zef:raku-community-modules>:api<1> (use --force-test to override)

macOS: 12.6 Monterey

❯ rakudo --version
Welcome to Rakudo™ v2022.07.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.07.
masukomi commented 2 years ago

@lizmat asked

The DBIsh gist looks like it's not handling the absence of native libraries correctly. Is that what you're referring to? Or am I missing something else?

My thinking is this: Even if that's true, it's unlikely everyone's going to have every native library for all the DBs DBIish supports installed. DBIish shouldn't fail to install because I'm not a mySQL user.

It should test the libraries that can be tested, and not fail to install because it supports a lib for a DB the user isn't going to use.

rbt commented 2 years ago

While the missing libraries creates a lot of noise, the tests are skipped in those instances. In fact, it's the test spitting out the diagnostic messages while they're doing the skipping.

These lines, however, are not typical:

[DBIish] Use of uninitialized value element of type Any in string context.
[DBIish] Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
[DBIish]   in block <unit> at t/03-lib-util.t line 16

Can you please run that DBIish tests with verbose enabled: prove6 -v t/03-lib-util.t

masukomi commented 2 years ago

cloning the repo locally, and running prove6 -v t/03-lib-util.t as requested provides the results below.

note that i DO have PostgreSQL installed psql (PostgreSQL) 14.5 (Homebrew) but do not have mySQL installed, so I suspect that it's a Bad Thing ™ that the PostgreSQL test appears to be failing.

❯ prove6 -v t/03-lib-util.t
1..5
Use of uninitialized value element of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
ok 1 - Class Searcher exists
ok 2 - Class Loader exists
  in block <unit> at t/03-lib-util.t line 16
ok 3 - The object does role 'Callable'
ok 4 - Indeed mysqlclient # TODO Can fail if the mysqlclient library isn't installed
not ok 5 - Postgres is  # TODO Can fail if the pq library isn't installed
# Failed test 'Postgres is '
# at t/03-lib-util.t line 16
t/03-lib-util.t .. ok
All tests successful.

Test Summary Report
-------------------
Files=1, Tests=5,  0 wallclock secs
Result: PASS
rbt commented 2 years ago

Hmph, so that isn't the failing test. It's just unnecessarily noisy.

Can you run all the tests with verbose enabled? One of them must actually be failing, and not just complaining.

salortiz commented 2 years ago

In order for DBIish to be able to load any of the required libraries, it needs:

In MacOS there can be problems because the rules have changed frequently and Homebrew can use not standard names or places. So some tests can help us:

To get the library file name that will be used for PostgreSQL try the following in the raku REPL:

say $*VM.platform-library-name('pq'.IO, :version(Version.new(5))).Str;

By default the loader will search for that file in ~/lib, /usr/local/lib, and /usr/lib or in any path in the environment variables PATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH.

Check that your library has the expected name and it is installed in any of those places or add its path to one of these variables.