/srv/irclogs.ubuntu.com/2009/07/16/#ubuntu-classroom.txt

qwebirc13575.02:06
qwebirc58483jh02:53
=== santiago-pgsql is now known as santiago-ve
SpinachHeadHi, how can I get a log of the July 16 Mono packaging chat?08:35
* directhex peeks from behind the curtain17:07
=== noodles775 is now known as noodles775-afk
=== k00011 is now known as k0001
=== qwebirc26473 is now known as avire
directhexso... is there some kind of grand announcement or something?19:01
directhexlike, an MC?19:01
antileetThere aren't any ops here either19:01
directhexyays.19:02
dnielsenit appears not, so let's just be daring rulebreakers and wing it19:02
pleia2directhex: nope, you just start :)19:02
directhexwell, yeah, it's looking that way19:03
pleia2there you go19:03
directhexhah!19:03
directhexokay then19:03
directhexMONO PACKAGING. GOOD, BLAH BLAH BLAH.19:03
* antileet starts tomboy to take notes19:03
directhexthere are people here with varying degrees of experience, so i'm going to start with the fundamentals, to try and bring everyone up to speed19:03
pleia2hehe19:03
directhexokay, firstly, a quick discussion of what packaging a Mono app or library means, as compared to a C app19:04
directhexMono apps and libraries are called "assemblies", coming in .exe or .dll files (not to be confused with Windows executables and libraries, which uses .exe and .dll extensions too)19:04
directhexassemblies contain cross-platform code, which any Common Language Runtime should be able to execute19:05
directhexon Ubuntu, we only have one CLR - Mono. Others include Microsoft Rotor (their shared-source runtime), Microsoft.NET (their proprietary runtime) and dotGNU Portable.NET (FSF's Mono equivalent)19:06
directhexAssemblies have properties similar to what we call "native" code (ELF binaries or shared libraries), such as a list of dependencies built in19:07
directhexthis is handy stuff for packaging, as it means we can automatically build a package's dependencies list based on the real-world dependencies on the library or executable19:07
directhexas an example, take a look at "monodis --assemblyref foo.exe" on something like, i dunno, /usr/lib/tomboy/Tomboy.exe19:08
directhexyou can see 17 entries listed, with a Name, Version, and Public Key as the important factors19:08
directhexgenerally, the "Name" field is the name of the library it needs, e.g. "Name=gnome-sharp" means it uses gnome-sharp.dll19:09
directhexthe "Version" field determines the ABI version of the assembly, which is a lot like a SONAME version in a native library.19:09
=== Traveler is now known as emakriya
directhexMono (and .NET) have the ability to use backward-compatible data for libraries, so if an app says "I need GTK# 2.8", and you have 2.12 installed, that's okay - as long as you have the compatibility data required. this compatibility data comes in the form of "policy" files. As another example, try doing "gacutil -l | grep gtk-sharp"19:11
directhexand you'll see things like:19:11
directhexpolicy.2.10.gtk-sharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f19:11
directhexthat's a compatibility entry19:12
directhexactually, a word on the GAC, since I just used it19:12
directhexthe GAC is a central repository for Mono libraries which are considered stable enough to be offered system-wide19:12
directhexif you ever package a library, you want it in the GAC if you want apps to be able to use it19:12
directhexfor something to go into the GAC, it needs to be cryptographically signed - hence the "PublicKeyToken" value from gacutil, and the Public Key value from monodis19:13
directhexthey need to match up!19:13
directhexand you can see here that they do19:14
directhexgtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f19:14
directhex3: Version=2.12.0.019:14
directhexName=gtk-sharp19:14
directhex0x00000000: 35 E1 01 95 DA B3 C9 9F19:14
directhexsee, app needs library, library in GAC, no problems!19:14
directhexokay, that's MORE than enough background, i think. any questions so far?19:14
directhexno?19:15
=== Traveler is now known as emakriya
directhexokay, on with the packaging specifics19:15
dnielsenhow and when would one in terms of packaging inject random stuff into the gac?19:15
directhexdnielsen, if you're packaging a library (which is much more complex than an app), then we have special helpers to handle the GAC for you19:16
dnielsenexcellent19:16
antileetdirecthex: So you're suggesting relying on assemblies in the gac rather than package them with your app?19:17
directhexantileet, if you're packaging a library, you need a good reason not to use the GAC19:17
directhexantileet, if you're packaging an app, then generally, you wouldn't use the GAC for app-related things19:18
directhexantileet, now, that gets mildly complex if the app bundles a lib19:18
antileetSay I use taglib-sharp in a project which I want to package19:18
directhexright19:18
antileettaglib-sharp is in my app, which I'm sure that Banshee installed19:18
antileet*taglib-sharp is in my gac19:18
antileetNow do I package my app without taglib-sharp assuming that the user will have it installed too?19:19
directhexuse the GAC copy, unless you have a very good reason not to. sometimes this may even involve patching your app's build system19:19
directhexand rely on the easy peasy packaging data to take care of the dependencies for you19:19
directhexwhich i'll get onto19:19
antileetOkay, I think I'll wait till the end of this first19:19
directhexdnielsen, in answer to your earlier one, here's an example of a all the extra voodoo required to GAC a library: http://svn.debian.org/wsvn/pkg-cli-libs/packages/mysql-connector-net-5.0/trunk/debian/libmysql6.0-cil.installcligac19:20
directhexright. PACKAGING19:20
directhexhopefully people went to james westby's DH7 talk. we love dh7 in Mono-land, as it makes life super easy.19:20
directhexwhat dh7 does is basically automatically do everything you might want to do, based on the input it gets given. where that input would be the usual debian packaging paraphenalia like debian/control19:21
directhexand dh7 is extensible - so the difference from a packager perspective between a non-mono app and a mono app is just 1 line (!)19:22
directhex"include /usr/share/cli-common/cli.make" in debian/rules19:22
directhexthis tells debhelper to include that file, which is in the cli-common-dev package - and that file basically injects a bunch of our super secret debian mono team into dh7's usual list of operations19:22
directhexand those new operations include things like "generate package dependencies based on Assembly chain"19:23
directhexso... a real-world example, right?19:23
directhexmy example for the day is "bansheelyricsplugin" which is a simple enough package, prepared by the lovely hyperair here, which still includes a few things for packagers to be aware of19:23
directhexhttp://git.debian.org/?p=pkg-cli-apps/packages/bansheelyricsplugin.git;a=tree;f=debian;h=936154ed82960f01961d4a760fe90bb81c9008ac;hb=HEAD is the url to click to see the packaging data for this19:24
directhexit's a super-minimal example, so you'll see there are only 6 files here.19:24
directhexchangelog is boring, you should know about that already19:24
directhexcompat is just "7" because we're using dh719:24
directhexcopyright is even more boring than changelog, although you might want to take a peek here as it uses an approximation of the new machine-readable DEP5 format that the debian folks keep going on about19:25
directhexthis leaves three interesting files - watch, rules, and control19:25
* hyperair waves19:26
directhexnow, the watch file here isn't mono-specific, but as a team, we're HUGE fans of them within the debian mono teams - and this is an interesting one, as it performs magic to make version 0.6 higher than version 1 (stupid upstreams)19:26
directhexif you want to get a mono-related package into debian (and the ubuntu mono folks do all the work we can in debian primarily, so more people can benefit from the work), then a watch file is mandatory19:27
directhexnext, control, which is the first file with any mono specifics you need to know19:27
directhexclick on it (raw for those using the web interface), and you should see the list of build-depends on the source package, and the depends on the resultant binary package19:28
directhexthe latter first - notice how as well as the ${misc:Depends} entry you should be used to from other packaging systems, we have a ${cli:Depends} entry. this is the entry which we auto-populate with the real deps.19:29
directhexthings like libmono-system2.0-cil and so on19:29
directhexand, here's part of the magic - if we ever move anything around (as we often do, in our never-ending quest to save space), then all your package needs is a recompile, and it'll pick up the new deps19:30
directhexsimple, easy, yay.19:30
directhexnow, the build-depends19:30
directhexfirst thing you need to notice is the debhelper dependency. the version here, 7.0.50, is needed to use some of the features in debian/rules which we'll get to in a bit. i'll explain why when we get there19:31
directhexcli-common-dev is needed for all the magic we use to do the dep auto-completion19:31
directhexmono-devel is the "master" package which pulls in things like our current preferred compiler, and other assorted tools that mono builds use. this is the mono equivalent of build-essential or default-jdk or something - just pull it in to build things19:32
directhexlastly we have some libraries specific to this app - in this case it needs banshee (as it's a banshee plugin), gconf# (for storing settings) and gtkhtml# (for displaying html). generally, when packaging an app or lib, you just need to list the things your lib needs to build here.19:33
directhexso, what ties this all together? debian/rules - the debian package's makefile. take a look at the rules file now19:33
directhex( http://git.debian.org/?p=pkg-cli-apps/packages/bansheelyricsplugin.git;a=blob_plain;f=debian/rules;hb=HEAD )19:33
directhexso. this is a reasonably simple dh7 file, with some special features.19:33
directhexfirstly, you'll notice the include at the top - like i said, this include is what makes a dh7 file a mono-specific dh7 file19:34
directhexnext is a bunch of scri[ting to fill in version number details. this is used by the get-orig-source rule, another thing we insist on as a team19:34
directhexwhen we come to sponsor a package, we want to just say "okay, download the upstream source for me" and get an orig tarball ready for use - so we want a get-orig-source rule to do it. if you look closely you'll see that most of this rules file is actually taken up with get-orig-source things19:35
directhexnext, the dh7 "magic rule" which James will have covered earlier - that's the "%: dh $@" rule19:36
* meebey mumbles: only the packagers prefere it super easy, some sponsors like that too ^^19:36
meebey+not19:36
directhexwhat that means is whenever the build server says "debian/rules foobar", then this rule means "dh foobar" gets executed, and dh will use its big list of operations to run everything associated with the foobar task19:36
directhexthings like "build" or "install" or "configure"19:37
directhexlastly, we have something found only in recent dh7, i.e. the reason for the 7.0.50 requirement - we have some overrides19:37
directhexthe latest dh7 allows you to have a "override_dh_somecommand" rule, and it'll run your rule instead when it would normally run the named command19:38
directhexin this case, we have two - dh_installchangelogs is being overridden to not include the ChangeLog file it would normally include, and dh_auto_configure is being overridden to change the MCS variable passed to ./configure19:39
directhexthat's one last thing we insist on as a team - we've been trying to work towards a situation where you can have a "default" c# compiler, the way you have "cc" for C or "c++" for C++19:40
dnielsenI assume the latter is part of the much touted space savings feature19:40
directhexa build system which hard-codes, say, gcc-4.2 for not good reason is broken - it should use your system's preferred C compiler. we're trying to enforce the same thing19:40
dnielsenah19:41
directhexin the future this should make it much easier to use Portable.NET if you so wish, as it'll offer an alternative for the csc (C# compiler) command19:41
directhexright, so that's pretty much it for packaging an app (!)19:42
directhexthere's the question of patching, of course19:42
directhexI'd suggest you look at http://svn.debian.org/wsvn/pkg-cli-apps/packages/themonospot/trunk/debian/#_packages_themonospot_trunk_debian_ in your own time for an example of dh7+mono+patching19:42
directhexthat just leaves libraries, really.19:43
directhexand the specifics for libraries are pretty much as I told dnielsen earlier - see http://svn.debian.org/wsvn/pkg-cli-libs/packages/taglib-sharp/trunk/debian/#_packages_taglib-sharp_trunk_debian_ for an example19:43
directhexthere's a .install file (which says which files should be installed where), and a .installcligac file (which says "put the named files into the GAC)19:44
meebeyoldschool packaging! :)19:44
directhexand that's more or less all there is to it, until you need to patch things up the wazoo to get them to be signed, or need to build your own policy files because upstream are stupid, and so on19:45
directhexif you're feeling insane, look at ikvm's packaging for a journey into madness19:45
directhexor feel free to update our db4o packaging, as nobody's been brave enough yet19:45
directhexbut I think that's all the topics covered in mind-numbing detail, with 15 minutes left over for Q&A19:45
directhexso. any questions on mono packaging?19:45
meebeyhow come the mono packages are the most awesome?19:46
directhexwell, we have a very sexy person in charge of the debian mono group. it's all their doing19:47
antileetmeebey: I've never packaged anything for debian before, can you point me to a document where I can start?19:47
dnielsenlooking at the example packages it seems a lot of the hackarounds are for upstream insanity. Would it maybe be prudent to have documentation for upstreams on how to making packaging easier. It seems to me that there is a trend of common mistakes19:47
directhexthat and we have lots of things at our disposal which make life much easier than other guys - e.g. i'd be amazed if the java folks wouldn't go mad for things like assembly reference lists & policy versioning in libraries19:47
meebeydnielsen: from time to time we try to educate upstream, but its very time consuming task19:48
directhexand some upstreams can be hostile19:48
directhexor uninterested19:48
directhexor lazy19:48
directhexor drunk19:48
directhexso we try not to be pushy with upstreams19:49
meebeyantileet: for deb packaging or especially debian?19:49
antileetmeebey: The basics of deb packaging please19:50
meebeynew maintainer guide should be a good start I guess19:50
directhexoh, and whilst they're here: meebey is head of the debian mono group, and essentially "the boss" for all this stuff. Laney is my peer within MOTU who does general mono nonsense too, amongst other things (e.g. he does haskell too, the poor fool). hyperair is the ubuntu banshee packager, mainly. sebner packages assorted mono things he finds fun, and is also from ubuntuland.19:50
meebeyantileet: http://www.debian.org/doc/maint-guide/19:50
directhexanyone i missed, /trout me at will19:50
directhexantileet, and see http://pkg-mono.alioth.debian.org/cli-policy/ for the group policies in painful detail19:51
directhexokay. no more packaging questions?19:51
Laneyhow can I best get involved with the team?19:51
directhexLaney, why, you'd come to #debian-cli on OFTC, and make a nuisance of yourself for a while!19:52
antileetmeebey: Okay, seems detailed enough. I want to initially try and package MD trunk for ubuntu. I'll let you know if I find any trouble19:52
directhexthat's where most of what we do is coordinated - there's also a mailing list somewhere19:52
Laneybut aren't debian developers scary and mean ubuntu-haters?19:53
directhexaha, http://lists.debian.org/debian-cli/19:53
meebeyantileet: MD is a bitch ,) as little advance warning :-P19:53
sebnerdirecthex: tell about git!19:53
antileetmeebey: there are like seven or eight assemblies that I see19:53
dnielsenthe MD fedora spec made me cry.. I definitely do not recommend using MD as a first anything.. not without ample amounts of drugs handy19:54
directhexLaney, the debian folks are all lovely ubuntu lovers (*cough*), who have been shown that we're not all useless layabouts. more importantly, #debian-cli is full of people who know their stuff, so package quality will be best if you coordinate with the clever folks in there19:54
directhexremember, a package in debian is a package in debian AND ubuntu. everybody wins19:54
antileetdnielsen: Okay, I package something simple then.19:54
Laney*and* a better package from being gazed at lovingly by people who care for its area19:55
meebeyantileet: the bad part is the build system, upstream is buggy there19:55
meebeyantileet: see the patches I have to apply/update with each release: http://svn.debian.org/wsvn/pkg-cli-apps/packages/monodevelop/trunk/debian/patches/00list19:55
directhexindeed. MOTU is great, but generalists might not know about specifics of mono packaging, and might miss, say, bad policy data breaking transitions, or something19:55
sebnerLaney: debian with bugs meebey says *cough* *cough*19:55
antileetmeebey: why don't you just get the patches into the trunk?19:56
directhexsebner, it is though!19:56
Laneythe magic "just" ;)19:56
directhexANY OTHER MONO QUESTIONS WHILST WE'RE HERE? WHEEEEE!19:56
meebeyantileet: because upstream preferes being broken in some cases19:57
sebnerdirecthex: debian with cool bleeding edge software ftw! :P19:57
dnielsenthank you directhex for this enlightening hour19:57
sebner\o/ directhex19:57
directhexdnielsen, well, most of it is only possible thanks to meebey, so round of applause for meebey19:57
sebner\o/ meebey19:57
meebey:-P19:58
* sebner is meebey's only fanboy evidently :P19:58
directhexhe's also the mad person who sponsors 99% of mono package uploads in debian, and takes care of the "mono" and "monodevelop" source packages all by himself19:58
directhex2 minutes! no last-minute heckles?19:58
meebeyand smuxi *cough* *cough* a very cool next generation IRC client (compared to irssi at least)19:58
directhexyes, he's upstream for smuxi. cross-platform irc client!19:59
directhexding ding, time's up!20:00
directhexanyone who cares, or has more questions, #debian-cli is that way -->20:00
directhexpeace out, y'all20:00
meebeywatch out for the network bumps, it's on OFTC20:01
* hyperair yawns20:59
hyperairlooks like i missed the fun20:59
hyperairoh well20:59
* hyperair goes back to sleep20:59
JoaoSantanamono packaging is over?23:18
JoaoSantanahi all23:18

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