bzr dh-make crash - no attribute 'initialize_on_transport'
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://
* 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.
[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:/
[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.
Once debian-breezy.git's dh_make.
from BzrDir. to ControlDir.
and dropped the bzrlib import, that is not set anymore.
Now, create_
initialize_
commit 08fcab340a2cd4f
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(
...
- create_branch = bzrdir.
...
+ create_branch = controldir.
...
* 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:/
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_
(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://
500 http://
100 /var/lib/
$ bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_
Traceback (most recent call last):
File "/usr/lib/
tree = workingtree.
File "/usr/lib/
control = controldir.
File "/usr/lib/
return klass.open_
File "/usr/lib/
transport, format = _mod_transport.
File "/usr/lib/
return action(transport)
File "/usr/lib/
return transport, ControlDirForma
File "/usr/lib/
raise errors.
breezy.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/
a_controldir = controldir.
File "/usr/lib/
transport, format = _mod_transport.
File "/usr/lib/
return action(transport)
File "/usr/lib/
return transport, ControlDirForma
File "/usr/lib/
raise errors.
breezy.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
return self._operation
File "/usr/lib/
return _do_with_cleanups(
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
tree = dh_make.
File "/usr/lib/
tree = _get_tree(
File "/usr/lib/
branch = create_
File "/usr/lib/
controldir = klass.create(base, format, possible_
File "/usr/lib/
return format.
AttributeError: 'NoneType' object has no attribute 'initialize_
You can report this problem to Bazaar's developers by running
apport-bug /var/crash/
if a bug-reporting window does not automatically appear.
Related branches
- Ubuntu Packaging Guide Team: Pending requested
-
Diff: 65 lines (+21/-2)1 file modifiedubuntu-packaging-guide/packaging-new-software.rst (+21/-2)
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 |
description: | updated |
Changed in ubuntu-packaging-guide: | |
status: | New → Confirmed |
tags: | added: sts-sponsor-mfo |
Test case:
$ cat <<EOF >test-breezy.py
#!/usr/bin/env python
from breezy.bzr import (
controldir,
)
from breezy import (
transport,
)
if __name__ == "__main__": "DefaultFormat: %s" % ControlDirForma t.get_default_ format( ))
print(
controldir.
to_transport = transport. get_transport( "test_dir" ) .ControlDir. create_ branch_ convenience( base, transports= [to_transport] )
controldir
to_transport.
possible_
EOF
$ chmod +x test-breezy.py
Problem:
$ ./test-breezy.py transports= [to_transport] ) python2. 7/dist- packages/ breezy/ controldir. py", line 653, in create_ branch_ convenience transports) python2. 7/dist- packages/ breezy/ controldir. py", line 851, in create initialize_ on_transport( t) on_transport'
DefaultFormat: None
Traceback (most recent call last):
File "./test-breezy.py", line 17, in <module>
possible_
File "/usr/lib/
controldir = klass.create(base, format, possible_
File "/usr/lib/
return format.
AttributeError: 'NoneType' object has no attribute 'initialize_
Fix:
$ sed '2a from breezy.bzr import bzrdir' -i test-breezy.py
$ ./test-breezy.py
DefaultFormat: Meta directory format 1