=== dave_m is now known as dmart === neverendingo__ is now known as neverendingo === mthalmei is now known as MichiSoft [13:45] hey [13:51] quit [14:11] hello [14:12] hello [14:24] What are the preparations required for today's session : Fixing small bugs in Ubuntu === openweek7 is now known as dlightle === qwebirc39867 is now known as iEternity [15:53] date-u [15:59] qwebirc47066, that goes into your terminal.:) [16:01] and you need a space: date -u [16:01] anyway.. I missed yesterday's "classes".. so.. yeah.. I wonder about today.. :) [16:02] shiki-: the IRC logs are posted if you want to read through them, not sure if you knew that [16:03] ah yeah I'll read them on the weekend.. for now, I only have time to keep up with the today's lessons/classes [16:04] ty for the hint anyway === Amaranth_ is now known as Amaranth === marvin_ is now known as Guest4654 [16:42] Ubuntu Developer Week starting in 18 minutes [16:43] hooray [16:51] 10 min .. waiting patiently [16:52] nice [16:52] awesome :) [16:54] how do i remove the join and quit parts? [16:54] am using xchat [16:55] and I pidgin, I have the same problem [16:55] right click on the channel [16:55] and in extra alerts set hide join [16:55] syedam, got it :) thanks [16:55] sorry in settings [16:59] __ [17:00] WELCOME TO ANOTHER GREAT DAY OF UBUNTU DEVELOPER WEEK! [17:00] Thanks dholbach [17:00] thx :) [17:00] Who do we have here for "Fixing small bugs in Ubuntu"? :-) [17:00] o/ [17:00] :) [17:00] me [17:00] me [17:00] me :) [17:00] me! [17:00] i am in [17:01] o/ [17:01] me :D [17:01] Hi [17:01] :) [17:01] ayay! [17:01] hi! [17:01] me [17:01] me [17:01] :) [17:01] me [17:01] :) [17:01] me [17:01] :) [17:01] hi all [17:01] *lurks* [17:01] me 2 [17:01] me [17:01] me [17:01] o/ [17:01] howdy [17:01] me [17:01] dholbach: QUESTION: do we need karmic for that? [17:01] me [17:01] hi [17:01] sum-it: I'll answer that in a sec [17:01] +m ? [17:01] 'lo [17:02] +1 [17:02] me [17:02] :) [17:02] * freelancer317 waving [17:02] OK dear friends of Ubuntu Development, let's get the session started! [17:02] for those of you who are new to Ubuntu Developer Week - this channel is muted, so please head over to #ubuntu-classroom-chat and ask questions there [17:03] please make sure you prefix them with QUESTION: [17:03] If have problems following in English or want to ask a question in your local language, fine people in these channels might help you out: [17:03] * Catalan: #ubuntu-classroom-chat-ca [17:03] * Danish: #ubuntu-nordic-dev [17:03] * Finnish: #ubuntu-fi-devel [17:03] * German: #ubuntu-classroom-chat-de [17:03] * Spanish: #ubuntu-classroom-chat-es [17:03] * French: #u-classroom [17:04] To answer sum-it's question: no you don't necessarily need karmic for this session, but as I said yesterday, please have a look into https://wiki.ubuntu.com/UbuntuDevelopment/UsingDevelopmentReleases [17:04] if you're interested in developing Ubuntu it's important that you run the devel release in some form [17:04] some sane form like a virtual machine, etc. [17:04] alright my friends: quick preparations for those of you who weren't here yesterday [17:05] sudo apt-get install --no-install-recommends bzr ubuntu-dev-tools devscripts dpkg-dev cdbs [17:05] also please enable "Sources" in System -> Administration -> Software Sources -> Ubuntu Software [17:05] also please add something like this to your ~/.bashrc file: [17:05] export DEBFULLNAME='Daniel Holbach' [17:05] export DEBEMAIL='daniel.holbach@ubuntu.com' [17:05] save it and run [17:06] source ~/.bashrc [17:06] please don't use MY NAME [17:06] thanks :-) [17:06] we covered this in yesterday's session so please either read the logs or ask somebody in #ubuntu-classroom-chat to help you [17:06] ok... we want to fix simple bugs in Ubuntu [17:07] I took the liberty of choosing a few that I think we should get done :-) [17:07] please all take a look at https://bugs.launchpad.net/ubuntu/+source/edubuntu-addon-meta/+bug/404608 [17:07] it talks about a small typo in a package description [17:08] so to get the source code, please run: [17:08] apt-get source edubuntu-addon-meta [17:08] now please [17:08] cd edubuntu-addon-meta-0.12 [17:08] as explained yesterday you can find things like the package description in debian/control, so please open that file in your favourite editor [17:09] ah and there the bug is... "form" in the last line [17:09] please change it to "from" [17:09] save the file [17:09] ok... just a bit of background about debian/control: [17:10] the first stanza is always about the source package (refer to yesterday's log or to https://wiki.ubuntu.com/PackagingGuide) [17:10] the stanzas afterwards (just one in this case) describe the binary packages (the resulting .deb files) [17:10] alright, as far as we can see this should fix the bug [17:10] one thing I mentioned yesterday too is documentation [17:11] we need to document the change we just did in debian/changelog [17:11] luckily there's a nice tool in the devscripts package called dch that makes the job of editing the changelog a lot easier [17:11] so if you set up ~/.bashrc with DEBEMAIL and DEBFULLNAME and ran source ~/.bashrc please now run: [17:11] dch -i [17:12] this will create a new changelog entry and increment the version number [17:12] if you look at the entry closely, you'll see that it always starts with the source package name [17:12] then there's the version number which I'll get back to in a sec [17:12] next is the release in which we want to fix it in [17:13] the urgency is a debian-ism which we can ignore [17:13] next we have the entry which we still have to write, then our name, email and timestamp [17:14] ok, I talked about version numbers a bit yesterday [17:14] normally we'd add "ubuntu1" to indicate that we took a Debian package and modified it [17:14] in this case it's an Ubuntu only package [17:14] so instead of 12ubuntu1, we'll use 13 [17:15] now I'll put something like this as the actual changelog entry [17:15] * debian/control: replaced "form" with "from". (LP: #404608) [17:15] it's important to use a form like this (or similar)... what did I do? [17:16] - I described which file I touched [17:16] - I described what I did [17:16] - I mentioned the bug number in a special format [17:16] it's important that you provide as much information as possible [17:16] the bug report usually has all that information and enables others to revisit the bug and better understand why you did your changes [17:17] also did I use (LP: #404608) because only in the (LP: #xxxxxxxxxx) format the bug will be automatically closed on upload [17:17] alright... now save the file [17:17] now please run debuild -S [17:18] this will rebuild the source package (the .tar.gz and .dsc file) [17:18] it might ask you for your gpg key, but it's not necessary to sign it [17:18] now if you [17:18] cd .. [17:18] you should see edubuntu-addon-meta_0.12.dsc edubuntu-addon-meta_0.12.tar.gz edubuntu-addon-meta_0.13.dsc edubuntu-addon-meta_0.13.tar.gz [17:18] (and a few other files) [17:19] which means we successfully rebuilt the source package with our changes [17:19] QUESTION : why shouldnt we use debian/rules here to build the .deb again? [17:19] arvind_khadri: for this exercise we don't need to build the .deb and you might want to take a look at pbuilder for building packages (https://wiki.ubuntu.com/PbuilderHowto) [17:20] generally you're right though... if you want to fix a bug, you definitely need to test it too [17:20] now it'd be a bit much for this session [17:20] QUESTION: how do we know it's an Ubunty only package [17:20] bananeweizen: edubuntu should be a hint in this case, generally it's a bit harder to tell [17:21] https://packages.debian.org/src: should find the debian package if available [17:21] QUESTION: i did the debuild -S but it failed: clearsign failed: secret key not available, what do i do there? [17:21] noiz777: normally you'd sign a source package so you can upload it to a PPA for example [17:21] for this exercise it's not necessary [17:21] alright [17:21] now please run [17:22] debdiff edubuntu-addon-meta_0.12.dsc edubuntu-addon-meta_0.13.dsc [17:22] this will show you the diff between the old and the new version [17:22] if you run [17:22] debdiff edubuntu-addon-meta_0.12.dsc edubuntu-addon-meta_0.13.dsc > edubuntu-addon-meta.fix [17:22] it will give you a nice file to attach to the bug report [17:22] (remember: test it first :-)) [17:22] I'll talk a bit about sponsoring / patch review later on [17:23] so you know how to get your good fixes reviewed and included [17:23] first bug fixed :-) [17:23] ok... up next is https://bugs.launchpad.net/ubuntu/+source/qutim/+bug/346528 [17:23] please run: [17:23] apt-get source qutim [17:24] when I prepared the session the bug was still under app-install-data-ubuntu - it took me a bit to realise that the app-install-data is retrieved from lots of .desktop files from various packages [17:25] so if we fix it in qutim now, it should get fixed in the app-install-data too (for "Add/Remove...") [17:25] QUESTION: I obtained this: gpg: Signature made Thu Mar 19 18:05:37 2009 CET using DSA key ID 92742B33 [17:25] gpg: Can't check signature: public key not found [17:25] what does it mean? [17:25] EagleScreen: it means that the package was originally signed by somebody whose public key you don't have in your keyring - that's safe to ignore [17:25] alright [17:26] cd qutim-0.1 [17:26] grep -ri massanger * [17:26] this will search for "massanger" in all files, ignoring if it's upper case or lower case [17:26] seems like we have two files to fix [17:26] debian/qutim.desktop:GenericName=Instant Massanger [17:26] debian/qutim.1:qutIM \- Qt Instant Massanger [17:27] one of them is the .desktop file (that creates the menu entry) which is mentioned in the bug report [17:27] and also there's the manpage [17:28] now please run: [17:28] sed -i 's/Massanger/Messenger/g' debian/qutim.desktop [17:28] sed -i 's/Massanger/Messenger/g' debian/qutim.1 [17:28] this will replace Massanger with Messenger in both files [17:29] ok [17:29] now let's document our changes [17:29] please run [17:29] dch -i [17:30] 0.1-0ubuntu2 should be fine [17:30] and as a description of what we did, I chose [17:30] * debian/qutim.desktop, debian/qutim.1: replaced "Massanger" with [17:30] "Messenger" (LP: #346528) [17:30] (it's good practise to wrap lines at 80 characters) [17:31] bug number two fixed too :-) [17:31] QUESTION: isn't typo fixed a better discription in this case ? [17:31] roxan: sure, you can do that too - I usually prefer to explicitly mention what was wrong and how I fixed it :) [17:32] alright... let's talk a bit about sponsoring and patch review [17:33] once you have a nice patch, you obviously attach it to the bug report so people can check it out [17:33] but for it to be included in Ubuntu (if you can't upload source packages yourself yet), you need to subscribe the reviewers team [17:33] https://wiki.ubuntu.com/SponsorshipProcess explains the process in detail [17:34] essentially you subscribe ubuntu-main-sponsors for packages in main or restricted [17:34] and subscribe ubuntu-universe-sponsors for packages in universe or multiverse [17:34] they'll give you feedback and upload the patch once it's ok [17:35] QUESTION: I have a build problem: http://pastebin.ca/1550481 [17:35] EagleScreen: try installing qmake & qmake-dev [17:35] ^ for those of you wondering why debuild -S doesn't work in the case of qutim [17:35] thanks rugby471 [17:36] ok... let's move on to our third bug :) [17:36] some questions first [17:36] QUESTION: sometimes debdiffs take quite a while to be sponsored, what are the ways that I can make sure it get's uploaded as fast as it can? [17:36] rugby471: make sure the patch is tip top tested and documented very very well [17:36] so reviewers don't have to go into a very long feedback loop [17:36] usually you can ask in #ubuntu-devel or #ubuntu-motu too to get some help [17:37] QUESTION: can you find out using apt which repository a package comes from? [17:37] apt-cache showsrc qutim | grep ^Dir [17:37] QUESTION: When I want to submit a fix, what do I submit? The debdiff file only? [17:38] AntoineLeclair: yes in cases where you just submit a simple fix, yes [17:38] again https://wiki.ubuntu.com/SponsorshipProcess has more info on the topic [17:38] ok, our third bug is: [17:38] https://bugs.launchpad.net/ubuntu/+source/quickly/+bug/422212 [17:38] for those of you who attended yesterday's session, you will know what it is about [17:39] also you'll see that Markus Korn filed the bug after the session because he was interested in it :-) [17:40] in most cases you can safely use the "apt-get source" command to obtain the source [17:40] as I know that quickly is maintained in Launchpad's Code hosting (be sure to visit the session later this week!), we'll get the latest trunk of quickly and see if it needs fixing there [17:41] please run [17:41] bzr branch lp:quickly [17:41] this will get the latest trunk of quickly [17:41] this might take a little bit as it gets the whole history of quickly and its development [17:41] once it's done, please [17:41] cd quickly [17:41] grep -ri arborting * [17:42] which... again ... will search in all directories and check for upper and lower case alike [17:42] I get the following output: [17:42] bin/quickly: print _("Arborting.") [17:42] bin/quickly: print _("Arborting.") [17:42] quickly/tools.py: print _("Arborting.") [17:42] so three occurences we need to fix [17:43] these commands should get you there: [17:43] sed -i 's/Arborting/Aborting/g' bin/quickly [17:43] sed -i 's/Arborting/Aborting/g' quickly/tools.py [17:43] I don't have enough time to go into the use of the sed command, but "-i" means "replace in place" (so modify the file) [17:44] and the last "/g" means "fix all occurrences [17:44] QUESTION : What is a trunk exactly ? [17:44] Johan1: trunk is the development focus... usually projects use various branches in which small features or bugs are developed indepently of each other [17:45] once they're deemed ready, they're merged into 'trunk' [17:45] ... which gets released every now and then when it seems to make sense [17:45] software projects often work a bit differently because of how they are set up [17:45] in this case we want trunk [17:46] alright [17:46] once that's done, you can run [17:46] bzr diff [17:46] to have another look at your changes again [17:46] instead of documenting in debian/changelog, I'll show you something else this time [17:47] please run bzr commit --fixes lp:422212 -m "changed 'Arborting.' to 'Aborting.'" [17:48] this will commit the change (locally) and add the log message "changed 'Arborting.' to 'Aborting.'" to the revision history [17:48] you will be able to see it this way: bzr log | head [17:48] the other great thing is that when you push the change to launchpad, it will automatically link your branch to the bug report [17:49] http://bazaar-vcs.org/Documentation has more information on the topic [17:49] let's try to see if we manage to fix another bug: [17:49] https://bugs.launchpad.net/ubuntu/+source/qemulator/+bug/348172 [17:50] another nice typo [17:50] this time in the qemulator package [17:50] apt-get source qemulator [17:50] QUESTION: bzr log | head shows wrongly my e-mail, any thing similar to DEBEMAIL var? [17:50] EagleScreen: you're right... try bzr whoami [17:51] the qemulator case is a bit different [17:51] cd qemulator-0.5/; grep -ri snpashot * [17:52] will show you a few occurences [17:52] some in binary files (which we can't fix) - they are translation files [17:53] but before we go ahead and change Qemulator.pot and usr/local/lib/qemulator/qemulator.glade I need to explain something [17:53] in our qutim and edubuntu-addon-something case we edited files in the debian/ directory [17:53] these are files supplied by us (or other Ubuntu/Debian maintainers) [17:54] in the case of quickly we fixed it in trunk (so where the upstream developers work) [17:54] yesterday I talked a bit about how we make use of a .orig.tar.gz (that contains the source code that we get from the upstream software authors and which we don't change) [17:54] we merely add the "packaging" in the debian/ directory [17:55] so some maintainers decide to store patches that fix something in the source code of upstreams in debian/patches/ [17:55] if you [17:55] ls debian/patches [17:55] you'll find there's already a patch [17:56] https://wiki.ubuntu.com/PackagingGuide/PatchSystems goes into more detail about all the "patch systems" that maintainers use [17:56] we have 4 minutes left, so let's make it quick [17:56] run [17:56] what-patch [17:56] (from the ubuntu-dev-tools package) [17:56] and it'll tell you that the patch system is CDBS [17:56] so please run [17:56] cdbs-edit-patch fix-snapshot-typo [17:57] this will fire up a "sub shell" in which we fix the issue now [17:57] now please run [17:57] sed -i 's/snpashot/snapshot/g' Qemulator.pot usr/local/lib/qemulator/qemulator.glade [17:57] this should fix the issue in both places [17:57] now please hit Ctrl-D (or type 'exit') [17:58] if you now look at ls debian/patches/ [17:58] you'll see our patch file [17:58] now we'd just do dch -i again to document the change we just did [17:58] we'd say something like [17:59] * debian/patches/fix-snapshot-typo.patch: replace 'snpashot' with 'snapshot'. (LP: #348172) [17:59] done :-) [17:59] QUESTION: What's the best way of finding these 'easy' bugs that newbies stand a chance of being able to fix? [17:59] plumstead21: great one! [17:59] a few people wrote harvest which is supposed to find those low-hanging fruit [17:59] its current home is http://daniel.holba.ch/harvest [17:59] it's not very pretty, so some of us are working on https://wiki.ubuntu.com/Harvest/NewUI [17:59] if you're a web developer PLEASE help out! [18:00] dholbach at ubuntu dot com [18:00] thanks a lot everybody! [18:00] thanks dholbach :) [18:00] and please check out #ubuntu-motu for more help [18:00] thanks dholbach! [18:00] thanks. great talk [18:00] https://wiki.ubuntu.com/MOTU/GettingStarted too [18:00] thanks :) [18:00] thanks! [18:00] t [18:00] thanks! [18:00] thx dholbach [18:01] Thank You [18:01] <^arky^> thanks dholbach , another great session [18:01] well done [18:01] Next session : Kernel Triaging and Debugging [18:01] next up is Leann Ogasawara who will help us dive into Kernel Triaging and Debugging! [18:01] great class!!! [18:01] Hi Everyone! Welcome :) [18:01] * iulian waves [18:01] hii [18:01] Hello [18:01] My name is Leann Ogasawara and I help manage the Ubuntu Kernel Team's incoming and existing bugs against the kernel. [18:01] hi ogasawara [18:02] Having to deal with such a large volume of bugs is always a huge challenge for us. [18:02] note: chat and questions please in #ubuntu-classroom-chat [18:02] I thought this session would be a good opportunity to share some best practices I've learned along the way for triaging kernel bugs as well as share some information for helping debug issues. [18:02] We're always looking for more involvement from the community to help triage kernel bugs so hopefully after today's session some of you might be interested in helping out. [18:02] Let's first start with what the role of a kernel bug triager is. [18:03] The goal for any kernel bug triager is to get a bug into a state such that a developer can immediately being working on a fix. [18:03] Remember, as a triager we are often the first point of contact for a bug reporter. [18:03] It's important that we help move a bug into a good working state as well as help educate the bug reporter to submit better bug reports in the future. [18:03] So how does that happen? [18:03] First, we help make sure Ubuntu kernel bugs are assigned to the Ubuntu linux kernel package. [18:03] http://bugs.launchpad.net/ubuntu/+source/linux [18:04] For example, if someone is experiencing a kernel oops or panic, then that's obviously a kernel bug. [18:04] If a bug reporter did not correctly file the bug against the linux kernel package, help reassign the bug and kindly remind them to report future kernel bugs against the linux kernel package. [18:04] Failing to do so may result in the bug getting overlooked. [18:04] It may be helpful to also point them at https://wiki.ubuntu.com/Bugs/FindRightPackage . [18:04] Next, we want to make sure a bug is really not a duplicate of another bug. [18:05] This is where we as kernel triagers need to be careful. [18:05] Kernel bugs are usually hardware specific. [18:05] Just because someone may be experiencing the same symptom of another bug reporter doesn't necessarily mean they have the same bug. [18:05] When in doubt, don't mark it as a duplicate and ask for a second opinion. [18:05] Additionally, if you see someone comment on a bug and they don't have the same hardware, ask them to open a new bug report and explain why. [18:06] This really helps avoid bugs becoming wildly out of control and impossible for a developer to follow, let alone fix. [18:06] Next, help make sure the title of the bug as well as the bug description is informative. [18:06] "Sounds is broken" or "Suspend fails" is not informative. [18:06] Like I mentioned above, kernel bugs are usually hardware specific. It's always best to mention the affected hardware in the title as well as the bug description. [18:07] This will again help avoid bugs becoming a mess. [18:07] If you find you have the same hardware as a bug being reported, try to reproduce the bug yourself. [18:07] t's not unheard of for hardware to become faulty. [18:07] Being able to help confirm this is or is not the result of hardware going bad is important. [18:07] Also, be sure to document the steps to reproduce if possible. [18:08] Now I know the next part is sometimes a bit controversial, but it's also best if the issue has been confirmed against the latest kernel available. [18:08] I realize this is a touchy subject for some individuals and some reporters often object to always being asked to "test the latest". [18:08] However, when you are dealing with the kernel, keep in mind there are literally thousands of commits between each release. [18:08] Then consider that each commit touches more than just one line of code and you've now hit insanity trying to isolate one fix (if it even exists) for a single bug. [18:09] Finally, one of the most important aspects of traiging kernel bugs is making sure the appropriate log information is attached. [18:09] For the kernel this means dmesg output, lspci, kernel version info, etc. [18:09] I recommend that instead of asking bug reporters to attach these files individually, have them run apport-collect. [18:09] apport-collect will automatically gather and attach general linux kernel debug information for a bug. [18:10] For example, if we wanted kernel debug info attached to pretend bug 987654, the apport-collect command would look like: [18:10] apport-collect -p linux 987654 [18:10] The nice part about this is we're only asking the bug reporter to run a single command. [18:10] There's less room for error having a bug reporter run one command versus having a bug reporter run multiple commands. [18:11] Even better than reporting a bug and running apport-collect on it, is to use ubuntu-bug to report the bug in the first place. [18:11] This will automatically file the bug against the linux kernel package and again automatically gather and attach kernel debug info to the new bug. [18:11] The command looks like the following: [18:11] ubuntu-bug -p linux [18:11] In the process of attempting to triage a bug, if you've asked a bug reporter to provide more information, be sure to set the bug's status to Incomplete. [18:12] Also be sure to subscribe yourself to a bug so that you are automatically notified when they have responded with the requested information. [18:12] Once the bug looks ready for a developer to begin working on it, set the status of the bug to Triaged and make sure the Importance is set. [18:12] Note that being able to set a bug to Triaged and also to set the Importance requires that you be a member of the Ubuntu Bug Control team in Launchpad. [18:13] To learn how to join the ubuntu-bugcontrol team, refer to https://launchpad.net/~ubuntu-bugcontrol [18:13] I'd also like to bring up one last thing to keep in mind when triaging kernel bugs . . . and that's forwarding the bug upstream. [18:13] Before a bug can be forwarded upstream, it needs to be confirmed to exist when running the upstream kernel. [18:13] The Ubuntu kernel team has started building vanilla mainline kernel builds for users to test with. [18:13] See https://wiki.ubuntu.com/KernelTeam/MainlineBuilds [18:14] If a bug exists with the upstream kernel, the bug should be forwarded upstream so that the upstream kernel developers are also aware of the issue. [18:14] Additionally, it may be discovered that the bug is fixed upstream and we should pull in the fix back into the Ubuntu kernel. [18:14] If a bug has already been reported to the upstream kernel bugzilla, http://bugzilla.kernel.org/ , we should make sure we set up an upstream bug watch from the Launchpad bug report to the upstream bug report. [18:14] See https://wiki.ubuntu.com/Bugs/Watches for more information on how to set an upstream bug watch. [18:15] That should pretty much cover the basics of kernel bug triaging. [18:15] As always, feel free to take a look at https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies for more information. [18:15] Now that we've touched on the basics, I'd like to take this opportunity to quickly mention Kernel Bug Days. [18:15] For the past couple months the Ubuntu Kernel Team has been organizing kernel bug days every 2 weeks. [18:15] https://wiki.ubuntu.com/KernelTeam/BugDay [18:16] The goal of each bug day is to triage and fix kernel bugs. [18:16] Typically each bug day also has a general focus, for example suspend/resume bugs. [18:16] The entire Ubuntu Kernel Team dedicates their day to focus on the bug day but we would also appreciate any community involvement! [18:16] Each kernel bug day always has a specific Community section which contains a list of suggested bugs for community members to work on. [18:17] And, it just so happens that we're holding a kernel bug day today! [18:17] https://wiki.ubuntu.com/KernelTeam/BugDay/20090901 [18:17] So, if anyone would be interested in helping out, this is a great starting point to begin triaging kernel bugs. [18:17] I'd be more than willing to help anyone get started, just ping me in #ubuntu-kernel on FreeNode after this session. [18:17] Ok, I think now is a good time to stop and take some questions before we move on. [18:18] nareshov> question: i have a wireless card that requires firmware i think (broadcom), how can i test mainline kernels? [18:18] nareshov: unfortunately that is one corner case where you won't be able to use the mainline kernels [18:18] nareshov: however, if you know which firmware is required, open a bug and let us know [18:19] ok moving on [18:19] For the debugging part of this session, I'd like to focus on some common types of issues I run into on a regular basis and how I go about debugging them. [18:19] The first type of issue I see reported rather frequently are update/install issues. [18:20] The majority of these bugs are usually reported via apport and will come in with general debug information already attached. [18:20] The important debug file to look at will be the DpkgTerminalLog file. [18:20] Usually, somewhere near the end of the DpkgTerminalLog file will hopefully be some error messages about what failed during the update/install. [18:21] For example, lets take a look at https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/398036 [18:21] falstaff|h> question: i've bug in karmic kernel, which is also in latest mainline kernel. Should I report the bug to the ubuntu kernel bug tracker or upstream? Or both? [18:21] falstaff|h: both would be great [18:21] falstaff|h: we can then link the launchpad bug report to the upstream one [18:21] ScottTesterman_> QUESTION: Today I noticed a bug report where the initial reporter had marked the bug "Confirmed," but there were no other reports to verify the bug. What's the best way of dealing with this if I cannot confirm the bug report? [18:22] ScottTesterman_: it's best to kindly remind bug reporters to no "Confirm" their own bugs [18:22] ScottTesterman_: unfortunately if you are unable to confirm yourself, the next best step is to make sure they have all the appropriate debug information attached [18:23] ok, back to bug 398036 [18:23] After examining the DpkgTerminalLog.txt file I noticed the following errors: [18:23] Merging changes into the new version [18:23] Conflicts found! Please edit `/var/run/grub/menu.lst' and sort them out manually. [18:23] The file `/var/run/grub/menu.lst.ucf-new' has a record of the failed merge of the configuration file. [18:23] User postinst hook script [/sbin/update-grub] exited with value 3 [18:24] As you can see, this is really an issue with grub which caused the kernel to fail to install. [18:24] Having seen this error message before I knew this was a duplicate of bug 269539. [18:24] Notice that prior to marking the bug as a duplicate I pasted the error message into a comment in the bug report. [18:25] Recall that I mentioned earlier that part of our job as a triager is to educate the bug reporter. [18:25] Pasting this information into the bug informs the bug reporter which debug file I looked at to find the error, what the error was, and why I marked it as a duplicate. [18:26] Now I know some may be thinking, "How am I supposed to know which bug this would be a duplicate of?!?!". [18:26] Well, having triaged many of these types of bugs myself, I took the liberty to write up a DebuggingUpdateErrors wiki for the kernel: [18:26] https://wiki.ubuntu.com/KernelTeam/DebuggingUpdateErrors [18:26] That wiki documents all the common kernel update/install bugs I've come across, what the error message looks like, and what the master bug is. [18:26] Sometimes you won't even want to mark the bug as a duplicate as it could be Invalid. [18:27] For example, if someone ran out of disk space while trying to upgrade, that's not a kernel bug. [18:27] This type of bug is usually indicated by a "gzip: stdout: No space left on device" line in the DpkgTemrinalLog file. [18:27] The kernel has no control over how much free disk space someone has :) So this is just an invalid bug and they need to free up space. [18:27] The next question some may have is "Why can't the errors be detected automatically when the bug is reported?". [18:28] The answer is it can! [18:28] For the majority of the bugs I've documented in that DebuggingUpdateErrors wiki, we've also written an ubuntu-bugpattern. [18:28] https://code.launchpad.net/~ubuntu-bugcontrol/apport/ubuntu-bugpatterns [18:28] If a bug is filed with apport and we've written a bugpattern to match it, the bug reporter will be notified that they do not need to file a new bug and they will be directed to the master bug instead. [18:29] If there is no master bug, as in the example of someone running out of disk space, they are directed to the DebuggingUpdateErrors wiki explaining the issue. [18:29] The ubuntu-bugpatterns are really helpful but some bugs still slip through. For example, if the error message were in Spanish instead of English, the bugpattern won't catch it. [18:29] Also, if someone didn't use apport to file the update/install bug, I ask them to take a look at https://wiki.ubuntu.com/DebuggingUpdateManager [18:29] The "Debugging Procedures" section outlines the debug files to gather and attach to the report. [18:30] Ok moving on to the next type of issue to debug . . . [18:31] The next common scenario I come across triaging kernel bugs is kernel regressions :( [18:31] First when any regression is reported, it's important that it gets tagged as a regression. [18:31] At the bottom or each bug report's description there should be a "Tags" line and a yellow pencil edit icon to add, remove, or update a bug's tag(s). [18:31] There are usually 4 different regression tags that kernel bugs will use: [18:32] 1) regression-potential - A bug discovered in the development release that was not present in the stable release. [18:32] For example, right now Karmic is known as the development release and Jaunty is the previous stable release. [18:32] If someone finds a regression while testing Karmic while we are still in the development phase, this would be tagged "regression-potential". [18:32] 2) regression-release - A regression in a new stable release. [18:33] For example, when Karmic officially releases and a regression is found, this would be tagged "regression-release". [18:33] regression-potential bugs could very well become regression-release bugs. [18:33] 3) regression-update - A regression introduced by an updated package in the stable release. [18:33] For example, if Jaunty released a new kernel update and if a regression were discovered, this would be tagged "regression-update" [18:33] 4) regression-proposed - A regression introduced by a package in -proposed [18:34] Prior to any updates being released, packages sit in what's called -proposed. See https://wiki.ubuntu.com/Testing/EnableProposed . If a regression is found in -proposed, this would be tagged "regression-proposed" [18:34] https://wiki.ubuntu.com/QATeam/RegressionTracking documents these tags in more detail. [18:34] Also see the regression tracker for the existing list of known regressions: [18:34] http://qa.ubuntu.com/reports/regression/regression_tracker.html [18:35] The regression tracker will automatically update with any bugs which get tagged as a regression. [18:35] The kernel team reviews regressions on a weekly basis so making sure they are tagged appropriately will make sure they get on the team's radar. [18:35] The next important part when dealing with regressions is to try to narrow down when the regression was introduced. [18:35] Recall that I mentioned earlier that there are thousands of commits between each kernel release. [18:36] If we just look at Jaunty which released with a 2.6.28 based kernel and Karmic which will release with a 2.6.31 based kernel, there's likely going to be over 37,000 commits. [18:36] Narrowing down those 37,000 commits is going to be key in helping the kernel team quickly find where the bad commit is. [18:36] What I like to do to help narrow down the regression (ie find the bad commit) is to do what we call a rough bisect. [18:37] A rough bisect basically involves selecting a working and non-working kernel and then systematically selecting a kernel in between the two to test. [18:37] Depending if the kernel in between works or not, we adjust the known working and non-working kernel and repeat the process until we can narrow down the working and non-working kernel as closely as possible. [18:37] This is where I like to use the mainline kernel builds since they're already built and ready to test. [18:38] So lets use a scenario that someone says they can suspend/resume just fine using Jaunty. [18:38] They just recently updated to Karmic and are running a 2.6.31-8.28 kernel and their system is hanging on resume. [18:38] First, I like to confirm that the regression is not an Ubuntu specific regression. [18:38] To do this I ask the bug reporter to test the mainline kernel which the current Ubuntu kernel was based on. [18:39] I don't expect anyone know know off the top of their head which mainline kernel an Ubuntu kernel was based on. [18:39] This is why I'd encourage you to use http://kernel.ubuntu.com/~kernel-ppa/info/kernel-version-map.html [18:39] This maps every Ubuntu kernel version to the mainline kernel version they were based on. [18:39] Examining the kernel version map, we see that 2.6.31-8.28 was based on mainline 2.6.31-rc7 [18:40] As a result I'd point the bug reporter to the 2.6.31-rc7 mainline kernel build and ask them to test. [18:40] http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.31-rc7 [18:40] If they confirm the bug remains, it's a good assumption this was a regression introduced by an upstream change. [18:40] Assuming this is the case, I want to get confirmation that this is still working with the upstream kernel Jaunty was based on. [18:41] Again looking at the kernel version map I see that Jaunty released with a 2.6.28-11.42 Ubuntu kernel which was based on the 2.6.28.9 upstream kernel. [18:41] So I of course ask them to test http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.28.9/ [18:41] Then we will have established that 2.6.28.9 is our working kernel and 2.6.31-rc7 is our non-working kernel. [18:42] Now we have to pick a kernel in between, so lets pick 2.6.30 [18:42] http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/ [18:42] We ask the reporter to test this and just for example sake, lets say the bug reporter tests 2.6.30 and notes that it is suspending/resuming just fine. [18:42] So now lets pick a kernel between 2.6.30 and 2.6.31-rc7, say 2.6.31-rc3 [18:43] http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.31-rc3/ [18:43] And again for example sake, lets say the reporter again says 2.6.31-rc3 works. [18:43] Now lets ask them to test 2.6.31-rc5, http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.31-rc5/ [18:44] And agian for example sake, lets say 2.6.31-rc5 still works after they test. [18:44] Now we finally ask them to test 2.6.31-rc6, http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.31-rc6/ [18:44] And lets suppose they come back this time and report 2.6.31-rc6 fails to resume. [18:44] So now we've narrowed down the regression between 2.6.31-rc5 and 2.6.31-rc6. [18:45] This is definitely a big help, however there are still 578 commits between -rc5 and -rc6. [18:45] Examining the timestamps for each of those builds, you'll notice that 2.6.31-rc5 was built on 01-Aug-2009 and 2.6.31-rc6 was build on 14-Aug-2009. [18:46] The nice thing is the Ubuntu kernel team also provides mainline daily kernel builds. [18:46] http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/ [18:46] So now we can apply the same rough bisect idea but use the daily kernel builds. [18:46] We can then hopefully narrow down between which exact two dates the regression was introduced. [18:47] So just for example sake and to speed things along, lets say we narrowed down the regression between daily kernel build 10-Aug-2009 and 11-Aug-2009. [18:47] Looking at the 10-Aug-2009 build log, http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2009-08-10/BUILD.LOG [18:47] I see this was built based on commit f4b9a988685da6386d7f9a72df3098bcc3270526 - "Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6" [18:47] Likewise looking at the 11-Aug-2009 build log, http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2009-08-11/BUILD.LOG [18:48] I see this was built based on commit 85dfd81dc57e8183a277ddd7a56aa65c96f3f487 "pty: fix data loss when stopped (^S/^Q)" [18:48] There are now only 45 commits between these two builds. [18:48] Pointing a developer to examine 45 commits is much more manageable than asking them to examining 37,000+ commits or even 578 commits. [18:49] From that point a developer should be able to post additional test kernels to narrow down the exact offending commit which is causing the regression. [18:49] Unfortunately I have not yet documented this rough bisect process in a wiki yet. [18:49] If anyone is feeling ambitious, feel free to document it and I'll be more than happy to proof read :) [18:50] So I wanted to leave the remaining time to field any questions. [18:50] I apologize if I didn't get to something you were hoping I would. [18:50] I would however point you to our KnowledgeBase that contains lots of good additional debug information. [18:50] https://wiki.ubuntu.com/KernelTeam/KnowledgeBase [18:50] syedam> QUESTION : instead of using a bisect approach cant we see what files were touched in a paticular commit and check that commit and use this with the bisect method [18:51] syedam: indeed each commit outlines the changed set of files, and you could much more quickly do a bisect off of that [18:52] syedam: however that would require having some git knowledge and knowing how to build your own kernel [18:52] syedam> QUESTION: is there an easy way to build and package kernels [18:53] syedam: indeed there are. I'd take a look at https://help.ubuntu.com/community/Kernel/Compile [18:55] any other questions? if not we'll end just a few minutes early and I'll turn it over to didrocks. [18:55] bas89> QUESTION: If my system crashes, what are the main signals that the kernel was responsible for it? [18:55] bas89: the most noticeable indication will probably be a kernel panic [18:56] bas89: sometimes it'll get logged to dmesg, but sometimes you'll just see it flashed to your terminal and that's it [18:56] bas89: it's always best to capture as much of the panic as possible if you report it in a bug [18:56] Quarth> QUESTION : Are changes classifyed or someway seachchable by any classification method (like key words or subsystems, layers., sections..)? Real case: i have a problem with my lapton screen resolution, starting with 31-4 runs fine, starting with 31-8 is wrong. Should I use the bisect approach or there's a better way? [18:57] Quarth: if you are familiar with git you could list all the changes based on a subsystem, if not I'd suggest using the bisect approach [18:57] syedam> QUESTION: are the mainline / daily kernels built with debugging info [18:58] syedam: unfortunately I don't think so. I believe there is actually an existing bug report in Launchpad requesting this [18:58] falstaff|h> question: It also happend to me that ubuntu just freezed... Magic Keys worked, can i get the last output of dmesg after rebooting? syslog doesnt contained them.. [18:58] falstaff|h: try examining /var/log/kern.log.0 which should contain logs for a few boot cycles [19:00] Ok, I'll turn it over to didrocks who'd going to teach you how to update a package. [19:00] Thanks everyone! [19:00] Thanks a lot ogasawara and congrats! [19:00] I'll wait for a couple of minutes before beginning :) [19:01] In the meanwhile, you can install a few packages: [19:01] sudo apt-get install build-essential devscripts ubuntu-dev-tools debhelper diff patch quilt fakeroot lintian libtool gnome-common gnome-doc-utils gtk-doc-tools [19:01] and ensure you have "deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted" in /etc/apt/sources.list (and then executes sudo apt-get update) [19:03] DING DONG, it's time to get started and fire some package updates! [19:04] just to know a little about the audience, who is ready to update some packages? (answer on #ubuntu-clasroom-chat) :) [19:05] waow, some people there! For those who don't know the basics/can't practice, there will be a lot of copy/paste in pastebin so that you can follow the lesson :) [19:06] you can follow the session and do what I type in a jaunty ubuntu box [19:06] just ensure you installed and changed what I said earlier ^ [19:06] I will begin with a very generalist introduction so that people can follow what will be in this lesson [19:07] didrock should I change jaunty for kamic? [19:07] Quarth: no no, really, I adapted the lesson so that you can use jaunty :) [19:08] so, just drop the "deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted" line [19:08] ok, some introduction: [19:08] As most of user want to live on the edge about what best the Open Source community has to offer, we are going to see how to update a package to offer the very last release to all ubuntu users. [19:08] First, be warned that once a release is out and for all supported releases (jaunty soon!), we never update a package to a new software version (appart from backports repository and ppa, when requested). [19:09] We only cherrypick bug and security fixes from a new release to adapt it an older version. This is intended to have as little breakage as possible. [19:09] So, that why OpenOffice 3 didn't do it into Intrepid. On the contrary, Jaunty that I hope all of you use, have it :) [19:10] do you have any queston about what can be elected as an update, and what can't? [19:11] apparently, everyone knows, so, I'm going on :) [19:11] Today, we are going to update gnome-terminal. We will see quickly what are the different steps we have to handle generally to update packages, but the best is, of course, to practice! [19:12] Even if I use bzr-buildpackage now to work on, we will not use it today. The Unstoppable James Westby will give an introduction on this this week [19:12] Also, this lesson is not intended to teach you how to package. For this, see the corresponding courses in last developpers week session (https://wiki.ubuntu.com/UbuntuDeveloperWeek). Don't forget also the excellent packaginguide: https://wiki.ubuntu.com/PackagingGuide. [19:12] ell, ready? Let's download the current version of gnome-terminal: [19:12] mkdir gnome-terminal && cd gnome-terminal && apt-get source gnome-terminal [19:13] This will download the last release present in jaunty, which is 2.26.0. [19:13] tell me on -chat when you are ready :) [19:14] ok, most of people seems to be ready. Let's get into the source package: cd gnome-terminal-2.26.0 [19:14] To check if new release is available, if a debian/watch file is present, we just have to use: uscan --report --verbose. [19:15] The output should be something like this: http://paste.ubuntu.com/262929/. You can see there that a new version is available and corresponds to 2.27.91 [19:15] QUESTION: in which package is scan command? [19:16] EagleScreen: it's not scan, but _uscan_ [19:16] this one will be pull as a dep of devscripts (see before for compulsory package) [19:17] (remember, you have to download this: sudo apt-get install build-essential devscripts ubuntu-dev-tools debhelper diff patch quilt fakeroot lintian libtool gnome-common gnome-doc-utils gtk-doc-tools) [19:17] (and yes, that's a bunch :) [19:18] so, 2.27.91 is out. Excited by this new version? \o/ Let's get the new upstream code using uscan! This command just download the new archive, and extract its contents, whith the debian/ubuntu changes applied! [19:18] so, just executes uscan this time, with no option :) [19:19] The output of the command is telling us that we have to do a "cd ../gnome-terminal-2.27.91" to get into the new package, let's do it [19:19] you should get something similar to that: http://paste.ubuntu.com/262930/ [19:20] is everything finished? :) [19:20] wow that is easy going! [19:20] false friend, we have still a lot to do :) [19:21] Easy, isn't it? Well, when the debian diff doesn't apply because of inline patch, it's getting more difficult, but most of packages are in good shape and every debian difference from vanilla version are [19:22] in a seperate debian/ folder [19:22] So, now, the hard begins :) [19:22] hard work* [19:22] just to precise what's done when executing uscan: [19:23] - it's downloading the vanilla tar file, [19:23] then, trying to apply ../gnome-terminal-2.26.0-0ubuntu2.diff.gz diff file [19:23] (this file contains the debian/ diff) [19:23] it also adds a new entry in debian/changelog to update to last version [19:23] QUESTION: What is the difference between inline patches and patches under debian/patches? [19:24] trothigar: in short, inline patches is bad (in my opinion) :) [19:24] so, inline patches add diff in diff.gz, but those diffs applied directly to files [19:25] patches under debian/patches enables still to use uscan, even if the patch won't apply in the new sources [19:25] (we will experience that later ^^) [19:25] bas89> QUESTION: Does uscan get that new version from upstream? What happens if there is an ubuntu-customized version of gnome-terminal on our harddisk? [19:26] uscan looks at debian/watch to know where to fetch the original tarball [19:26] if you downloaded it manually, you can use the uupdate [19:26] this command will do the same thing than uscan, without downloading it (run it in your source package as well) [19:26] in fact uscan calls uupdate :) [19:27] QUESTION: What methods does uscan work with, tarballs, bzipped, svn?... [19:27] from what I know, it works with tarballs and bzipped (if we just get origin tarball target) [19:28] Now begins the real packager work. We have to see what changed in upstream release reading the NEWS files (less NEWS and q to exit): http://paste.ubuntu.com/262931/ [19:28] This is mostly a bugfix release. We will see later what has been fixed. Now, let's discover what changed in configure.{ac,in} file: diff -Nup ../gnome-terminal-2.26.0/configure.ac configure.ac [19:28] You will get http://paste.ubuntu.com/262933/ [19:29] Here are the most important changes for a packager from previous version to the last release [19:30] What matters for us? gt_version_minor and gt_version_micro changed to tell that a new version is available. That's just tell that upstream did a good job. [19:30] If it's not present, there is for librairies something like SHVER for library that you have to change in debian/rules. In every cases, it's good to give a look at debian/rules to see if the version number is [19:30] present in this file (debian/rules) [19:30] Ok for everyone? [19:31] What is most important here is the GTK_REQUIRED and VTE_REQUIRED change. That means that we have to bump the dependencies version request of the package (it will request now 2.14.0 for gtk and 0.20.0 for the new version) [19:32] You can edit it with your prefered tool (vim ROCKS \o/) and change libgtk2.0-dev (>= 2.13.6) and libvte-dev (>= 1:0.19.1) to libgtk2.0-dev (>= 2.14.0) and libvte-dev (>= 1:0.20.0). [19:32] those changes have to take place in debian/control.in [19:33] QUESTION: what's the difference between control and control.in? [19:33] hehe, that was my next sentence :) [19:33] So then, as there is a debian/control.in file, we have to generate a new debian/control file from it. This is proceed by executing: DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean [19:34] so, debian/control.in is used to generate debian/control [19:34] it generally adds some automation to debian/control, like last uploaders update, @GNOME_TEAM@ in debian is replaced by the debian gnome team mailing list [19:35] Finally, inform of your change! dch -a and add to the file so that it will look like: http://paste.ubuntu.com/151422/. You see that the so kind uscan command has automatically created "gnome-terminal [19:35] oupss, wrong pastebin, correct one is:http://paste.ubuntu.com/262934 [19:35] You see that the so kind uscan command has automatically created "gnome-terminal 2.27.91" [19:35] tell me when it's done :) [19:36] (the diff diff files between old and new configure.in files can also tell us from added/removed dependencies btw. There is no black packager magic there :D) [19:37] Ok, now that build dependencies are ok, we have to see if ubuntu/debian patches still apply to the new version. The what-patch commands tells us that this package usescdbs. Let's try using cdbs-edit-patch debian/patches/99_autoreconf.patch (last patch of the list) [19:38] why this http://pastebin.ca/1550600 ? [19:39] this command is to update debian/control from debian/control.in [19:39] the fakeroot is to simulate that we are root even if we aren't :) [19:39] (most debian/rules commands must be launched as root) [19:40] DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes is used to desactivate some stuff done by "debian/rules clean" as we just want to update debian/control.in [19:40] to make this successfully, you need to have gnome-pkg-tools [19:40] (that's why I listed it at the begining ^^) [19:41] ok, so, what happened when we tried to apply the patch? [19:41] We exited in error in the debian/patches/30_honour_point_pixel_sizes.patch [19:41] That can mean two things: either upstream has integrated the patch (or we took previously the patch from upstream svn), or that the code has been slightely modified and we can't apply it easily. [19:42] Looking at debian/changelog has to be the first thing to do: http://paste.ubuntu.com/151431/ [19:42] QUESTION: how can I change the text editor that dch uses by default? [19:42] EagleScreen: just change the environment EDITOR variable, or use update-alternatives [19:43] In this case, we see a bug report LP: #345189 associated to the patch. Looking at it (https://bugs.launchpad.net/bugs/345189), we deduce that the change is present upstream, looking at the Fix Released [19:43] so, the fix has been fixed upstream [19:43] Consequently, we can safely remove the patch, "rm debian/patches/30_honour_point_pixel_sizes.patch" as it's no more useful [19:44] If it wasn't the case and the cause was that upstream changed slightely its code, we had to cdbs ....patch and adapt it to make it apply [19:44] (cdbs-edit-patch .patch) [19:44] I try to not use too many abbreviations, sorry :) [19:45] QUESTION: so Fix Released at launchpad means the patch is applied to trunk? [19:45] frandieguez: you have upstream task and package task on LP [19:45] if upstream task is written as fixed release, they rolled a tarball with the fix [19:46] if package task is set to fix released, that mean that at least, the fixed version is in the development distribution (presently, karmic) [19:46] So, when something is fixed upstream, we can remove the patch [19:47] That's why we have always to report our patch upstream (appart from specific ubuntu ones) :) [19:47] it's good for them, less work for us, everyone wins \o/ [19:47] Ok, bring this information to debian/changelog: dch -a and report the change to make it look like that: http://paste.ubuntu.com/262937/ [19:48] so, if the patch was an inline patch, uupdate/uscan would have failed [19:48] (as the patch will be directly in diff.gz) [19:48] so, this will more clutter our work [19:49] Ok! Let's go on with next patch: $ cdbs-edit-patch debian/patches/99_autoreconf.patch again. [19:49] The last patch doesn't apply /o\ [19:49] That's pretty normal: autotools/autoconf/autoreconf patch are different from others patches. They basically consist of generating configure scripts from configure.in, makefile.in on (yes, the famous ./configure is generated there!) [19:49] We have to exit first, without updating the patch: "exit 1" [19:50] (exit 0 update the patch, exit 1 update it) [19:50] oupss [19:50] (exit 0 updates the patch, exit 1 does not update it) [19:50] that's better :) [19:50] (for those interested: a good introduction about patch system is there: https://wiki.ubuntu.com/MeetingLogs/devweek0809/PackagePatches [19:51] so, now, we will regenerate the patch from scratch [19:51] what you can do, is to remove the patch: "rm debian/patches/99_autoreconf.patch" [19:51] creating a blank one again: $ cdbs-edit-patch debian/patches/99_autoreconf.patch [19:52] (it will again drop you in a subshell) [19:52] then, let's regenerate new configure and makefiles: to generate the configure and makefiles: autoreconf [19:52] so, this takes Makefile.in to create Makfile, configure.in to create configure, and so on. [19:53] Once done (ignore the warnings), exit 0 to refresh the patch and document the change: dch -a to get http://paste.ubuntu.com/262940/ [19:55] We have almost finished: every patches applies and build-dependencies are ok. Normally, you testbuild at this stage, but we won't do it as we are running out of time [19:56] Once done, a good practice is to put changes from the upstream NEWS file in the changelog. So, get the changes following the given link in the NEWS file and report it to the changelog. [19:56] once this extra bonus point is done, you will get this: http://paste.ubuntu.com/151454/ [19:57] You can take a breath now! You have your new package updated! Think about testing it throughly and everything will be all right. [19:57] Last thing to note is to check which bugs are fixed in current upstream release, find them on launchpad to be able to close them as well by referencing them in debian/changelog. [19:57] This can sometimes take a lot of times. [19:57] time* [19:58] ok, that's all for this session, there are 3 minutes left for question, you can fire up quickly :) [19:58] ho do i get my updated version into the karmic repos? [19:59] bas89: you should give a look to the sponsoring process until you have upload rights: https://wiki.ubuntu.com/SponsorshipProcess [19:59] bas89: btw, this package is already updated. I picked it because it was interesting with a lot of issues :) [19:59] QUESTION: if say you have a small patch, is it better to try and get it applied upstream and the update the package, or write a debian patch? [20:00] rugby471: upstream is always the best choice. If you really feel you need it into the last version of ubuntu, apply in both places [20:00] QUESTION: if a LOCO Team make new translations to a package why this is don't commited to the repository in order to make that release more completed... ?? I ask when the release of ubuntu has do [20:01] (this will be the last question) [20:01] frandieguez: frankly, I don't know a lot about translations, but new versions are dropped in localized packages which are updated regularly, even when the new version is released [20:02] thanks all for all your question, I'll still be in -chat for a couple of minutes, don't hesitate to ask remaining questions [20:02] now, the stage is opened to leonardr [20:02] thanks didrocks [20:03] he will teach you about blackmagic on pythonlaunchpadlib :) [20:03] My name is Leonard Richardson. I'm on the Launchpad Foundations team and I'm the co-author of the O'Reilly book "RESTful Web Services". [20:03] I'm here to talk about the Launchpad web service API--how to use it and what advances have been made since the last UDW. [20:03] I'll do an infodump for a few minutes and then take your questions for the rest of the hour. [20:04] If you have questions during the infodump, just put them in #ubuntu-classroom-chat. [20:04] I give this infodump at every UDW, so it may be familiar to you. I ask you to bear with me so I can get everyone up to speed. [20:04] 1. Intro [20:04] First thing to know is that we've got docs talking about the API here: https://help.launchpad.net/API [20:04] Put simply, we've created an easy way for you to integrate Launchpad into your own applications. [20:04] f you perform the same tasks on Launchpad over and over again, you can write a script that automates the tasks for you. [20:04] You don't have to rely on fragile screen-scraping. [20:05] If you're a developer of an IDE, testing framework, or some other program that has something to do with software development, you can integrate Launchpad into the program to streamline the development processes. [20:05] If you run a website for a project hosted on Launchpad, you can get project data from Launchpad and publish it on your website. [20:05] And so on. You can use the API to do most of the things you can do through the Launchpad web site. === NoX is now known as Guest50806 [20:05] 2. Tools [20:05] The simplest way to integrate is to use launchpadlib, a Python library we've written. [20:05] see https://help.launchpad.net/API/launchpadlib, ubuntu package python-launchpadlib) [20:06] This gives you a Python-idiomatic interface to the Launchpad API, so you don't have to know anything about HTTP client programming: [20:06] >>> launchpad.me.name [20:06] u'leonardr' [20:06] >>> launchpad.bugs[1].title [20:06] u'Microsoft has a majority market share' [20:06] But it's also easy to learn the API's HTTP-based protocol and write your own client in some other language. [20:06] (see https://help.launchpad.net/API/Hacking) [20:06] 3. Progress and Roadmap [20:06] At the last UDW I said that the web service publishes information about people, bugs, code branches, archives, and the launchpad registry (the projects, milestones, etc.) [20:06] Here's what's been published since then (AFAIK): [20:07] * The translation import queue (more or less read-only) [20:07] * Lots of distro stuff i don't understand, like package uploads and package sets [20:07] * Merge proposals and code reviews [20:07] * Project releases [20:07] * The hardware database [20:07] The future: [20:07] Publication through the web service is still not a priority for translations (apart from the import queue, which is done), answers, or blueprints. [20:07] Work on publishing new things on the LP web service has slowed down since the last UDW, since most of Launchpad is published now. [20:08] Right now I'm working on making the underlying library (lazr.restful) an attractive option for anyone who wants to publish a web service. [20:08] We are also working on improving the client. [20:08] So, that's the infodump, i invite your questions. [20:08] leonardr: I have used python-launchpadlib in memaker and I loved it's simplicity, however the one gripe I had with it was the very first authentication request the user has to do with launchpad, is there any plans/thoughts on how to make this a bit less clunky? [20:09] rugby471: yes [20:09] this work is tracked in bug 387297 [20:10] basically, the workflow is the way it is because we wanted to exploit the fact that the user already trusts their web browser with their launchpad credentials, where (no offense) they don't trust your application [20:11] because developers dislike this workflow to the extent that they're hacking around it, we've decided to create some alternate trusted clients [20:11] instead of opening up the user's web browser, you'll be able to run a console trusted client app, a gtk client app, etc [20:11] it'll be similar to the pinentry application [20:12] this is kind of on the back burner while i work on lazr.restful, but it is in progress [20:12] any other questions? [20:13] QUESTION: are there libraries for other languages, like ruby? [20:13] the only other library i know of is the one we wrote in javascript to use in launchpad ajax code [20:14] if you know of a good wadl library for a language, it's not difficult to write a launchpadlib-like library on top of it [20:14] just read in the wadl file that describes launchpad's capabilities [20:14] however, wadl libraries are not very common [20:15] in addition to taking questions, if anyone attending this chat has written a library that uses launchpadlib, or integrated the web service into an applicatino, i'd like to hear about it [20:15] i'll collate what you say and put it in at the end so people can see what's been done already [20:18] #ubuntu-classroom-chat is a little quiet, but i'll be here until bdmurray takes over in 40 minutes [20:19] as long as we're here i'll talk a bit about the server side of things [20:19] which is what i'm working on now [20:20] i'm running a project called lazr.restful [20:20] https://edge.launchpad.net/lazr.restful [20:20] this used to be part of launchpad and was split out and made open source a few months before launchpad was [20:21] it's a zope application that publishes data model objects through a web service [20:21] for the past couple of months i've been working on making it appealing to people who don't use zope [20:21] right now we have the zope application hidden behind a piece of wsgi middleware [20:22] and i've been able to use it internally to publish django model objects [20:22] so pretty soon it should be usable by the zope-phobic [20:22] QUESTION: are there some "hello world" examples on say, how to mass-process bugs etc [20:23] there are several example scripts in launchpadlib/examples, and there's a big pile of them about to be added to that directory (i'm not sure from where) [20:23] let me see if there's one on there dealing with bugs [20:24] it's actually samples/, not examples/, and there is no bugs code there [20:24] i can work up something live, right now [20:25] so, i've got a python session going, and i've got the api reference in my web browser [20:25] that's https://edge.launchpad.net/+apidoc/ [20:26] two steps to operate on a bunch of bugs: 1. identify the bugs, 2. operate on them [20:27] if you need an example, change all xorg.0.logs to plain/text :) [20:27] ok, i'll do what i can [20:27] we start by navigating to the bugs [20:27] >>> xorg = launchpad.projects['xorg'] [20:28] i'm looking at https://edge.launchpad.net/+apidoc/#project for something that will help [20:28] (i don't actually know the lp api very well, as i only wrote the framework) [20:29] i think it might be smarter to go in through https://edge.launchpad.net/+apidoc/#bugs [20:31] ok, an introspection method, xorg.lp_operations, shows an operation called 'searchTasks' [20:31] that'll get us closer to the bugs [20:32] i'll just get the new tasks: [20:32] >>> tasks = xorg.searchTasks(status="New") [20:33] now we iterate over the tasks, find any attachments, and hack the attachments as per tormod's example [20:34] so let's take one task as an example; then the rest is just iteration [20:35] we have the task. the bug attachments are on the bug [20:35] 'bug' is a property of bug_task, so: bug = task.bug [20:36] each bug has a collection of attachments, so we iterate over bug.attachments [20:36] i'm just picking the first task, the first attachment, etc [20:36] so the code i've run so far is: [20:36] bugs = [x.bug for x in tasks] [20:36] bug = bugs[0] [20:37] attachment = [x for x in bug.attachments][0] [20:37] tormod points out: [20:37] I can not find "mime type" under https://edge.launchpad.net/+apidoc/#bug_attachment [20:38] that's because the bug_attachment object isn't the actual attachment [20:38] it's an entry in the database containing information about the attachment [20:38] the actual attachment is available as attachment.data [20:38] if you get attachment.data in launchpadlib you'll have a HostedFile object [20:39] i need to look up how these work... [20:39] i'm looking in https://help.launchpad.net/API/launchpadlib [20:39] https://help.launchpad.net/API/launchpadlib#Hosted%20files [20:40] rugby471 is familiar with these objects since a mugshot works the same way [20:40] we can get a filehandle on the object by opening it for read [20:40] and the mime type is an attribute on the filehandle [20:41] >>> handle = attachment.data.open() [20:41] >>> handle [20:41] [20:41] >>> handle.filename [20:41] 'Xorg.0.log' [20:41] >>> handle.content_type [20:41] 'text/plain' [20:42] so that content type is ok [20:42] but let's say we wanted to change it [20:42] because these files are stored in the launchpad librarian, you can't just change the content type and save, the way you can change a bug's description [20:42] you need to create a new librarian file [20:42] basically, open the filehandle for write, specifying the correct content type and filename. then write the content to the filehandle and close it [20:43] something like this [20:43] >>> old_name = handle.filename [20:43] >>> old_content = handle.read() [20:43] >>> write_handle = attachment.data.open("w", "text/plain", old_name) [20:43] >>> write.handle.write(old_content) [20:44] >>> write_handle.close() [20:44] not the most convenient code (because librarian files are write-once), but it's possible [20:44] so you'd do that for every bug in the xorg project that met your criteria [20:45] unfortunately there's no way to directly specify your criteria "bugs that have an attachment called Xorg.0.log with a content type other than text/plain" [20:45] you'll need to use some cruder criteria, such as new bugs, as i used [20:48] ^arky^ requested the code i just put up on pastebin: http://pastebin.ubuntu.com/263382/ [20:48] no guarantees that will work as is, but by using dir() you should be able to make it work [20:49] and that's how i proceed in general when writing these scripts [20:49] i don't know much about lp, but i use the introspection methods and the api doc to zoom in on where i want to be [20:49] do you have to delete the old file from the librarian then? or are they indexed by filename? [20:50] you can delete attachment.data with attachment.data.delete(). i don't think it's necessary. the old attachment will just stop beign referenced and will eventualyl be garbage collected [20:51] i believe they're indexed by a unique id that you never see. that's how there can be 10,000 different attachments all called Xorg.0.log [20:55] hm, i've been talking in classroom-chat by mistake [20:56] i'll paste in a few q & as [20:56] <^arky^> QUESTION: Can we use python-launchpadlib (1.5.1-0ubuntu1) to try these code examples [20:56] ^arky^: yes, but the first time you run one of these scripts you will need to give launchpadlib permission to access your launchpad account [20:56] what was dir() about? [20:56] tormod: you can use dir() on any launchpadlib object to see its capabilities are [20:56] so we also created a bunch of special introspection properties [20:56] described here: https://help.launchpad.net/API/launchpadlib#Getting%20help [20:56] a quick example of the introspection properties: [20:56] >>> launchpad.people['leonardr'].lp_entries [20:56] ['preferred_email_address', 'archive', 'team_owner', 'mugshot'] [20:56] lp_entries shows you the individual objects associated with some other object [20:56] in this case, an email address, an archive, another person (if leonardr were a team, it might have an owner), and a binary file (mugshot) [20:57] it's almost time for bdmurray to take over, so any last minute questions [20:59] i don't see bdmurray here (maybe he has some other alias) [21:00] leonardr: I'm here ;-) [21:00] before i go, one example of an app that integrates into launchpad, from rugby471 [21:00] I have integrated it into memaker for one click updating of the user's mugshot ( package memaker in karmic) [21:00] bdmurray: ah, i was looking to give you op, but you already have it [21:00] one more question before he takes over [21:00] leonardr, QUESTION: is the ability to change the content of an attachment a feature or a bug? [21:01] i don't know. you'd need to ask the bugs team. my guess is it's a feature [21:01] in general, it's a feature that you can replace the contents of a hosted file (like a mugshot), but maybe the bugs team wants you to upload a new attachment rather than modifying one [21:03] bdmurray, i yield the floor [21:03] leonardr: thanks! [21:03] Hi, my name is Brian Murray and I'm a member of the Ubuntu QA team. [21:03] I'm here today to talk about how you can get higher quality bug reports about packages that you care about. [21:04] You can do this by writing an apport hook for your particular package. [21:04] First off, what is apport? [21:04] Apport is a system which intercepts crashes right when they happen, in development releases of Ubuntu, and gathers useful information about the crash and the operating system environment. [21:05] Additionally, it is used as a mechanism to file non-crash bug reports about software so that we receive more detailed reports. [21:05] Let's look at a sample apport bug report - http://launchpad.net/bugs/416701. [21:05] The bzr package does not have an apport hook but some useful information is still collected. [21:05] We have the architecture, the release being used, the package version and the source package name. [21:06] Additionally, in the Dependencies.txt attachment we have information about the versions of packages upon which bzr depends. [21:06] Are there any questions about apport so far? [21:07] Okay then, carrying on. [21:08] So while all of that can be really useful an apport hook for a package allows us to gather specific information for that package. [21:08] For example, consider a bug report about usplash. [21:08] usplash has a dedicated configuration file, located at "/etc/usplash.conf", and this would be something quite helpful in debugging a usplash bug report but not very useful in other package bug reports. [21:08] Apport looks for package hooks in "/usr/share/apport/package-hooks/" for ones named after the package for which they will be used. [21:09] Looking in "/usr/share/apport/package-hooks/" lets take a look at the usplash hook - with the filename usplash.py. [21:09] The package hooks are written in python. [21:09] We can see that the usplash.py hook imports the apport.hookutils module - "from apport.hookutils import *". [21:10] hookutils is a collection of readymade and safe functions for many commonly used things. There are functions for attaching a file's contents, getting a command's output, grabbing hardware information and much more. [21:10] This package hook is using 'attach_file_if_exists' and 'attach_hardware'. [21:10] 'attach_file_if_exists' is pretty self explanatory but what does attach_hardware include? [21:10] Let's look at the hookutils module to find out. [21:11] You can use "python -c 'import apport.hookutils; help(apport.hookutils)'" or you can view it using codebrowse - http://bazaar.launchpad.net/~apport-hackers/apport/trunk/annotate/head%3A/apport/hookutils.py. [21:12] he 'attach_hardware' function starts at line 72. [21:12] As we can see it adds a wide variety of hardware information to a bug report which can be quite useful for some packages like the kernel and usplash! [21:12] Having the apport package hooks has reduced the amount of bug ping pong necessary to get information out of a bug reporter and having these convenience functions reduces the amount of work it takes to write a package hook. [21:13] In addition to 'attach_hardware' and 'attach_file_if_exists' other functions include: 'attach_conffiles', 'attach_dmesg', 'attach_alsa', 'command_output', 'recent_syslog', 'pci_devices' and 'attach_related_packages'. [21:13] In the event that you have a group of packages that would benefit from a shared convenience function, please file a bug about apport and include the function you'd like added. [21:14] Are there any questions so far? [21:15] < tormod> QUESTION: is there a way to present a question to the bug reporter? [21:15] tormod: yes, there actually is and this is a new feature of apport I'll be getting to shorty. [21:16] shortly even ;-) [21:17] Back to the usplash hook, we can see that the usplash configuartion file is added like so "attach_file_if_exists(report, '/etc/usplash.conf', 'UsplashConf')". [21:17] This means that a bug reported about usplash using apport should have an attachment named 'UsplashConf' and it will contain the reporter's usplash.conf file. [21:17] Looking at http://launchpad.net/bugs/393238 we can see this actually isn't the case. [21:18] Because usplash.conf is only 4 or 5 lines it ends up getting put into the bug description. However, most items end up getting added as attachments in Launchpad. [21:18] Regardless the information is still there and can help triaging the bug. [21:18] Now that we've covered what a hook can include lets's look at how to control when hooks are run. [21:19] In the totem hook, "source_totem.py", we can see there is a check to see if the hook was called due to a crash - "if report['ProblemType'] == 'Crash':". [21:19] If it is due to a crash the hook is not run. [21:19] If someone were reporting a bug, using ubuntu-bug or 'Help -> Report a Problem', the ProblemType would be Bug. [21:20] In this case the totem hook is only ran when the "ProblemType" is "Bug". [21:20] < thekorn> QUESTION: let's say I'm writing an apport hook which adds a log file, should this hook automatically purge sensitive data, what's best practice in such cases? [21:21] thekorn: let me find an example - I saw a hook that does some scrubbing recently [21:23] thekorn: there is one in mysql-dfsg-5.1 [21:24] http://pastebin.ubuntu.com/263396/ [21:24] you can see it is checking for the password in the configuration file and replaces it before attaching it to the report [21:25] I think this, scrubbing the data before uploading, is the best idea [21:26] Now to tormod's question ... [21:26] The totem hook is particularly interesting as it is utilizes interactive questions - which is a new feature in apport. [21:26] You can see how this works by executing "ubuntu-bug totem", but please don't actually report the bug! ;-) [21:26] The totem hook asks questions and runs tests to determine if the bug report is related to alsa, pulseaudio or codecs in gstreamer. [21:27] Well add of course totem itself. [21:27] The totem apport hook also sets the affected package appropriately. [21:28] The interactive questions can greatly reduce the amount of triaging work required and helps make the initial bug report much more complete. [21:28] More detailed information regarding how to use the hook user interface can be found in the python help for the available functions: "python -c 'import apport.ui; help(apport.ui.HookUI)'". [21:29] Are there any questions about the interactive questions or the convenience functions? [21:34] Now that we know a lot of what hooks can do, lets talk about how to write and test one. [21:35] After the last Ubuntu Developer Summit I compiled a list of packages that had recently received a fair number of bug reports and subsequently might benefit from an apport package hook. [21:35] That list can be found at https://wiki.ubuntu.com/QATeam/Specs/IncreaseApportCoverage. [21:35] Let's take rhythmbox from that list and write a simple apport hook for it. [21:36] I say simple because I'm not entirely certain what would be useful but thought these things might be. [21:36] < andresmujica> QUESTION: What's the purpose of the general-hooks available at /usr/share/apport/general-hooks ? [21:38] andresmujica: these are always run. For example if you look at the automatix.py one you can see ifi certain criteria are met the bug reports are not filed. [21:40] And the ubuntu.py checks to see if the package is an ubuntu one among other things. [21:40] The easiest way of writing and testing a package hook is to put one in "/usr/share/apport/package-hooks" named after the appropriate package. [21:40] I'll create one called "source_rhythmbox.py". [21:41] We'll import hookutils from apport and os, then in the add_info function we'll add the rhythmdb.xml file, if it exists, and gconf settings for rhythmbox. [21:41] The hook as written looks like http://pastebin.ubuntu.com/262850/. [21:41] Its really only 2 or so lines of code but now we'll have some potentially useful information in every rhythmbox crash or bug report. [21:42] After I've put this file in "/usr/share/apport/package-hooks" I can test it using "ubuntu-bug". [21:42] After running "ubuntu-bug rhythmbox", apport presents the user with a dialog asking them if they want to send the problem report. [21:42] In this dialog box we can see the complete contents of the report and if our collected information was attached. [21:43] I see a key named rhythmdb.xml which contains the same as the one on my system and a key named GconfRhythbox which contains my gconf settings for rhythmbox. [21:43] contains the same information that is ;-) [21:44] If you look at the compiz hook, source_compiz.py, you can see it includes a debugging portion so you can just execute it. However, I personally find this harder to parse. [21:44] That's really all there is to writing and testing an apport hook! [21:45] < andresmujica> QUESTION: Why source_rhythmbox.py and not just [21:45] rhythmbox.py ? [21:46] andresmujica: this way any binary package produced by rhythmbox would have the hook run for it. [21:47] This is less of an issue with rhythmbox but makes a lot of sense with other packages. [21:48] Like evolution for example [21:48] thekorn: the evolution hook is also a good example of data scrubbing [21:49] In the event that you write a hook for a package that you can not upload or need help getting sponsored, please report a bug about the package missing a hook. [21:49] Then add the hook as a patch (or a merge proposal) and subscribe me, brian-murray, and the appropriate sponsor's team to the bug report. [21:49] I'll work to ensure that it gets uploaded. [21:49] If you need any further help the apport code is very well documented and there are a few wiki pages about it - https://wiki.ubuntu.com/Apport and https://wiki.ubuntu.com/Apport/DeveloperHowTo. Additionally, you can find me in the ubuntu-bugs channel. [21:49] < sbarthelemy> QUESTION: in which package should the new apport-hook go, in apport or in rhythmbox? [21:50] apport hooks are distributed with the package that will use them [21:50] er, the package that will benefit from them [21:50] that's why I didn't have the mysql hook readily availabe as the package is not installed on my system [21:51] additionally, this make it easier for us as developers as we can just stick them in our packages and not have to muck with apport [21:53] < openweek4> QUESTION: will apport hooks work with 3rd party applications? [21:54] openweek4: I'm actually really not certain about that question. If you look at the ubuntuone-client hook - bugs get reported to Launchpad but about the ubuntuone project. So it might very well be possible. However, apport would have to be able to communicate with the appropriate bug tracking system. [21:55] < sbarthelemy> QUESTION: the apport hook is expected to be included in debian's own rhythmbox too? [21:55] sbarthelemy: most of the apport hooks are carried as a diff from what I have seen [21:56] Are there any more questions? [21:59] Alright well thanks for coming everyone and I hope this was informative. I look forward to seeing some more apport hooks!