Missing @INC path for pkg-perl-autopkgtest
Roland Rosenfeld <[email protected]> Sat, 25 Oct 2025 15:03:22 +0200
| Newsgroups | gmane.linux.debian.devel.perl |
|---|---|
| Message-ID | <[email protected]> |
Hi,
in the chordpro perl package I have some problems with the
autopkgtest-pkg-perl testsuite, because the upstream maintainer places
several modules (only used in chordpro locally) below
/usr/share/perl5/ChordPro/lib.
In the consequence other modules, that use these modules fail while
running the autopkgtest-pkg-perl testsuite, because they cannot locate
these modules.
Currently I exclude all modules that run into this issue via
debian/tests/pkg-perl/syntax-skip, but with the upcoming beta release
of chordpro this list will be massively extended, which in consequence
means, that most modules are no longer checked by the test suite.
As a first workaround I run autopkgtest with
--env=3DPERL5LIB=3D/usr/sahre/perl5/ChordPro/lib
option, which solved the issue, but has to be done on every call of
autopkgtest, so it's not usable for automated testing.
My current workaround is to remove "Testsuite: autopkgtest-pkg-perl"
=66rom debian/control and replace it by debian/test/control with the
following content:
Test-Command: env PERL5LIB=3D/usr/share/perl5/ChordPro/lib /usr/share/pkg-p=
erl-autopkgtest/runner build-deps
Depends: @, @builddeps@, pkg-perl-autopkgtest
Restrictions: skippable
Features: test-name=3Dautodep8-perl-build-deps
Test-Command: /usr/share/pkg-perl-autopkgtest/runner runtime-deps
Depends: @, pkg-perl-autopkgtest
Restrictions: skippable, superficial
Features: test-name=3Dautodep8-perl
Test-Command: env PERL5LIB=3D/usr/share/perl5/ChordPro/lib /usr/share/pkg-p=
erl-autopkgtest/runner runtime-deps-and-recommends
Depends: @, @recommends@, pkg-perl-autopkgtest
Restrictions: skippable, superficial
Features: test-name=3Dautodep8-perl-recommends
This does exactly what I want, but has the disadvantage, that I have
to watch changes in /usr/share/autodep8/support/perl/detect and merge
them here manually, so this isn't a good solution.
What do you think about this problem? Does it make sense to extend
pkg-perl-tools/autopkgtest to honor some debian/test/pkg-perl/set-env
variable? While writing this, I noted, that there already exists
debian/tests/pkg-perl/smoke-env for this, but this is only used in the
build-deps test.
Would you accept a merge request for pkg-perl-tools, that reads
debian/tests/pkg-perl/syntax-env in
runtime-deps-and-recommends.d/syntax.t like this?
--- a/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t
+++ b/autopkgtest/scripts/runtime-deps-and-recommends.d/syntax.t
@@ -18,6 +18,22 @@ getopts('h', \%opts)
=20
usage(0) if $opts{h};
=20
+sub readandsetenv {
+ my $file =3D "debian/tests/pkg-perl/syntax-env";
+ -r $file or return ();
+ open (E, '<', $file)
+ or BAIL_OUT("$file exists but can't be read");
+ while (<E>) {
+ chomp;
+ if (/^(.+)=3D(.*)$/) {
+ $ENV{$1} =3D $2;
+ } else {
+ BAIL_OUT("syntax error in $file: $_");
+ }
+ }
+ close E;
+}
+
sub getpackages {
my @p;
my $c =3D "debian/control";
@@ -61,6 +77,8 @@ sub readfile {
return @ret;
}
=20
+readandsetenv();
+
my @packages =3D @ARGV ? @ARGV : getpackages();
=20
usage() if !@packages;
Awaiting your feedback about this idea
Roland