• Bug#1053481: libdpkg-perl: dpkg-source fails to generate (complete) Tes

    From James McCoy@1:229/2 to Guillem Jover on Thu Oct 26 02:50:02 2023
    XPost: linux.debian.bugs.dist
    From: jamessan@debian.org

    On Thu, Oct 05, 2023 at 07:11:32AM +0200, Guillem Jover wrote:
    Right, nice catch! Given that these fields are based on what might
    appear on build dependencies, I think it does make sense to consider
    them an overlay on top of those. So I'll make them allow anything that
    is allowed for build dependencies.

    Would that just be the below patch?

    diff --git i/scripts/Dpkg/Deps/Simple.pm w/scripts/Dpkg/Deps/Simple.pm
    index 431c93bb9..da7aedbd8 100644
    --- i/scripts/Dpkg/Deps/Simple.pm
    +++ w/scripts/Dpkg/Deps/Simple.pm
    @@ -194,7 +194,6 @@ sub parse_string {
    \s*$ # trailing spaces at end
    }x;
    if (defined $2) {
    - return if $2 eq 'native' and not $self->{build_dep};
    $self->{archqual} = $2;
    }
    $self->{package} = $1;

    Cheers,
    --
    James
    GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From James McCoy@1:229/2 to Guillem Jover on Thu Oct 26 16:00:02 2023
    XPost: linux.debian.bugs.dist
    From: jamessan@debian.org

    On Thu, Oct 26, 2023 at 01:10:46PM +0200, Guillem Jover wrote:
    On Wed, 2023-10-25 at 20:44:26 -0400, James McCoy wrote:
    diff --git i/scripts/Dpkg/Deps/Simple.pm w/scripts/Dpkg/Deps/Simple.pm index 431c93bb9..da7aedbd8 100644
    --- i/scripts/Dpkg/Deps/Simple.pm
    +++ w/scripts/Dpkg/Deps/Simple.pm
    @@ -194,7 +194,6 @@ sub parse_string {
    \s*$ # trailing spaces at end
    }x;
    if (defined $2) {
    - return if $2 eq 'native' and not $self->{build_dep};
    $self->{archqual} = $2;
    }
    $self->{package} = $1;

    …this would remove the check for run-time dependencies. What I had in
    mind was something like the attached patch, which I'll queue once I've updated the test suite to cope or to add unit tests.

    Thanks! I'm looking to add a lot more arch-qualified test depends, so I appreciate the effort.

    Cheers,
    --
    James
    GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Guillem Jover@1:229/2 to James McCoy on Thu Oct 26 13:20:01 2023
    XPost: linux.debian.bugs.dist
    From: guillem@debian.org

    Hi!

    On Wed, 2023-10-25 at 20:44:26 -0400, James McCoy wrote:
    On Thu, Oct 05, 2023 at 07:11:32AM +0200, Guillem Jover wrote:
    Right, nice catch! Given that these fields are based on what might
    appear on build dependencies, I think it does make sense to consider
    them an overlay on top of those. So I'll make them allow anything that
    is allowed for build dependencies.

    Would that just be the below patch?

    Sorry, I started on this, but I think I might have misplaced the small
    change I had, in any case thanks for the patch! Although…

    diff --git i/scripts/Dpkg/Deps/Simple.pm w/scripts/Dpkg/Deps/Simple.pm
    index 431c93bb9..da7aedbd8 100644
    --- i/scripts/Dpkg/Deps/Simple.pm
    +++ w/scripts/Dpkg/Deps/Simple.pm
    @@ -194,7 +194,6 @@ sub parse_string {
    \s*$ # trailing spaces at end
    }x;
    if (defined $2) {
    - return if $2 eq 'native' and not $self->{build_dep};
    $self->{archqual} = $2;
    }
    $self->{package} = $1;

    …this would remove the check for run-time dependencies. What I had in
    mind was something like the attached patch, which I'll queue once I've
    updated the test suite to cope or to add unit tests.

    Thanks,
    Guillem

    From ecb3332d498b247e7ff2487e89dd9819d79adba2 Mon Sep 17 00:00:00 2001
    From: Guillem Jover <guillem@debian.org>
    Date: Thu, 26 Oct 2023 13:06:32 +0200
    Subject: [PATCH] Dpkg::Deps: Implicitly enable build_deps option on tests_deps

    The test dependencies are based on the build dependency syntax, so we
    should accept everything they accept in addition to any test specific
    syntax that is allowed.

    Closes: #1053481
    ---
    scripts/Dpkg/Deps.pm | 6 ++++++
    scripts/Dpkg/Deps/Simple.pm | 7 +++++++
    2 files changed, 13 insertions(+)

    diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
    index 87855cdc5..959318452 100644
    --- a/scripts/Dpkg/Deps.pm
    +++ b/scripts/Dpkg/Deps.pm
    @@ -252,6 +252,9 @@ If set to 1, allow tests-specific package names in dependencies, that is
    "@" and "@builddeps@" (since dpkg 1.18.7). This should be set whenever
    working with dependency fields from F<debian/tests/control>.

    +This option implicitly (and forcibly) enables C<build_dep> because test +dependencies are based on build dependencies (since dpkg 1.22.1).
    +
    =back

    =cut
    @@ -286,6 +289,9 @@ sub deps_parse {
    if ($options{reduce_profiles}) {
    $options{build_profiles} //= [ get_build_profiles() ];
    }
    + if ($options{tests_dep}) {
    + $options{build_dep} = 1;
    + }

    # Options for Dpkg::Deps::Simple.
    my %deps_options = (
    diff --git a/scripts/Dpkg/Deps/Simple.pm b/scripts/Dpkg/D
  • From James McCoy@1:229/2 to All on Thu Oct 5 02:30:01 2023
    XPost: linux.debian.bugs.dist
    From: jamessan@debian.org

    [SoupGate killed MIME-encoded file 00000000.ATT (2821 bytes)]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Guillem Jover@1:229/2 to James McCoy on Thu Oct 5 07:20:02 2023
    XPost: linux.debian.bugs.dist
    From: guillem@debian.org

    Hi!

    On Wed, 2023-10-04 at 20:17:58 -0400, James McCoy wrote:
    Package: libdpkg-perl
    Version: 1.18.8
    Severity: normal
    Control: affects -1 src:zsh src:poppler src:libjodycode src:doxygen src:jemalloc src:jdupes src:libsdl2 src:iproute2

    Any test stanza in a debian/tests/control file which contains a
    foo:native Depends will not have its dependencies translated into Testsuite-Triggers.

    This is due to an explicit check in Dpkg::Deps::Simple->parse_string()
    which only allows native qualified dependencies for build dependencies.

    As an example, running “dpkg-source -b .” for jdupes shows

    […]

    Three warnings, one for each of the tests. Since it does have a test
    without a native qualified dependency, Testsuite-Triggers is generated.

    % grep Depends debian/tests/control
    Depends: @, tree:native
    Depends: @, tree:native
    Depends: @, tree:native
    Depends: @, forensics-samples-files
    % grep Testsuite ../jdupes_1.27.3-2.dsc
    Testsuite: autopkgtest
    Testsuite-Triggers: forensics-samples-files

    As far as I can tell, this has been a problem since dpkg-source gained support for generating Testsuite-Triggers.

    Right, nice catch! Given that these fields are based on what might
    appear on build dependencies, I think it does make sense to consider
    them an overlay on top of those. So I'll make them allow anything that
    is allowed for build dependencies.

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)