Open masukomi opened 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.
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
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
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.
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.
There are multiple problems in the error trace below.
macOS: 12.6 Monterey