Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zef install test failures #234

Open
masukomi opened this issue Nov 22, 2022 · 5 comments
Open

zef install test failures #234

masukomi opened this issue Nov 22, 2022 · 5 comments

Comments

@masukomi
Copy link

masukomi commented Nov 22, 2022

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
Copy link
Author

@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
Copy link
Collaborator

rbt commented Nov 22, 2022

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
Copy link
Author

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 added a commit that referenced this issue Nov 23, 2022
Set the value to "<not set>" within the test description when a library cannot be found.

Not the cause of the problems in #234 but it adds unnecessary noise.
@rbt
Copy link
Collaborator

rbt commented Nov 23, 2022

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
Copy link
Contributor

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

  • Know the name of the library file on the local platform.
  • That the library it is in one of the places where the loader looks for it.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants