[check-mir] cannot parse dependencies with architecture restrictions

Bug #1149679 reported by Benjamin Drung
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Invalid
Undecided
Unassigned
ubuntu-dev-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

check-mir fails when run in the libreoffice source.

$ check-mir
Checking support status of build dependencies...

Checking support status of binary dependencies...
Traceback (most recent call last):
  File "/usr/bin/check-mir", line 151, in <module>
    main()
  File "/usr/bin/check-mir", line 141, in main
    unsupported_binary_deps = check_binary_dependencies(apt_cache, control)
  File "/usr/bin/check-mir", line 109, in check_binary_dependencies
    for or_group in apt.apt_pkg.parse_depends(control.section[field]):
ValueError: Problem Parsing Dependency

Revision history for this message
Robie Basak (racb) wrote :

The problem element appears to be "libreoffice-report-builder-bin [!hppa !kfreebsd-amd64 !kfreebsd-i386]". If I remove the architecture restriction, then apt.apt_pkg.parse_depends succeeds.

The problem also occurs with php5, for example with "lsof [!kfreebsd-any !hurd-any]".

It looks like the underlying reason is that apt.apt_pkg.parse_depends cannot parse architecture restrictions, and the API does not represent it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-dev-tools (Ubuntu):
status: New → Confirmed
Robie Basak (racb)
summary: - [check-mir] fails on libreoffice
+ [check-mir] cannot parse dependencies with architecture restrictions
Revision history for this message
Julian Andres Klode (juliank) wrote :

Those are not binary dependencies. Those are source dependencies, and parse_src_depends needs to be used for those.

Changed in python-apt (Ubuntu):
status: New → Invalid
Revision history for this message
Robie Basak (racb) wrote :

I've checked the php5 case, and it's definitely a binary dependency that parse_depends cannot parse.

>>> apt.apt_pkg.parse_depends('${misc:Depends},\n\t ${shlibs:Depends},\n\t sed (>= 4.1.1-1),\n\t psmisc (>= 22.15-1~),\n\t lsof [!kfreebsd-any !hurd-any],\n\t ucf')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Problem Parsing Dependency
>>> apt.apt_pkg.parse_depends('sed (>= 4.1.1-1),\n\t psmisc (>= 22.15-1~),\n\t lsof [!kfreebsd-any !hurd-any],\n\t ucf')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Problem Parsing Dependency
>>>

Package: php5-common
Architecture: any
Depends: ${misc:Depends},
         ${shlibs:Depends},
         sed (>= 4.1.1-1),
         psmisc (>= 22.15-1~),
         lsof [!kfreebsd-any !hurd-any],
         ucf

I apologise if I made in error in the Libreoffice case.

Changed in python-apt (Ubuntu):
status: Invalid → New
Revision history for this message
Julian Andres Klode (juliank) wrote :

Those are dependencies in the *source package*. Only those allow such limitations. The parse_depends functions is for dependency fields in binary packages (.deb files) only. The architecture limiting stuff is precisely the difference between src_depends and depends.

Changed in python-apt (Ubuntu):
status: New → Invalid
Revision history for this message
Robie Basak (racb) wrote :

I see, thanks.

It seems that there is an ambiguity here. Binary dependency might mean a dependency in a binary package as defined in the source package's control file, or it might mean a dependency in a binary package as defined in a binary package's control file only.

It seems that check_mir is using the former and calling parse_depends, and python-apt requires parse_src_depends in this case. The only documentation I see in python-apt doesn't appear to actually describe where the name "src" comes from. The confusion seems to be that "src" might mean that we're parsing a source package's control file (the assumption that python-apt makes), or that we're parsing the source package's build-depends in the source package's control file (the assumption that check-mir makes).

It looks like the spec difference between parse_src_depends and depends is just that parse_src_depends resolves all arch-specific dependencies based on the value of APT::Architecture, so I think this can just be swapped out wholesale without causing any issues.

check-mir still won't be perfect, but at least it'll give _an_ answer valid for one architecture, rather than crashing with no answer at all for packages that use this feature.

Revision history for this message
Martin Pitt (pitti) wrote :

I merged Robie's fix to bzr, thanks! This gets uploaded via Debian, so I'm not uploading it for now.

Changed in ubuntu-dev-tools (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-dev-tools - 0.153

---------------
ubuntu-dev-tools (0.153) unstable; urgency=medium

  [ Stefano Rivera ]
  * Acknowledge NMU. Thanks to Paul.
  * Explicitly use xz compression when building source packages, rather than
    relying on dpkg >= 1.16.5 behavior.

  [ Robie Basak ]
  * check-mir: correctly parse dependencies with architecture specifications
    (LP: #1149679).

  [ Benjamin Drung ]
  * pbuilder-dist:
    - Set different aptcache directories for Debian and Ubuntu.
    - Store build logs in <source>_<version>_<arch>.build instead of
      last_operation.log (to avoid overwriting build logs).

ubuntu-dev-tools (0.152+nmu1) unstable; urgency=medium

  * Non-maintainer upload.
  * Change debian.tar.gz to debian.tar.xz (Closes: #738413)
 -- Benjamin Drung <email address hidden> Tue, 15 Apr 2014 13:17:12 +0200

Changed in ubuntu-dev-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.