BugFixing

Ubuntu Open Week - Fixing a bug in Ubuntu - it's easier than you think - Daniel Holbach - Fri, Nov 7th, 2008

(10:05:37 AM) dholbach: alright - let's get cracking then
(10:05:58 AM) dholbach: please install the following packages first, we're going to need them:
(10:05:59 AM) dholbach:   dpatch fakeroot devscripts pbuilder debhelper
(10:06:43 AM) dholbach: ok... we all want to fix Ubuntu bugs, but first we need to find a few that are probably going to be easy to fix :)
(10:07:00 AM) dholbach: we have a tool called 'Harvest' for that
(10:07:28 AM) dholbach: Harvest itself does not know much about bugs or packages or distros, it's just designed to find "low hanging fruit"
(10:07:36 AM) dholbach: you can find it at http://daniel.holba.ch/harvest
(10:07:49 AM) dholbach: <CuriousMe> QUESTION: Do I need to be on ubuntu machine for this session? I can ssh into one only. enough?
(10:07:54 AM) dholbach: CuriousMe: that should be good enough
(10:08:38 AM) dholbach: I selected a few bugs already, but while I talk a bit more about bugs and fixing them, please do the following (it will take some time to run in the background):
(10:08:45 AM) dholbach: create a file called ~/.pbuilderrc
(10:08:53 AM) dholbach: and put
(10:08:54 AM) dholbach: COMPONENTS="main universe multiverse restricted"
(10:08:56 AM) dholbach: into it
(10:09:21 AM) dholbach: if you installed the files I mentioned above, you should now only have to run
(10:09:25 AM) dholbach:   sudo pbuilder create
(10:09:48 AM) dholbach: to let pbuilder do the hard work of setting up a minimal environment for safely building packages while we're doing something else
(10:09:58 AM) dholbach: if you run into trouble, please say so on #ubuntu-classroom-chat
(10:10:26 AM) dholbach: alright, let's first have a look at http://daniel.holba.ch/harvest/handler.py?pkg=mwavem
(10:10:36 AM) charlie-tca: +
(10:10:50 AM) dholbach: harvest lists a one bugs (it's in two categories) for the mwavem package
(10:11:04 AM) dholbach: so let's all click on the 152712 link
(10:11:11 AM) brobostigon left the room ("Bye Bye UK Ubuntu'uk'ers").
(10:11:35 AM) dholbach: the bug was filed quite a while ago, it seems that something in the init script is wrong
(10:12:02 AM) dholbach: when a bug is a bit older, I always first try to find out "was it fixed in the meantime?"
(10:12:33 AM) dholbach: if you click on the "Overview" link at the top of the page, you will get an overview of the versions in all the Ubuntu releases
(10:12:59 AM) dholbach: does anyone see a changelog entry on the Overview page that might have fixed the issue?
(10:14:30 AM) dholbach: it's this line:
(10:14:36 AM) dholbach:  * Add LSB headers to initscript
(10:14:56 AM) dholbach: in this case we don't need to do anything, just mention that it was fixed in intrepid/jaunty
(10:15:17 AM) dholbach: so if somebody of you wants to close the bug with a friendly message, go ahead... :)
(10:16:12 AM) dholbach: I checked the new package already, the typo the reporter mentioned is fixed there
(10:16:23 AM) dholbach: let's take a look at this URL next:
(10:16:26 AM) dholbach:   http://daniel.holba.ch/harvest/handler.py?pkg=telepathy-haze
(10:16:38 AM) dholbach: it lists one bug that was resolved upstream already
(10:16:43 AM) dholbach: a crasher bug
(10:17:30 AM) dholbach: if you take a look at the last comment in the bug, somebody let us know that it was fixed in the 0.2.1 version of telepathy-haze
(10:18:05 AM) dholbach: if you check the overview page, you will find out that the version made it into intrepid and jaunty too
(10:18:20 AM) dholbach: anyone up for closing the bugs? :)
(10:18:39 AM) dholbach: you might ask: "hang on, this was fixed in a new version of Ubuntu, but what about the old releases?"
(10:18:46 AM) dholbach: does anybody have an answer?
(10:19:21 AM) johnsgruber: It would have to be an SRU, no?
(10:19:35 AM) dholbach: johnsgruber: exactly
(10:19:41 AM) dholbach: SRU stands for Stable Release Updates
(10:20:03 AM) chuck_ is now known as zul
(10:20:05 AM) dholbach: https://wiki.ubuntu.com/StableReleaseUpdates is the wiki page that explains the process for getting fixes into -updates
(10:20:39 AM) dholbach: we're conservative on what we let into -updates, so if there's a severe problem and somebody finds a minimal fix (not a huge new version) to the problem, it will be considered
(10:20:54 AM) dholbach: in the cases above, I'd say: if they're fixed in the new version, we should be good
(10:23:18 AM) dholbach: sorry, replied in the wrong channel :)
(10:23:20 AM) dholbach: <johnsgruber> QUESTION: Do SRU's apply to all of "main universe multiverse restricted" or just a subset?
(10:23:26 AM) dholbach: <dholbach> johnsgruber: good question
(10:23:26 AM) dholbach:  we fix them for all sections of Ubuntu
(10:23:26 AM) dholbach:  it just needs to be justified, somebody needs to be willing to extract the minimal fix, then we upload it into -proposed and after sufficient testing (we don't want to add a regression to the fix) it gets into -updates
(10:23:44 AM) dholbach: ok, I have another example:
(10:23:45 AM) dholbach:  http://daniel.holba.ch/harvest/handler.py?pkg=pyglet
(10:24:18 AM) dholbach: what do we do about this one?
(10:25:40 AM) dholbach: any ideas?
(10:25:58 AM) itnet7: check the upstream release against intrepid
(10:26:03 AM) itnet7: ?
(10:26:18 AM) dholbach: itnet7: did you take a look at the "pyglet overview page"?
(10:26:31 AM) dholbach: you're right, that should be right place
(10:26:44 AM) dholbach: <joumetal> upload (merge?) that package to develpment version?
(10:26:57 AM) thekorn_: assroom-chat
(10:27:04 AM) dholbach: thekorn_: that was rude! :-)
(10:27:24 AM) dholbach: if you click on the "Overview" link of the bug page, you will see that we have the new version in jaunty
(10:27:34 AM) dholbach: <itnet7> Yes that is where I looked and noticed that jaunty is using the Newer release
(10:27:40 AM) thekorn_: sorry, the eeepc has a way to small keyboard ;)
(10:27:47 AM) dholbach: itnet7: good work - can you close the bug?
(10:28:03 AM) dholbach: does anybody know if there's a way we could still get the new pyglet version into intrepid?
(10:28:35 AM) dholbach: <gta47b> dholbach: backports?
(10:28:39 AM) dholbach: gta47b: Exactly!
(10:29:26 AM) thekorn_ is now known as thekorn
(10:29:40 AM) dholbach: we have the -backports repositories for all current releases and this link explains how to request one:
(10:29:41 AM) dholbach: https://help.ubuntu.com/community/UbuntuBackports#How%20to%20request%20new%20packages
(10:29:57 AM) dholbach: <itnet7> dholbach: I haven't really ever closed any bugs before... I would like to close it, but don't want to make a mistake :-P
(10:30:12 AM) dholbach: itnet7: it's good to be careful
(10:30:46 AM) dholbach: so if you click on the yellow bar saying "pyglet (Ubuntu)" it will let you change the status
(10:31:16 AM) dholbach: if you choose friendly words explaining that the new version is in jaunty, but that backporting might be possible and link to the process documentation you should be good
(10:31:24 AM) dholbach: <gta47b> QUESTION: Is there a list of requested backports ?
(10:31:37 AM) dholbach: gta47b: good one... it's a good idea to check if the backport was already requested
(10:32:07 AM) dholbach: gta47b: if you check the process page I linked to above, you will see links to the open backport requests for all current releases
(10:32:54 AM) dholbach: alright... those were all very simple bugs where we could close them without much work
(10:33:33 AM) dholbach: it just requires some detective work to find out "who has been working on that already?"
(10:33:57 AM) dholbach: that detective work is what makes good bug fixers, packagers, maintainers and developers
(10:34:11 AM) dholbach: you've been all very careful and asked good questions - that's great :-)
(10:34:23 AM) dholbach: let's now come to a bit more complicated example
(10:34:32 AM) dholbach: did the pbuilder setup work out alright for all of you?
(10:35:15 AM) dholbach: hands up? :)
(10:36:08 AM) CuriousMe: ^^__^^
(10:36:29 AM) dholbach: excellent... some people replied in -chat as well - let's crack on then :)
(10:36:42 AM) dholbach: let's take a look at http://daniel.holba.ch/harvest/handler.py?pkg=transmission
(10:36:56 AM) dholbach: it lists a lot of bugs that were resolved-upstream and a few fedora patches
(10:37:04 AM) dholbach: let's take 291205 as an example
(10:37:30 AM) dholbach: you will see that the bug is "confirmed" in Ubuntu and that it's "fix released" in the upstream bug tracker
(10:37:36 AM) dholbach: now click on "transmission-trac #1317"
(10:37:46 AM) dholbach: it will take you to the upstream bug tracker
(10:38:01 AM) dholbach: it says the bug is fixed and the milestone is 1.40
(10:38:26 AM) dholbach: if you investigate some more, you will see that neither Ubuntu nor Debian has that new version
(10:38:32 AM) dholbach: so we're going to package it ourselves
(10:38:54 AM) dholbach: first: try to make sure you have a line like this one in your /etc/apt/sources.list
(10:38:57 AM) dholbach: deb-src http://de.archive.ubuntu.com/ubuntu/ intrepid main restricted universe multiverse
(10:39:04 AM) dholbach: replace "intrepid" with whatever you're running
(10:39:14 AM) dholbach: run this afterwards
(10:39:18 AM) dholbach:   sudo apt-get update
(10:39:34 AM) dholbach: now run
(10:39:38 AM) dholbach:   apt-get source transmission
(10:39:50 AM) dholbach: this will download the current source package for transmission
(10:41:06 AM) dholbach: now change into the directory that it created
(10:41:12 AM) dholbach: (transmission-<version number>)
(10:41:37 AM) dholbach: <charlie-tca> QUESTION: am I the only one with transmission-trac 1153?
(10:41:46 AM) dholbach: charlie-tca: which Launchpad bug were you on
(10:41:47 AM) dholbach: ?
(10:42:04 AM) charlie-tca: 291205
(10:42:15 AM) dholbach: charlie-tca: try https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/292929
(10:42:18 AM) ubot5`: Launchpad bug 292929 in transmission "transmission 1.34 inhibits hibernation by default" [Undecided,Confirmed]
(10:43:01 AM) dholbach: alright
(10:43:26 AM) dholbach: if you check the contents of the directory, you will see a directory called "debian" in the source code
(10:44:07 AM) dholbach: I can't go into too much detail here, I'll give out a few links about packaging later on, for now I'll just say: this directory contains all the changes that are necessary to make a package out of the source code
(10:44:17 AM) dholbach: basically "make it build the Debian/Ubuntu way"?
(10:44:25 AM) dsto: cd .
(10:44:39 AM) dholbach: what we'd normally do is the following:
(10:44:53 AM) dholbach:  - go to the homepage of the software developers of transmission
(10:44:59 AM) dholbach:  - download the new source code
(10:45:28 AM) dholbach:  - apply all the changes to the new version that were necessary for the old version
(10:45:35 AM) dholbach: luckily we have tools to make that easier for us :)
(10:46:03 AM) dholbach: please open  ~/.bashrc  (or the equivalent if you use another shell) in your favourite editor
(10:46:09 AM) dholbach: and add something like the following to it:
(10:46:19 AM) dholbach: export DEBFULLNAME='Daniel Holbach'
(10:46:19 AM) dholbach: export DEBEMAIL='daniel.holbach@ubuntu.com'
(10:46:28 AM) dholbach: save the file and run
(10:46:33 AM) dholbach:   source ~/.bashrc
(10:46:39 AM) dholbach: (or restart your terminal)
(10:46:57 AM) dholbach: that way the variables will be set in your session and the tools we're going to use now will pick them up
(10:47:25 AM) dholbach: if you run
(10:47:29 AM) dholbach:   cat debian/watch
(10:47:56 AM) dholbach: you will see one of the files in the debian directory that will make the process of "download the new version, unpack it, apply the changes, etc." a lot easier
(10:48:00 AM) dholbach: please run
(10:48:03 AM) dholbach:   uscan --download
(10:48:34 AM) dholbach: it will then check which new versions are available and get them for us
(10:49:03 AM) dholbach: that worked out OK?
(10:49:38 AM) dholbach: if you take a look at  debian/changelog  now, it will probably look somewhat like this: http://paste.ubuntu.com/68884/
(10:50:09 AM) dholbach: the first thing we do is change "intrepid" to "jaunty" - we can't upload to intrepid anymore, because it's released already
(10:51:45 AM) dholbach: the next thing, which is very important, but which we're going to skip because of time concerns is: explicitly list all the bugs that were fixed in Ubuntu with the new version in a format similar to this: http://paste.ubuntu.com/68885/
(10:52:08 AM) dholbach: the (LP: #12345678) syntax will then automatically close all the bugs when the package gets uploaded
(10:52:42 AM) dholbach: <weboide> QUESTION: if we want to package for jaunty, do we have to change the 'pbuilder create' then?
(10:53:02 AM) dholbach: weboide: yes, if you want to be a good developer, you might even want to run the development release, so you can test things properly
(10:53:38 AM) dholbach: https://wiki.ubuntu.com/UbuntuDevelopment/UsingDevelopmentReleases has more information how you can do that in a sane and safe way
(10:53:45 AM) dholbach: <itnet7> Question: When you close a bug with comments can you edit those comments to include further info if necessary?
(10:54:27 AM) dholbach: itnet7: yes, good point: it's important to be very verbose in the changelog because the next developer who touches the package (we maintain everything as a big team) needs to know what you changed and why
(10:54:51 AM) dholbach: OK, if you take a look at the debian/patches directory you will see a couple of patch files there
(10:55:09 AM) dholbach: the people who worked on the package before needed to apply them apparently
(10:55:26 AM) dholbach: 10_fix_crasher_from_upstream.dpatch is included in version 1.40b1 already, so we can delete it
(10:55:39 AM) dholbach: make sure to remove it from debian/patches/00list as well
(10:55:58 AM) mode (+o jcastro ) by ChanServ
(10:56:53 AM) dholbach: my changelog entry looks like this now: http://paste.ubuntu.com/68887/
(10:57:40 AM) dholbach: did that work our alright for everybody?
(10:57:56 AM) volo: hi
(10:58:42 AM) dholbach: oh, I just found another thing... it seems that since the last time the package was built, some library packages changed their name
(10:58:42 AM) Aeoris_: gekki
(10:58:44 AM) Aeoris_: *hello
(10:58:49 AM) Aeoris_ is now known as Aeoris
(10:58:54 AM) dholbach: so please also change libcurl-dev to libcurl4-openssl-dev in debian/control
(10:59:00 AM) dholbach: sorry, I just found it out now
(10:59:11 AM) dholbach: then please run
(10:59:14 AM) dholbach:   debuild -S -us -uc
(10:59:20 AM) dholbach: this will generate a new source package
(10:59:34 AM) dholbach: now please run
(10:59:39 AM) Aeoris: hey dholbach, back on berlin? ;)
(10:59:40 AM) dholbach:   cd ..; sudo pbuilder build transmission_1.40b1-0ubuntu1.dsc
(10:59:58 AM) dholbach: this will start the build process for the new version
(11:00:18 AM) dholbach: I'm a bit sorry we had to rush through the whole process a bit quickly now
(11:00:29 AM) dholbach: please all bookmark this one:    https://wiki.ubuntu.com/MOTU/GettingStarted
(11:00:44 AM) dholbach: because it links to all the necessary links (like the packaging guide, like the tutorial videos, etc)
(11:01:00 AM) dholbach: and also to the SponsorshipProcess which explains how to get packages uploaded to Ubuntu
(11:01:10 AM) dholbach: thanks a lot everybody - I hope you all had as much fun as I did! :)

MeetingLogs/openweekintrepid/BugFixing (last edited 2008-11-07 19:30:26 by pool-70-16-60-167)