/srv/irclogs.ubuntu.com/2009/06/25/#ubuntu-classroom.txt

=== nhandler changed the topic of #ubuntu-classroom to: Ubuntu Classroom || https://wiki.ubuntu.com/Classroom || https://lists.ubuntu.com/mailman/listinfo/ubuntu-classroom || Now: Testing your packages using pbuilder || Run 'date -u' in a terminal to find out the UTC time
nhandlerHello everyone. My name is Nathan Handler, and today we will be learning about pbuilder.01:00
nhandlerCan I have a quick show of hands from anyone who is here for the session?01:00
Quintasan\o01:00
mschaferHowdy.01:01
* mbt raises his hand01:01
nhandlerIf at any point in the session you have a question, feel free to stop me in order to ask it.01:01
sdennie\o01:01
nhandlerWhen packaging, it is very important to test that the package builds prior to uploading it to the official repositories.01:01
nhandlerTest building allows us to catch and fix mistakes before the package is made available to thousands of other users.01:02
evanrmurphysorry I'm late01:03
nhandlerThe majority of uploads for Ubuntu are for the development release (currently Ubuntu 9.10, Karmic Koala). However, due to the unstable nature of the development release, many developers prefer to stick with a slightly more stable release.01:03
nhandlerNo problem evanrmurphy ;)01:03
nhandlerThis is where pbuilder comes into play.01:03
nhandlerpbuilder allows developers to create and manage a minimal Ubuntu chroot.01:04
nhandlerThe great thing about pbuilder is that the chroot can be for any version of Ubuntu, not just the one you are currently running.01:04
nhandlerThis allows developers to package for the development release while still running the latest stable release on their computers.01:05
nhandlerA pbuilder chroot only contains the core essential packages. This allows developers to verify that their build dependencies are correct.01:05
nhandlerOnce a package is done building in pbuilder, the chroot is left untouched. This means that it can be used to build multiple packages without worrying about it getting cluttered with extra files and applications.01:06
nhandlerRight about now, you should be starting to see why so many developers use pbuilder to test their packages prior to uploading.01:06
nhandlerFor those of you who attended Dustin Kirkland's session about Personal Package Archives (https://wiki.ubuntu.com/Packaging/Training/Logs/2009-05-07), you might be wondering why you would want to use pbuilder instead of simply uploading to your PPA on Launchpad.01:07
nhandlerThere are a few reasons you might want to do this.01:07
nhandlerFirst, PPAs only support building packages for amd64, i386, and lpia. However, Ubuntu builds packages for several other architecutres. You can use pbuilder to test that your package will build on these archs.01:08
nhandlerSince Launchpad PPAs are used by thousands of users, there is a delay between the time you upload your package and the time it begins to build. This delay does not exist with pbuilder (you also do not need to upload the package).01:09
nhandlerpbuilder also has several other benefits that will be discussed later.01:09
nhandlerEarlier, I mentioned that pbuilder was for creating and managing Ubuntu chroots. That was only partially true.01:10
nhandlerpbuilder can also be used to create and manage Debian chroots. This is very useful for users who contribute to both Ubuntu and Debian.01:10
nhandlerYou can also have multiple chroots for different Ubuntu and Debian versions. I personally have a chroot for intrepid, jaunty, karmic, and sid.01:11
nhandlerFinally, for those of you running amd64, you can also use pbuilder to build i386 packages. However, you can't build amd64 packages on i386.01:11
nhandlerThe ~/.pbuilderrc file is what you will use to configure pbuilder.01:12
nhandlerAll developers have a slightly different system for handling multiple chroots with pbuilder.01:12
nhandlerI keep all of my pbuilder stuff on an external hard drive, and I have a special script to help me switch between my multiple ~/.pbuilderrc files. I have made these files available in a bazaar branch: lp:~nhandler/+junk/pbuilder01:13
nhandlerIf you decide to use my scripts, be sure to modify the varaible at the top of the files so that it has the correct path.01:13
nhandlerYou can then do '/media/pbuilder/switchPbuilder karmic' to switch to the karmic pbuilderrc file. Note that this will cause you to lose your current ~/.pbuilderrc file (if it exists). You might want to back it up first.01:14
nhandlerThe above command assumes that you places the pbuilder files at /media/pbuilder. If they are anywhere else, your command will be slightly different01:14
nhandlerIf this is the first time using the pbuilderrc file, you will need to do a 'sudo pbuilder create' before you can do anything.01:15
nhandlerAny questions?01:15
sdennieYes, but I'll wait.  ;)01:15
nhandlerOk sdennie01:16
nhandlerNow we will take a look at pbuilder hooks.01:16
QuintasanI have a suggestion if you allow :P01:16
nhandlerGo ahead Quintasan01:16
Quintasanif you are new to pbuilder and need many chroots, try using .pbuilderrc form ubuntu wiki -> https://wiki.ubuntu.com/PbuilderHowto#Multiple pbuilders01:17
nhandlerQuintasan: I link to that later. The issue with that is that the setup on the wiki does not work well for other scripts that run pbuilder for you.01:18
nhandlerThis is because you need to pass a dist option to pbuilder each time with that setup01:18
nhandlerQuintasan: However, thank you for linking them to the wiki page (I was going to do that later ;) )01:19
nhandlerNow, back to hooks01:19
nhandlerHooks allow us to extend the functionality of pbuilder to make our lives easier.01:19
nhandlerI use 3 hooks with pbuilder: B10list-missing (list missing files), C10shell (drops to shell upon FTBFS), and D10aptupdate (run apt-get update before anything).01:20
nhandlerI have created a bazaar for these hooks as well: lp:~nhandler/+junk/hooks01:21
nhandlerYou can place them in /media/pbuilder/pbuilder/hooks. Be sure to leave the prefix on the filenames.01:21
nhandlerHooks beginning with B<digit><digit><name> are executed after the build system finishes building successfully and before copying back the build result.01:22
nhandlerC<digit><digit><name> hooks are executed after build failures and before cleanup01:22
nhandlerD<digit><digit><name> hooks are executed before unpacking the source inside the chroot.01:23
nhandlerThere are several other prefixes that you can use for your hooks. You can read more about them in the pbuilder manpage.01:23
nhandlerNow, to test out using pbuilder, we are going to try and build the hello package.01:24
nhandlerBefore doing this, make sure you have 'deb-src http://archive.ubuntu.com/ubuntu/ karmic main' in your /etc/apt/sources.list (This line for other Ubuntu versions should work as well) or the ubuntu-dev-tools package installed.01:24
nhandlerYou can now do 'apt-get source hello' or 'pull-lp-source hello karmic' to download the hello source package.01:25
nhandlerThis should consist of a .diff.gz, a .dsc, and a .orig.tar.gz. We will now build the binary package using pbuilder.01:26
nhandlerType 'sudo pbuilder build hello_*.dsc' to start building the binary. You can use 'sudo pbuilder build --logfile build.log hello_*.dsc' if you want to store the build log to a file.01:26
nhandlerIf you are using my pbuilder files, you should now look in /media/pbuilder/pbuilder/result/karmic, and you should see a nice .deb that you can install (if you want).01:27
evanrmurphylog since 00:01 UTC, for those who just came: http://paste.ubuntu.com/203246/01:27
nhandlerYou have successfully built the hello package in pbuilder!01:27
nhandlerAny questions/problems so far?01:28
sdennienhandler: Yes01:28
nhandlerGo ahead sdennie01:28
sdennienhandler: You didn't describe how pbuilder was creating the toolchain for the distro you planned to build against or what the technology was to allow that to happen.  I'm assuming some fakeroot magic for the latter.01:28
nhandlersdennie: That magic lies in the /usr/lib/pbuilder/pbuilder-createbuildenv file.01:30
nhandlerThat file uses debootstrap to create the chroot01:31
sdennieExcellent.  That's answers the first part.01:31
sdennieOr maybe both parts01:32
sdennieAnyway, don't let me stop you.  We can chat offline if I have more questions.  :)01:33
nhandlersdennie: debootstrap is the technology that allows it to happen. If you want to get more detailed, feel free to take a look at the debootstrap source, but that is a little more advanced than we will go tonight ;)01:33
sdennieFair enough.  Proceed.  ;)01:34
nhandlerIf you are not using the D10aptupdate script. be sure to run 'sudo pbuilder update' prior to building a package. This will make sure that your chroot has access to the latest packages in the repositories.01:34
mschafernhandler:  So pbuilder-createbuildenv installs both the toolchain and the other packages marked essential?01:34
nhandlermschafer: Yes, it will take care of creating a chroot with all of the packages you need for a very minimal Ubuntu/Debian installation which resembles the build daemons01:35
mschaferOkay, thanks.01:35
nhandlerNow, I want to show you all a few more uses for pbuilder.01:36
nhandlerThere are several instances where having a clean environment to run a script would be useful.01:36
nhandlerYou can login to a pbuilder chroot using 'sudo pbuilder login'. Once you exit (Ctrl+d), the chroot will go back to the way it was, just like when building a package.01:37
nhandlerIf for some reason you want to save your changes to the chroot (i.e. If you update the /etc/apt/sources.list file), you can pass the --save-after-login option to the pbuilder command.01:37
nhandlerA few weeks ago, Daniel T Chen showed us how to use piuparts to test our packages (https://wiki.ubuntu.com/Packaging/Training/Logs/2009-04-23). By using the --basetgz or --pbuilder flags, you can have piuparts use your pbuilder chroot for testing packages.01:38
nhandlerAny more questions?01:38
evanrmurphynhandler: Yes.01:38
nhandlerGo ahead evanrmurphy01:39
evanrmurphynhandler: You made a comment about pbuilder-dist earlier. Do you recommend not using it?01:39
nhandlerevanrmurphy: I didn't mention pbuilder-dist earlier. I was talking about the method described on the wiki page for handling mulitple pbuiler chroots01:40
nhandlerI personally do not use pbuilder-dist, but I know a lot of developers who love it.01:40
evanrmurphynhandler: I got an error on the example you showed until I realized I had to replace "pbuilder-dist <version>" with "pbuilder", so I can see it complicates examples. ;)01:40
Ampelbeinnhandler: yes. there are cases where pbuilder won't fail to build, yet the buildd's will. I was given the advice to add pkgbinarymangler as extra build-dep to resemble more closely the buildds. are there any more tweaks like that?01:41
nhandlerAmpelbein: Yes, you can use 'sudo pbuilder create --debootstrapopts --variant=buildd' when creating the chroot01:42
nhandlerFor those of you who are interested in pbuilder-dist, it is part of the ubuntu-dev-tools pacakge01:42
nhandler* package01:42
nhandlerI would suggest reading the pbuilder-dist manpage to learn about it, as its usage is slightly different than pbuilder01:43
Ampelbeinok, thanks.01:43
evanrmurphynhandler: thanks01:43
nhandlerIf you are interested in learning more about pbuilder, I would suggest reading:01:43
nhandlerThe pbuilder manpage: http://manpages.ubuntu.com/manpages/karmic/en/man8/pbuilder.8.html01:44
mschafernhandler:  I had been using a fresh install in a virtual machine to do builds in the past.  Sounds like pbuilder is better because it gives the minimal set of other packages.  Would you recommend pbuilder over a VM?  Any other reasons for or against?01:44
nhandlermschafer: I would suggest using pbuilder over a VM01:44
nhandlerOne reason is that it is more like the buildd's than a VM01:45
nhandlerYou also have the ability to use pbuilder hooks with it, which really are useful for debugging FTBFS issues01:45
mschaferCan you use pbuilder on an Ubuntu system to run a Debian chroot?01:45
nhandlermschafer: Yes. As I said earlier, I have both Ubuntu chroots and a Debian sid chroot01:46
nhandlermschafer: A pbuilder chroot is also generally faster and easier to use than a VM01:47
mschaferThough I would imagine that I would still need a Debian VM to actually run the application, since I'm pretty sure that Gnome is not an essential package and therefore not in the pbuilder chroot.01:47
nhandlermschafer: pbuilder will *not* help you test that the applications actually runs. It just tests that it builds01:47
mschaferAh, gotcha.01:48
nhandlerAnd it will pull in any Build-Depends that it needs in order to build the package01:48
sdennieThat's a good point.  Does the application build outside the chroot and install/deb inside the chroot?01:48
nhandlersdennie: It doesn't install the binary .deb file that it builds. However, the file is placed outside of the chroot so that you can access it later01:48
sdennienhandler: Right.  That's what I mean.  But, does the building happen in the chroot or does it download every dep you may need every time within the clean chroot?01:49
ajmitchall of the compilation happens in the chroot (which is why you can setup ccache in the pbuilder config)01:49
nhandlerIf you want, you can login to a pbuilder chroot and modify the /etc/apt/sources.list file to use your PPA in order to satisfy Build-Depends as well01:49
nhandlerLet me give you guys a few more links that might help01:49
sdennieajmitch: Thanks.  :)01:49
nhandlerThe Kubuntu Ninja Build Environment wiki: https://wiki.kubuntu.org/Kubuntu/Ninjas/BuildEnvironment01:50
ajmitchsdennie: a clean chroot is used for each build, but a cache of previously downloaded build dependencies is kept01:50
sdennieajmitch: Very cool.  Thanks.01:50
nhandlerThe last link talks about creating an environment that takes advantage of multiple chroots and hooks.01:50
nhandlerAll of the hooks I mentioned today can be found in lp:~kubuntu-members/pbuilder/pbuilder-hooks01:51
nhandlerAny last comments or questions?01:52
sdennieInteresting stuff nhandler.  Thanks a lot for the presentation.01:52
nhandlerYou are welcome sdennie. Logs of this session will be available at https://wiki.ubuntu.com/Packaging/Training/Logs/2009-06-2501:53
mschaferThank you, nhandler.01:53
nhandlerSince we have a few minutes, does anyone have any comments/suggestions about the series of Packaging Training Sessions we have been holding?01:54
nhandlerAny topics that you would like to see covered?01:54
QuintasanThanks for session nhandler, I'm not so new to pbuilder but I learned lot's of intresting things (super ultra top secret ninja hooks :>)01:54
mschaferI noticed there was a recent session on packaging Java apps, but I haven't read the logs.  A session on Python apps would be good for me.01:55
QuintasanI'm intrested in packaging core KDE things01:55
nhandlermschafer: That is something that we should probably have. We do have a session on packaging Perl apps coming up as well ;)01:55
nhandlerQuintasan: There is a Kubuntu Tutorial Day next week you might like Quintasan01:55
nhandlerQuintasan: You also might be interested in JontheEchidna's packaging training session: https://wiki.ubuntu.com/Packaging/Training/Logs/2009-06-1801:56
nhandlerAny other comments/suggestions?01:56
evanrmurphynhandler: Thanks. I'm still wading through the tutorials and trying to get oriented in the Ubuntu dev world.01:57
mschaferI'm currently working with a package that depends on other packages, but the dependencies are heavily patched.  Perhaps this is just something that I should learn from an experienced packager, but if it's meaty enough for a training session, that would be good.01:58
mschaferMaybe a session for gnarly dependencies or something like that.01:58
nhandlermschafer: I'm not sure I understand what your suggestion is.01:59
* Quintasan scans thorugh the LP branches he got, lots of reading01:59
evanrmurphynhandler: Are there sessions for other aspects of developer work or is it focused on packaging? Or does packaging just about cover it?02:00
nhandlerevanrmurphy: Is there a certain aspect in particular you are interested in?02:00
mschaferProbably because I'm too clueless.  Let's see.  How does one package a software project when upstream has altered other software that are already in packages but don't have the upstream alterations?  As I said, this may be something that isn't of general interest.  But it's something I'm currently working through.02:00
nhandlerevanrmurphy: Pretty much, any topic related to Ubuntu development is fair game02:01
nhandlermschafer: Is there a reason for not updating the versions of the dependencies currently in the Ubuntu archives?02:01
mschaferThe dependency upstream doesn't have those changes.  The upstream of the package that I'm working on described their changes as so extensive, they're just shy of a fork.02:02
evanrmurphynhandler: Perhaps a panorama of how everything in the developer community fits together, a more zoomed-out overview. Then again, there's a good bit of that in the documentation.02:03
mschaferWell, this may not be a widespread problem.  It's just my current challenge, so I thought I'd mention it.  Don't want to take up any more of your night (morning).02:03
nhandlermschafer: Yeah, that is a little too specific in my opinion for a session, but feel free to ask questions in #ubuntu-motu about it02:04
mschafernhandler:  Thanks!  And thank you for your time tonight.  Very informative.02:04
nhandlerevanrmurphy: I think several people have touched on that in their sessions, but having a session dedicated to that wouldn't hurt02:04
evanrmurphythanks again for the good session02:05
nhandlerYou are welcome02:05
nhandlerAre there any more questions?02:05
nhandlerOk then, thanks for coming everyone02:06
nhandlerRemember, you can always find details about the Packaging Training Sessions at https://wiki.ubuntu.com/Packaging/Training02:07
=== nhandler changed the topic of #ubuntu-classroom to: Ubuntu Classroom || https://wiki.ubuntu.com/Classroom || https://lists.ubuntu.com/mailman/listinfo/ubuntu-classroom || Upcoming: || Run 'date -u' in a terminal to find out the UTC time
itnet7Thanks nhandler !02:15
evanrmurphynhandler: I don't know if you're still there. I hope you can answer this question when convenient:02:37
evanrmurphyI just installed the hello*.deb we made during the session, and I'm trying to figure out if it does anything I can test.02:39
evanrmurphyReading through the README right now... is there a hello world binary or something I should be able to find on the system and execute?02:40
nhandlerevanrmurphy: Type 'hello' in a terminal02:41
evanrmurphyoh!02:41
evanrmurphy:)02:41
evanrmurphyIt even did it in my chosen localization.02:42
evanrmurphynhandler: Thank you very much!02:42
nhandlerYou are welcome evanrmurphy02:47
oussamahi all03:43
oussamawho can help me learn ubuntu?03:43
pleia2oussama: the class schedule is in the topic03:44
oussamadate -u03:47
=== nizarus_ is now known as nizarus
=== yofel_ is now known as yofel
truthordarehy all.. i am new to this.. i have been using ubuntu since a long time.. and befor that was using debian and slackware..18:37
truthordarei was looking at web for participating in ubuntu and i found this link to the irc..18:38
=== croppa_ is now known as croppa
=== olujicz_ is now known as olujicz

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!