Package: devscripts
Version: 2.21.7
Severity: normal

Hi,

I was trying to use build-rdeps on Ubuntu today, and the default settings seem
unusable there. I tried both the Ubuntu version from impish and the Sid
version, both with the same result:

  $ sudo build-rdeps -d dh-cmake
  DEBUG: Package => dh-cmake
  DEBUG: running with dose-ceve resolver
  DEBUG: buildarch=amd64 hostarch=amd64
  DEBUG: Running 'apt-get' 'indextargets' 'DefaultEnabled: yes' 'Origin:
  Debian'
  build-rdeps: unable to find sources files.
  Did you forget to run apt-get update (or add --update to this command)?
  at /usr/bin/build-rdeps line 520.

Looking at the source code, I see that there does seem to be some code
in place to handle non-Debian vendors as well, but I think this does not
work well currently.

By default, the script only looks at sources that have 'Origin: Debian',
regardless of what the current system is:

  
https://salsa.debian.org/debian/devscripts/-/blob/master/scripts/build-rdeps.pl#L157
  my $opt_origin = 'Debian';

However, it then further limits sources to "development" releases only:

  
https://salsa.debian.org/debian/devscripts/-/blob/master/scripts/build-rdeps.pl#L227
  sub is_devel_release {
      my $ctrl = shift;
      if (get_current_vendor() eq 'Debian') {
          return $ctrl->{Suite} eq 'unstable' || $ctrl->{Codename} eq 'sid';
      } else {
          return $ctrl->{Suite} eq 'devel';
      }
  }

In this case, it *does* use the current vendor to determine the default
release to check for, meaning running build-rdeps without additional
options on non-Debian systems will never work (not even if you have
Debian deb-src lines in your sources.list as I have).

It seems like adding an explicit --origin Ubuntu would help here,
except:
 - Using a "devel" release of Ubuntu is apparently not a common practice
   (anymore):
   https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1728616/comments/2
 - If you *do* use e.g. `deb-src http://archive.ubuntu.com/ubuntu/ devel main`,
   this produces "Release: devel", not "Suite: devel", so the current
   code still does not match.

More generally, I wonder if build-rdeps should really limit itself to a
devel release only. This poses an additional requirement on your
sources.list (you need to have deb-src for sid or devel), which is not
documented in the manpage and not hinted at by the error message.

I can imagine it would *favor* unstable/devel if available (or maybe
testing if unstable is not found) , but fall back to the most recent
release (based on the Version field), or failing that, *any* available
src release instead?


