Common test can't find NIF shared object library

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Common test can't find NIF shared object library

Bryan Hunt
I’m trying to resurrect an old library (epgpme) so I’ve added a rebar3 configuration using the ports compiler (pc) plugin.

It compiles the code fine and the nif is generated to 'priv/’ (which looks fine).

However, when I run the ct suite it’s looking for the nif in '_build/test/lib/egpgme/priv/’, so the tests fail.

I’ve messed around with a couple of configurations but can’t figure out the problem - can anyone offer a suggestion?


{erl_opts, [debug_info, warnings_as_errors]}.

%% Compile nif using port compiler plugin
{plugins, [pc,rebar3_hex]}.
{artifacts, ["priv/"]}.

{port_env, [
  {"CFLAGS", "$CFLAGS   -I/usr/local/include  "},
  {"LDFLAGS", "$LDFLAGS  -L/usr/local/lib -lgpgme"}

{port_specs, [{ "priv/", ["c_src/*.c"] }]}.

    {compile, {pc, compile}},
    {test, {pc, compile}},
    {clean, {pc, clean}}
/code/common/egpgme/ make test
===> Verifying dependencies...
===> Compiling egpgme
===> Verifying dependencies...
===> Compiling egpgme
===> Running Common Test suites...
%%% basic_SUITE: ....

=WARNING REPORT==== 20-Jul-2019::19:56:03 ===
The on_load function for module egpgme returned:
{error,{load_failed,"Failed to load NIF library: 'dlopen(/code/common/egpgme/_build/test/lib/egpgme/priv/, 2): image not found'"}}

%%% basic_SUITE ==> run_export: FAILED
%%% basic_SUITE ==> {undef,[{egpgme,context,[],[]},
%%% gpg_SUITE: ...................
EXPERIMENTAL: Writing retry specification at /code/common/egpgme/_build/test/logs/retry.spec
              call rebar3 ct with '--retry' to re-run failing cases.
Failed 1 tests. Passed 26 tests.
Results written to "/code/common/egpgme/_build/test/logs/index.html".
===> Failures occurred running tests: 1
make: *** [test] Error 1

find . -name "*.so"


Code Sync & Erlang Solutions Conferences

Code Elixir LDN
<> - London: 18
July 2019

Code BEAM Lite BD
<> - Budapest:
20 September 2019

Code BEAM Lite NYC
<> - NYC: 01
October 2019

RabbitMQ Summit
<> - London: 4
November 2019

Code Mesh LDN
<> - London: 7-8
November 2019

Code BEAM Lite India - Bangalore: 14 November 2019

BEAM Lite AMS <>
- Amsterdam: 29 November 2019

Lambda Days
<> - Kraków:
13-14 February 2020

Code BEAM SF - San Francisco: 5-6 March 2020

*Erlang Solutions cares about your data and privacy; please find all
details about the basis for communicating with you and the way we process
your data in our **Privacy Policy*
<>*.You can update your
email preferences or opt-out from receiving Marketing emails here
erlang-questions mailing list
[hidden email]