bzr dh-make crash - no attribute 'initialize_on_transport'

Bug #1954595 reported by Honza
50
This bug affects 17 people
Affects Status Importance Assigned to Milestone
Ubuntu Packaging Guide
Fix Released
Medium
Mauricio Faria de Oliveira
breezy-debian (Ubuntu)
Invalid
Undecided
Unassigned
Bionic
Fix Released
Low
Mauricio Faria de Oliveira
Focal
Fix Released
Medium
Mauricio Faria de Oliveira

Bug Description

[Impact]

 * The `bzr dh-make` step in the Ubuntu Packaging Guide [1]
   fails in Focal.

 * The alternative `brz dh-make` (BReeZy instead of BaZaaR)
   fails in Focal and Bionic.

 * The `dh-make` subcommand is not available in Impish/later.
   The Guide should be updated and ideally use another tool.

[Test Plan]

 * Prepare:
   $ sudo apt-get install dh-make bzr-builddeb brz-debian
   $ bzr whoami "Your Name <email address hidden>"
   $ wget -O hello-2.10.tar.gz "http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"

 * Test bazaar:
   $ bzr dh-make hello 2.10 hello-2.10.tar.gz

 * Test breezy:
   $ brz dh-make hello 2.10 hello-2.10.tar.gz

 * Between tests, remove the generated dir/file:
   $ rm -rf hello hello_2.10.orig.tar.gz

[Where problems could occur]

 * The changes are restricted to the `dh-make` command
   in bazaar/breezy, which is broken, so it should not
   make things worse.

   But, theoretically, `bzr/brz dh-make` is the impact
   surface for other issues/regressions from previous/
   working releases.

[Links]

 * [1] https://packaging.ubuntu.com/html/packaging-new-software.html#starting-a-package

