FTBFS: apt can't resolve `dh-systemd | debhelper (>= 13.3)`

Bug #1926949 reported by Utkarsh Gupta
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-advantage-tools (Ubuntu)
Status tracked in Impish
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Focal
Undecided
Unassigned
Groovy
Undecided
Unassigned
Hirsute
Undecided
Unassigned
Impish
Low
Grant Orndorff

Bug Description

[Impact]
For sbuild users attempting to build this package locally results in pkg build failures due to inability of sbuild to handle the build deps alternatives when running:
 sbuild -s --source-only-changes

[Test Plan]

cat > sru-sbuild-test.sh <<EOF
#!/bin/bash
[ -d ./ubuntu-advantage-tools ] || git-ubuntu clone ubuntu-advantage-tools
cd ubuntu-advantage-tools

for release in bionic focal groovy hirsute; do
  case "\${release}" in
    hirsute)
      resolve_alt="";;
    xenial|bionic|focal|groovy)
      resolve_alt="--resolve-alternatives";;
  esac
  git checkout pkg/ubuntu/\${release}-proposed;
  sbuild -s --source-only-changes -d \${release} \${resolve_alt}
done
EOF

bash sru-build-test.sh # expect no sbuild failures

Also uploaded binary equavalent 27.0.2 bits to ppa:ua-client/staging PPA which sucessfully built Xenial -> Impish where powerpc (xenial) and riscv64 platforms are viable (focal++)

[Where problems could occur]

 * Due to using the same d/control on all Ubuntu releases, simpler sbuild commandline will require use of `--resolve-alternatives` parameter on older releases where sbuild doesn't "seed" those build deps alternatives by default.

 * This should be low risk as PPAs ppa:ua-client/staging & ppa-uaclient/daily are building successfully with these Build-Depends and genereally sbuild allows for workarounds with using --resolve-alternatives.

 * [racb] Mutating the Build-Depends line could cause alternatives to be resolved differently on the buildds, resulting in toolchain changes that might result in different sets of build failures or different build output causing functional issues.

[Other Info]
 ...

[Original Description]

Hello,

[Problem]
=========

It looks like apt isn't able to resolve `dh-systemd | debhelper (>= 13.3)`. Whilst the line in logical and makes sense, that is, use dh-systemd for Groovy and older releases (since it's not present in Hirsute and thereafter) and use debhelper (...) for newer releases, et al.

However, apt is failing to resolve that for some reasons and it's thus results in FTBFS.

[Logs]
======

Install main build dependencies (apt-based resolver)
----------------------------------------------------

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 sbuild-build-depends-main-dummy : Depends: dh-systemd but it is not installable
E: Unable to correct problems, you have held broken packages.
apt-get failed.
E: Package installation failed
Not removing build depends: cloned chroot in use

[Reproducer]
============

$ git ubuntu clone ubuntu-advantage-tools
$ cd ubuntu-advantage-tools
$ sbuild -s --source-only-changes

and that should yield a failed build.

Related branches

Revision history for this message
Paride Legovini (paride) wrote :

Thanks Utkarsh. TIL that by default the apt resolver ignores the alternative build-dependencies, considering only the first one. The package builds with the apt resolver specifying --resolve-alternatives.

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

This used to happen with PHP too. I don't know how the Launchpad builders do it but it does work as we want there. The FTBFS happens with local sbuild defaults only and you have to override locally as you found. So not an issue for the archive unless you're seeing behaviour that contradicts my assumptions here?

With the PHP situation Debian buildds handled it fine too.

I think the Build-Depends line specified is entirely compliant with the spec and will work correctly except for sbuild's local defaults. Since prior cases haven't considered this to be a bug in packaging, I don't think this case is either, so I think this bug should be marked Invalid.

However, this doesn't preclude changing the packaging to make it more convenient for sbuild users, etc, in which case feel free to keep the bug open. Swapping it around as Utkarsh suggests might make sense anyway, since conventionally we use the first alternative to mean the preferred alternative (resolvers will default to earlier ones where possible, etc).

