Closed ferki closed 7 years ago
I've managed to work around this by setting PERLLIB=$project_dir/lib/perl/lib/perl5/x86_64-linux
, which pushed the relevant dependency near the top of the list, so this is definitely down to the load order.
hi @ferki and @wiktor-b thanks for the report.
Before we change things with @INC
we need to write tests for it, so that we can be sure that we don't break other things.
@wiktor-b had a strange issue with a project which has
PerlRequire
s described inmeta.yml
, and those dependencies are installed viarexify --resolve-deps
into the projects locallib/perl
directory. Otherwise his setup relies on system perl on Gentoo.One of those dependency modules was also installed as part of the system setup, but with an older version than needed by the project, and rex failed to pick the one installed by the above rexify command.
By running
rex -e 'say join "\n", @INC'
, we saw that the system libraries are included before the local lib directory, which makes rex pick up the system perl, despite we expected that the newer one being used from the local lib (as described as part of the project).We think the projectd lib directory should always come before the system libs, probably by using
unshift
instead ofpush
inpush_lib_to_inc
inRex.pm
.ps.: there seems to be two coderefs pushed into
@INC
as well, which seems bogus, but we're unsure if it's related to the same issue or not.