[Other Info]

 * Bionic is not affected in `bzr`, but just in `brz`,
   due to being from 2 source packages: `bzr-builddeb`
   and `breezy-debian`.

 * Focal is affected in both `bzr/brz` per transition
   from `bzr-builddeb` to `breezy-debian` (1 src pkg).

 * Impish+ are not "affected" as `dh-make` was dropped
   by debian-breezy upstream.

 * The root cause of the regression is a dropped python
  `import` in breezy-debian following changes in breezy.

   The `bzrdir` import sets ControlDir's default format:
   `controldir.ControlDirFormat._default_format = BzrDirMetaFormat1()`

   Once debian-breezy.git's dh_make.py:_get_tree() moved
   from BzrDir. to ControlDir.create_branch_convenience()
   and dropped the bzrlib import, that is not set anymore.

   Now, create_branch_convenience() calls create(), calls
   initialize_on_transport() on the default format (None).

 commit 08fcab340a2cd4f6bf0f5aec65c304a88023a4f8
 Author: Jelmer Vernooij <email address hidden>
 Date: Sat Jun 17 14:10:12 2017 +0000

     Update for breezy, drop support for older versions of bazaar and for debian_bundle.

 ...
 diff --git a/dh_make.py b/dh_make.py
 ...
  from ... import (
 - bzrdir,
 + controldir,
 ...
 @@ -34,22 +34,22 @@ def _get_tree(package_name):
 ...
 - create_branch = bzrdir.BzrDir.create_branch_convenience
 ...
 + create_branch = controldir.ControlDir.create_branch_convenience
 ...

 * Focal needs another patch to fix this in `bzr`:

 $ bzr dh-make hello 2.10 hello-2.10.tar.gz
 Fetching tarball
 Looking for a way to retrieve the upstream tarball
 Upstream tarball already exists in build directory, using that
 brz: ERROR: TypeError: can only concatenate str (not "bytes") to str

 * Synthetic test cases for this are provided in comment #1.

[Original Bug Description]

I am following official Ubuntu Packaging Guide:
https://packaging.ubuntu.com/html/packaging-new-software.html

When I come to the following part, the command crashes:

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'
(trackback bellow)

My system:

Description: Ubuntu 20.04.3 LTS
Release: 20.04
dh-make:
  Installed: 2.201903
  Candidate: 2.201903
  Version table:
 *** 2.201903 500
        500 http://cz.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://cz.archive.ubuntu.com/ubuntu focal/main i386 Packages
        100 /var/lib/dpkg/status

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 26, in _get_tree
    tree = workingtree.WorkingTree.open(".")
  File "/usr/lib/python3/dist-packages/breezy/workingtree.py", line 201, in open
    control = controldir.ControlDir.open(path, _unsupported=_unsupported)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 706, in open
    return klass.open_from_transport(t, probers=probers,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/jkalina/packaging/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 37, in _get_tree
    a_controldir = controldir.ControlDir.open_from_transport(
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/jkalina/packaging/hello/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/cmds.py", line 1385, in run
    tree = dh_make.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 83, in import_upstream
    tree = _get_tree(package_name)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 42, in _get_tree
    branch = create_branch(to_transport.base,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 660, in create_branch_convenience
    controldir = klass.create(base, format, possible_transports)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 859, in create
    return format.initialize_on_transport(t)
AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

You can report this problem to Bazaar's developers by running
    apport-bug /var/crash/brz.1000.2021-12-12T15:32.crash
if a bug-reporting window does not automatically appear.

Related branches

Jelmer Vernooij (jelmer)
affects: dh-make (Ubuntu) → ubuntu-packaging-guide
Changed in breezy-debian (Ubuntu):
status: New → Won't Fix
Changed in breezy-debian (Ubuntu Bionic):
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Mauricio Faria de Oliveira (mfo)
Changed in breezy-debian (Ubuntu Focal):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Mauricio Faria de Oliveira (mfo)
tags: added: sts
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Test case:

 $ cat <<EOF >test-breezy.py
 #!/usr/bin/env python

 from breezy.bzr import (
     controldir,
 )

 from breezy import (
     transport,
 )

 if __name__ == "__main__":
     print("DefaultFormat: %s" %
  controldir.ControlDirFormat.get_default_format())

     to_transport = transport.get_transport("test_dir")
     controldir.ControlDir.create_branch_convenience(
  to_transport.base,
  possible_transports=[to_transport])
 EOF

 $ chmod +x test-breezy.py

Problem:

 $ ./test-breezy.py
 DefaultFormat: None
 Traceback (most recent call last):
   File "./test-breezy.py", line 17, in <module>
     possible_transports=[to_transport])
   File "/usr/lib/python2.7/dist-packages/breezy/controldir.py", line 653, in create_branch_convenience
     controldir = klass.create(base, format, possible_transports)
   File "/usr/lib/python2.7/dist-packages/breezy/controldir.py", line 851, in create
     return format.initialize_on_transport(t)
 AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

Fix:

 $ sed '2a from breezy.bzr import bzrdir' -i test-breezy.py

 $ ./test-breezy.py
 DefaultFormat: Meta directory format 1

description: updated
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Attaching debdiffs with the changes; running autopkgtests for reverse dependencies.

description: updated
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Changed in breezy-debian (Ubuntu):
status: Won't Fix → Invalid
description: updated
Changed in ubuntu-packaging-guide:
status: New → Confirmed
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
description: updated
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Changes submitted to focal/bionic upload queues.

...

Bionic:
---

Reverse Dependencies:

 $ apt rdepends brz-debian
 brz-debian
 Reverse Depends:
   Recommends: ubuntu-dev-tools
   Recommends: ubuntu-dev-tools

Autopkgtests for ubuntu-dev-tools don't actually install brz-debian; but anyway, finished successfully. [1]

Version 2.8.10ubuntu1 is available / hasn't been used in the archive. [2]

   2018-05-20 03:10:11 -03 Deleted Cosmic proposed universe misc 2.8.12
   2018-05-06 21:13:59 -03 Superseded Cosmic release universe misc 2.8.10
   2017-12-04 21:23:48 -02 Published Bionic release universe misc 2.8.10

Focal:
---

Reverse Dependencies:

 $ apt rdepends brz-debian
 brz-debian
 Reverse Depends:
   Depends: silver-platter (>= 2.8.30)
   Recommends: ubuntu-dev-tools
   Recommends: ubuntu-dev-tools
   Recommends: ubuntu-dev-tools
   Depends: bzr-builddeb

 $ apt rdepends bzr-builddeb
 bzr-builddeb
 Reverse Depends:
   Breaks: bzr (<< 2.8.12+brz)
   Breaks: python-apt (<< 2.4)
  |Recommends: ubuntu-dev-tools
  |Recommends: ubuntu-dev-tools
   Breaks: python-apt (<< 2.4)
  |Recommends: ubuntu-dev-tools
   Breaks: python-apt (<< 2.4)
   Recommends: packaging-dev
   Recommends: bikeshed

Autopkgtests for ubuntu-dev-tools don't actually install brz-debian; but anyway, finished successfully. [3]
Autopkgtests for packaging-dev and bikeshed do not exist.

Version 2.8.12ubuntu1.1 is available / hasn't been used in the archive. [4]

   2020-07-18 21:10:13 -03 Deleted Groovy proposed universe misc 2.8.35
   2020-05-13 16:03:40 -03 Superseded Groovy release universe misc 2.8.32ubuntu1
   2020-02-10 21:53:20 -03 Published Focal release universe misc 2.8.32ubuntu1

Links:
---

[1] https://autopkgtest.ubuntu.com/results/autopkgtest-bionic-mfo-lp1954595/bionic/amd64/u/ubuntu-dev-tools/20220520_165034_0b5fc@/log.gz
[2] https://launchpad.net/ubuntu/+source/breezy-debian/+publishinghistory
[3] https://autopkgtest.ubuntu.com/results/autopkgtest-focal-mfo-lp1954595/focal/amd64/u/ubuntu-dev-tools/20220520_163817_f2be3@/log.gz
[4] https://launchpad.net/ubuntu/+source/breezy-debian/+publishinghistory

Changed in breezy-debian (Ubuntu Focal):
status: Confirmed → In Progress
Changed in breezy-debian (Ubuntu Bionic):
status: Confirmed → In Progress
tags: added: sts-sponsor-mfo
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Honza, or anyone else affected,

Accepted breezy-debian into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/breezy-debian/2.8.32ubuntu1.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 breezy-debian (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in breezy-debian (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Robie Basak (racb) wrote :

Hello Honza, or anyone else affected,

Accepted breezy-debian into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/breezy-debian/2.8.10ubuntu1 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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.

Revision history for this message
Zakhar (alainb06) wrote :

Hi, thanks for the upgrade.

Am I doing something wrong?
I followed the steps on testing "proposed" from the page you kindly linked.
- Ticked "focal-proposed"
- Pined priorities to 400 for "proposed" (to avoid getting all the "proposed"!)
- ran:

$ LANG=C sudo apt update
Hit:1 http://fr.archive.ubuntu.com/ubuntu focal InRelease
(...)
Hit:6 http://fr.archive.ubuntu.com/ubuntu focal-proposed InRelease
(...)
Fetched 114 kB in 1s (158 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

Which was expected since I did a "normal" update/upgrade prior to adding "proposed".

Then ran:

$ LANG=C sudo apt install bzr/focal-proposed
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Release 'focal-proposed' for 'bzr' was not found

So I still have:
$ LANG=C sudo apt list bzr
Listing... Done
bzr/focal,focal,now 2.7.0+bzr6622+brz all [installed]

Any advise on how to test the new version... assuming it made its way into the proposed repositories already?

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Hi Zakhar,

Thanks for the quick response to the verification request!

Your steps are likely correct, it's just the name of the
binary package with the changes is `brz-debian` (for the
`dh-make` subcommand).

I had to double check this as well, and can confirm the
changes are available at the archive and in effect.

cheers!

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

$ lsb_release -cs
focal

$ sudo apt install --yes dh-make bzr-builddeb brz-debian
$ bzr whoami "Your Name <email address hidden>"
$ wget -O hello-2.10.tar.gz "http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"

Before:

$ dpkg -s brz-debian | grep Version:
Version: 2.8.32ubuntu1

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'
...
$ rm -rf hello hello_2.10.orig.tar.gz

$ brz dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'
...
$ rm -rf hello hello_2.10.orig.tar.gz

After:

$ sudo apt install --yes brz-debian/focal-proposed

$ dpkg -s brz-debian | grep Version:
Version: 2.8.32ubuntu1.1

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
Fetching tarball
...
Package prepared in /home/ubuntu/hello
$ rm -rf hello hello_2.10.orig.tar.gz

$ brz dh-make hello 2.10 hello-2.10.tar.gz
Fetching tarball
...
Package prepared in /home/ubuntu/hello
$ rm -rf hello hello_2.10.orig.tar.gz

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

$ lsb_release -cs
bionic

$ sudo apt install --yes dh-make bzr-builddeb brz-debian
$ bzr whoami "Your Name <email address hidden>"
$ wget -O hello-2.10.tar.gz "http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"

Before:

$ dpkg -s brz-debian | grep Version:
Version: 2.8.10

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
Fetching tarball
...
Package prepared in /home/ubuntu/hello
$ rm -rf hello hello_2.10.orig.tar.gz

$ brz dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'
...
$ rm -rf hello hello_2.10.orig.tar.gz

After:

$ sudo apt install --yes brz-debian/bionic-proposed

$ dpkg -s brz-debian | grep Version:
Version: 2.8.10ubuntu1

$ bzr dh-make hello 2.10 hello-2.10.tar.gz
Fetching tarball
...
Package prepared in /home/ubuntu/hello
$ rm -rf hello hello_2.10.orig.tar.gz

$ brz dh-make hello 2.10 hello-2.10.tar.gz
Fetching tarball
...
Package prepared in /home/ubuntu/hello
$ rm -rf hello hello_2.10.orig.tar.gz

tags: added: verification-done-bionic
removed: verification-needed-bionic
description: updated
Revision history for this message
Zakhar (alainb06) wrote :

Same no luck:

$ LANG=C sudo apt install brz-debian/focal-proposed
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Release 'focal-proposed' for 'brz-debian' was not found

Could it be because I am using the closest apt mirror, which is in my case:

http://fr.archive.ubuntu.com/ubuntu

And that is has not yet been replicated up to that mirror?

My test is on Focal.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Yes, that might be it.

If that helps, I can confirm that fr.archive.com has the new version now:

Package: brz-debian
Architecture: all
Version: 2.8.32ubuntu1.1

Revision history for this message
Zakhar (alainb06) wrote :

It was probably the 'mirror replication delay', now it is correctly installed after an "apt update" and repeating the above command "apt install brz-debian/focal-proposed" that previously failed.

I'll test and report within 24h.

Revision history for this message
Zakhar (alainb06) wrote :
Download full text (3.3 KiB)

Dear all, not sure if this bug fix is just about dh_make or the full process to make a package for Launchpad that is documented on the Ubuntu documentation.

The former now works, the latter still fails further down the process.

Here is what now works:

$ bzr dh-make 1fichierfs 1.9.2~Focal /tmp/1fichierfs.tar
Fetching tarball
Looking for a way to retrieve the upstream tarball
Upstream tarball already exists in build directory, using that
Type of package: (single, indep, library, python)
[s/i/l/p]?
Maintainer Name : ....
Email-Address : ....@....fr
Date : Thu, 26 May 2022 13:50:43 +0200
Package Name : 1fichierfs
Version : 1.9.2~Focal
License : blank
Package Type : single
Are the details correct? [Y/n/q]
Skipping creating ../1fichierfs_1.9.2~Focal.orig.tar.gz because it already exists
Currently there is not top level Makefile. This may require additional tuning
Done. Please edit the files in the debian/ subdirectory now.

Package prepared in /tmp/build/1fichierfs

That's fine.

Then further down the process we have

$ bzr commit -m "This is a test"
Committing to: /tmp/build/1fichierfs/
added debian
added debian/1fichierfs-docs.docs
missing debian/README.Debian
missing debian/README.source
added debian/changelog
added debian/control
added debian/copyright
added debian/rules
added debian/source
added debian/source/format
Committed revision 2.

(Note the "missing" warning is not an issue, that is because I purposefully removed these files that I didn't fill with useful information so far)
You can notice here that there is no "compat" file although I provided one in the debian directory.

echo 10 >debian/compat

Then further it seems to complain for compatibility level:

$ bzr builddeb -- -us -uc
Building using working tree
Building package in merge mode
Looking for a way to retrieve the upstream tarball
Using the upstream tarball that is present in /tmp/build
Building the package in /tmp/build/build-area/1fichierfs-1.9.2~Focal, using debuild -us -uc
 dpkg-buildpackage -us -uc -ui
dpkg-buildpackage: info: paquet source 1fichierfs
dpkg-buildpackage: info: version source 1.9.2~Focal-1
dpkg-buildpackage: info: distribution source focal
dpkg-buildpackage: info: source changé par .... <...@...fr>
 dpkg-source --before-build .
dpkg-buildpackage: info: architecture hôte amd64
 fakeroot debian/rules clean
dh clean
dh: error: Please specify the compatibility level in debian/compat
make: *** [debian/rules:18 : clean] Error 25
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
brz: ERROR: The build failed.

This was working as of 16.04, although it seemed to use compatibility level 9, and nowadays this seems obsolete.

W...

Read more...

Revision history for this message
Zakhar (alainb06) wrote :

Possible workaround?

It seems that after "manually" providing the compat file in debian directory in the buildarea, if I run the "naked" debuild commands:

dpkg-buildpackage -us -uc -ui

then

dpkg-buildpackage -us -uc -ui -S

Instead of what is documented:

bzr builddeb -- -us -uc

and

bzr builddeb -S

All seems to be working fine and I get a binary deb package (first command) and a source package for launchpad.

Although I don't get "lintian" that seemed to be embedded when using the bzr wrapper... although that was anyway failing with my 16.04 install for unknown reason!

Revision history for this message
Zakhar (alainb06) wrote :

Strike it, there is no binary package with those commands (unlike with bzr wrapped) and I am not sure the "source" package is even correct... I'm lost!

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Submitted a Merge Request [1] with updates to the Ubuntu Packaging Guide for Ubuntu Focal.

[1] https://code.launchpad.net/~mfo/ubuntu-packaging-guide/ubuntu-packaging-guide/+merge/423560

Changed in ubuntu-packaging-guide:
status: Confirmed → In Progress
importance: Undecided → Medium
assignee: nobody → Mauricio Faria de Oliveira (mfo)
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Hi Zakhar,

Thanks for your attention to the quality and correctness of the documentation.
I've just submitted updates to it, after testing the steps from start to end.

Regarding your questions:

Yes, this bug is originally for the `bzr dh-make` error, but since it's not
available (some releases) after Ubuntu 20.04, it seemed OK to update steps
related to it from this bug as well.

And while in there, I've fixed things, to make sure the steps run correctly.

That's been my experience with the Chapter 4 / Packaging New Software now.

I guess the issues you mentioned are, as you considered, due to uncommitted
files, apparently; or maybe other packaging differences from the doc/example.
Hope those may be straightforward to figure out!

Thanks!

Revision history for this message
Zakhar (alainb06) wrote :

Dear Mauricio, thanks for the tip.

I had to do the following to make it work:

After:

bzr add debian/source/format

I added:

bzr add debian/compat

The compat file hold only one line with: 10, as in: echo "10" >compat

Without this, it fails to compile, but with this line added, all seems well.

I get my .deb package with all the files in good place. In my case I don't need a .configure since there is only a Makefile and that is enough for my project. I also get the source packages signed.
I didn't try to push them to launchpad though, and will try that when I have a real fix to package (which is hopefully soon!)

I will mark it "fixed for me" when I'll have done that launchpad publication, but so far it seems all good!

That being said, and since apparently bzr dropped support for making debian packages, wouldn't it be worth it to rewrite completely this "Packaging guide" with newer tooling (like git?)

After all, the task of compiling a simple hello.c, be it with the help of a Makefile, is quite basic!

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Hey Zakhar,

Good news; glad it worked!

We should keep the scope of this bug as the 'bzr dh-make' issue and its related doc updates.
The SRU/-proposed verification is related to the code change, and has been verified already.
(All good on that front / this bug.)

The other steps you mentioned (e.g., publishing), in case of issues, should go into another bug.

I agree that updating the Packaging Guide for different/modern tooling (e.g., git) would be great!
I'm not in a position to help with that at the moment, but if you have the experience and availability, please feel free to open another bug and merge request with the changes for review, and folks in more appropriate roles for that than me will check it out!

Thanks!

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

The doc updates have been merged and are live. [1]

[1] https://packaging.ubuntu.com/html/packaging-new-software.html

Changed in ubuntu-packaging-guide:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package breezy-debian - 2.8.32ubuntu1.1

---------------
breezy-debian (2.8.32ubuntu1.1) focal; urgency=medium

  * Fix `bzr dh-make` (LP: #1954595)
    - dh_make.py: import bzrdir.
    - cmds.py: cmd_dh_make(): don't encode version;
      breezy-debian commit 0c79e2e ("Fix dh-make.").

 -- Mauricio Faria de Oliveira <email address hidden> Thu, 20 May 2022 12:12:49 -0300

Changed in breezy-debian (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for breezy-debian 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 breezy-debian - 2.8.10ubuntu1

---------------
breezy-debian (2.8.10ubuntu1) bionic; urgency=medium

  * Fix `bzr dh-make` (LP: #1954595)
    - dh_make.py: import bzrdir.

 -- Mauricio Faria de Oliveira <email address hidden> Fri, 20 May 2022 11:43:32 -0300

Changed in breezy-debian (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Zakhar (alainb06) wrote :

I confirm this is fixed for me (with some adaptations of the "How to" that I managed to find by myself). Un-subscribing. Thanks.

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.