Changed in ubuntu-advantage-tools (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Chad Smith (chad.smith) wrote :

We are looking to reorder dependencies expressed in our conditional deps. This *should* help sbuild runs without requiring the --resolve-alternatives

Changed in ubuntu-advantage-tools (Ubuntu):
assignee: nobody → Grant Orndorff (orndorffgrant)
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Yep, the following diff:

--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Build-Depends: bash-completion,
                debhelper (>=9),
                debianutils,
                dh-python,
- dh-systemd | debhelper (>= 13.3),
+ debhelper (>= 13.3) | dh-systemd,
                gettext,
                git,
                golang,

...should be sufficient to fix this issue for Hirsute and Impish and so on but this will still need --resolve-alternatives for Bionic, Focal, and Groovy (and anything before them).

And also, thank you for taking a look at this! \o/

tags: added: patch
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks Utkarsh. Applied patch to the following PR which we will release to bionic++ in our current SRU. https://github.com/canonical/ubuntu-advantage-client/pull/1572. Expect this in SRU of 27.0.2 or later.

Changed in ubuntu-advantage-tools (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Yay, thanks, Chad!

Chad Smith (chad.smith)
description: updated
Chad Smith (chad.smith)
description: updated
Robie Basak (racb)
description: updated
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Utkarsh, or anyone else affected,

Accepted ubuntu-advantage-tools into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.0.2~21.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-advantage-tools (Ubuntu Hirsute):
status: New → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Changed in ubuntu-advantage-tools (Ubuntu Groovy):
status: New → Fix Committed
Changed in ubuntu-advantage-tools (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Robie Basak (racb) wrote :

Hello Utkarsh, or anyone else affected,

Accepted ubuntu-advantage-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.0.2~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-advantage-tools (Ubuntu Bionic):
status: New → Fix Committed
Chad Smith (chad.smith)
description: updated
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-advantage-tools/27.0.2~20.04.1)

All autopkgtests for the newly accepted ubuntu-advantage-tools (27.0.2~20.04.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-advantage-tools/27.0.2~20.04.1 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#ubuntu-advantage-tools

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Chad Smith (chad.smith) wrote :

sbuild verification logs for Bionic, Focal, Groovy and Hirsute also successful PPA builds of Xenial -> Impish on ppa:ua-client/staging

TLDR: sbuild successes egrep "Build Architecture|Distribution: |Status: " sru-192.6949.log

Distribution: bionic
Distribution: bionic
Build Architecture: amd64
Distribution: bionic
Status: successful
Distribution: focal
Build Architecture: amd64
Distribution: focal
Distribution: focal
Build Architecture: amd64
Distribution: focal
Status: successful
Distribution: groovy
Build Architecture: amd64
Distribution: groovy
Distribution: groovy
Build Architecture: amd64
Distribution: groovy
Status: successful
Distribution: hirsute
Build Architecture: amd64
Distribution: hirsute
Distribution: hirsute
Build Architecture: amd64
Distribution: hirsute

tags: added: verification-done verification-done-bionic verification-done-focal verification-done-groovy verification-done-hirsute
removed: verification-needed verification-needed-focal verification-needed-hirsute
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-advantage-tools/27.0.2~21.04.1)

All autopkgtests for the newly accepted ubuntu-advantage-tools (27.0.2~21.04.1) for hirsute have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-advantage-tools/27.0.2~21.04.1 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/hirsute/update_excuses.html#ubuntu-advantage-tools

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-advantage-tools/27.0.2~20.10.1)

All autopkgtests for the newly accepted ubuntu-advantage-tools (27.0.2~20.10.1) for groovy have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-advantage-tools/27.0.2~20.10.1 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/groovy/update_excuses.html#ubuntu-advantage-tools

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

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

This bug was fixed in the package ubuntu-advantage-tools - 27.0.2~21.04.1

---------------
ubuntu-advantage-tools (27.0.2~21.04.1) hirsute; urgency=medium

  * Backport to Hirsute

ubuntu-advantage-tools (27.0.2) impish; urgency=medium

  * d/control:
    - order build-depends alternatives newer first (LP: #1926949)
    - apt-hook: do not attempt to package go APT JSON hook on some
      architectures (GH: #1603) (LP: #1927886, LP: #1927795)
  * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
    - apt-hook: refactor json hook messaging to be dry
    - tests: fix subp ls error case for powerpc builds
    - jenkinsfile: add --resolve-alternatives for trusty builds
    - amend changelog: add omitted apt-hook message for 27.0.1 stanza

ubuntu-advantage-tools (27.0.1) impish; urgency=medium

  * Add .gitignore and cleanup ignored directory .pytest_cache
  * apt-hook: mitigate failures with true

 -- Chad Smith <email address hidden> Wed, 12 May 2021 10:10:45 -0600

Changed in ubuntu-advantage-tools (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ubuntu-advantage-tools has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package ubuntu-advantage-tools - 27.0.2~20.10.1

---------------
ubuntu-advantage-tools (27.0.2~20.10.1) groovy; urgency=medium

  * Backport to Groovy

ubuntu-advantage-tools (27.0.2) impish; urgency=medium

  * d/control:
    - order build-depends alternatives newer first (LP: #1926949)
    - apt-hook: do not attempt to package go APT JSON hook on some
      architectures (GH: #1603) (LP: #1927886, LP: #1927795)
  * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
    - apt-hook: refactor json hook messaging to be dry
    - tests: fix subp ls error case for powerpc builds
    - jenkinsfile: add --resolve-alternatives for trusty builds
    - amend changelog: add omitted apt-hook message for 27.0.1 stanza

ubuntu-advantage-tools (27.0.1) impish; urgency=medium

  * Add .gitignore and cleanup ignored directory .pytest_cache
  * apt-hook: mitigate failures with true

 -- Chad Smith <email address hidden> Wed, 12 May 2021 10:10:45 -0600

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

This bug was fixed in the package ubuntu-advantage-tools - 27.0.2~20.04.1

---------------
ubuntu-advantage-tools (27.0.2~20.04.1) focal; urgency=medium

  * Backport to Focal

ubuntu-advantage-tools (27.0.2) impish; urgency=medium

  * d/control:
    - order build-depends alternatives newer first (LP: #1926949)
    - apt-hook: do not attempt to package go APT JSON hook on some
      architectures (GH: #1603) (LP: #1927886, LP: #1927795)
  * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
    - apt-hook: refactor json hook messaging to be dry
    - tests: fix subp ls error case for powerpc builds
    - jenkinsfile: add --resolve-alternatives for trusty builds
    - amend changelog: add omitted apt-hook message for 27.0.1 stanza

ubuntu-advantage-tools (27.0.1) impish; urgency=medium

  * Add .gitignore and cleanup ignored directory .pytest_cache
  * apt-hook: mitigate failures with true

 -- Chad Smith <email address hidden> Wed, 12 May 2021 10:10:45 -0600

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

This bug was fixed in the package ubuntu-advantage-tools - 27.0.2~18.04.1

---------------
ubuntu-advantage-tools (27.0.2~18.04.1) bionic; urgency=medium

  * Backport to Bionic

ubuntu-advantage-tools (27.0.2) impish; urgency=medium

  * d/control:
    - order build-depends alternatives newer first (LP: #1926949)
    - apt-hook: do not attempt to package go APT JSON hook on some
      architectures (GH: #1603) (LP: #1927886, LP: #1927795)
  * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
    - apt-hook: refactor json hook messaging to be dry
    - tests: fix subp ls error case for powerpc builds
    - jenkinsfile: add --resolve-alternatives for trusty builds
    - amend changelog: add omitted apt-hook message for 27.0.1 stanza

ubuntu-advantage-tools (27.0.1) impish; urgency=medium

  * Add .gitignore and cleanup ignored directory .pytest_cache
  * apt-hook: mitigate failures with true

 -- Chad Smith <email address hidden> Wed, 12 May 2021 10:10:45 -0600

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

This bug was fixed in the package ubuntu-advantage-tools - 27.0.2

---------------
ubuntu-advantage-tools (27.0.2) impish; urgency=medium

  * d/control:
    - order build-depends alternatives newer first (LP: #1926949)
    - apt-hook: do not attempt to package go APT JSON hook on some
      architectures (GH: #1603) (LP: #1927886, LP: #1927795)
  * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
    - apt-hook: refactor json hook messaging to be dry
    - tests: fix subp ls error case for powerpc builds
    - jenkinsfile: add --resolve-alternatives for trusty builds
    - ammend changelog: add ommitted apt-hook message for 27.0.1 stanza

 -- Chad Smith <email address hidden> Fri, 07 May 2021 11:58:03 -0600

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

This bug was fixed in the package ubuntu-advantage-tools - 27.1~16.04.1

---------------
ubuntu-advantage-tools (27.1~16.04.1) xenial; urgency=medium

  * Backport new upstream release: (LP: #1929597) to xenial

 -- Lucas Moura <email address hidden> Thu, 27 May 2021 15:40:20 -0300

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

Other bug subscribers

Bug attachments