As for the conflicting defaults, I can imagine:
 - Adding a --vendor option, defaulting to Dpkg::Vendor::get_current_vendor()
 - Pick the Origin based on the vendor (and maybe apply no origin limit
   for unknown vendors)
 - Pick the default distribution based on the vendor, like now (but
   checking against Release: devel instead of Suite:devel

Alternatively, if the "priority"-based scheme suggested above is
implemented, maybe there is no need at all to switch the distribution
based on the vendor at all. If you just apply a priority to each release
(sid/unstable/devel get max priority, testing nearly max priority,
others based on Version) this works regardless of the current vendor,
and you can switch between vendors based on the Origin (which should
probably still switch its default based on the vendor).


Note that there is also the matter of the list of components being
hardcoded currently, but that is already the subject of #913551.

As for making the current version work, what I can now do is:
 - Add a Ubuntu "devel" release to sources.list, patch build-rdeps to
   check Release: devel instead of Suite: devel, and run with `--origin
   Ubuntu".
 - Run with "--origin Ubuntu --distribution impish" (or whatever distro
   you're using).
 - Add "sid" sources to sources.list, and run with `--distribution sid`.

Gr.

Matthijs

-- Package-specific info:

--- /etc/devscripts.conf ---
Empty.

--- ~/.devscripts ---
Not present

-- System Information:
Debian Release: 11.0
  APT prefers jammy
  APT policy: (500, 'jammy'), (500, 'impish-updates'), (500, 
'impish-security'), (500, 'impish'), (100, 'impish-backports'), (50, 
'unstable-debug'), (50, 'testing-debug'), (50, 'stable-security'), (50, 
'stable-debug'), (50, 'unstable'), (50, 'testing'), (50, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.13.0-22-generic (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages devscripts depends on:
ii  dpkg-dev              1.20.9ubuntu2
ii  fakeroot              1.25.3-1.1ubuntu2
ii  file                  1:5.39-3
ii  gnupg                 2.2.20-1ubuntu4
ii  gnupg2                2.2.20-1ubuntu4
ii  gpgv                  2.2.20-1ubuntu4
ii  libc6                 2.34-0ubuntu3
ii  libfile-dirlist-perl  0.05-2
ii  libfile-homedir-perl  1.006-1
ii  libfile-touch-perl    0.11-1
ii  libfile-which-perl    1.23-1
ii  libipc-run-perl       20200505.0-1
ii  libmoo-perl           2.004004-1
ii  libwww-perl           6.53-1
ii  patchutils            0.4.2-1
ii  perl                  5.32.1-3ubuntu3
ii  python3               3.9.4-1build1
ii  sensible-utils        0.0.14
ii  wdiff                 1.2.2-2build2

Versions of packages devscripts recommends:
ii  apt                         2.3.9
ii  curl                        7.74.0-1.3ubuntu2
ii  dctrl-tools                 2.24-3
ii  debian-keyring              2021.09.25
ii  dput                        1.1.0ubuntu2
ii  dupload                     2.9.6
ii  equivs                      2.3.1
ii  libdistro-info-perl         1.0
ii  libdpkg-perl                1.20.9ubuntu2
ii  libencode-locale-perl       1.05-1.1
ii  libgit-wrapper-perl         0.048-1
ii  libgitlab-api-v4-perl       0.26-1
ii  liblist-compare-perl        0.55-1
ii  liblwp-protocol-https-perl  6.10-1
ii  libsoap-lite-perl           1.27-1
ii  libstring-shellquote-perl   1.04-1
ii  libtry-tiny-perl            0.30-1
ii  liburi-perl                 5.08-1
ii  licensecheck                3.1.1-2
ii  lintian                     2.114.0
ii  man-db                      2.9.4-2
ii  patch                       2.7.6-7
ii  pristine-tar                1.49
ii  python3-apt                 2.2.1
ii  python3-debian              0.1.39ubuntu1
ii  python3-magic               2:0.4.20-3
ii  python3-requests            2.25.1+dfsg-2
ii  python3-unidiff             0.5.5-2
ii  python3-xdg                 0.27-2
ii  strace                      5.13-0ubuntu1
ii  unzip                       6.0-26ubuntu1
ii  wget                        1.21-1ubuntu3
ii  xz-utils                    5.2.5-2

Versions of packages devscripts suggests:
pn  adequate                                  <none>
pn  at                                        <none>
pn  autopkgtest                               <none>
pn  bls-standalone                            <none>
pn  bsd-mailx | mailx                         <none>
ii  build-essential                           12.9ubuntu2
pn  check-all-the-things                      <none>
pn  cvs-buildpackage                          <none>
ii  debhelper                                 13.5.2ubuntu1~bpo20.04.1
ii  diffoscope                                180
pn  disorderfs                                <none>
ii  dose-extra                                6.0.1-2
pn  duck                                      <none>
pn  elpa-devscripts                           <none>
pn  faketime                                  <none>
pn  gnuplot                                   <none>
pn  how-can-i-help                            <none>
ii  libauthen-sasl-perl                       2.1600-1.1
pn  libdbd-pg-perl                            <none>
ii  libfile-desktopentry-perl                 0.22-2
pn  libnet-smtps-perl                         <none>
pn  libterm-size-perl                         <none>
ii  libtimedate-perl                          2.3300-2
pn  libyaml-syck-perl                         <none>
pn  mmdebstrap                                <none>
pn  mozilla-devscripts                        <none>
pn  mutt                                      <none>
ii  openssh-client [ssh-client]               1:8.4p1-6ubuntu2
pn  piuparts                                  <none>
ii  postgresql-client-11 [postgresql-client]  11.7-0ubuntu0.19.10.1
pn  pristine-lfs                              <none>
ii  quilt                                     0.66-2.1
pn  ratt                                      <none>
pn  reprotest                                 <none>
pn  svn-buildpackage                          <none>
ii  w3m                                       0.5.3+git20210102-6build1

-- no debconf information

Reply via email to