== Dev Week -- Taking bite out of Unity -- jcastro and DBO -- Mon, Feb 28th, 2011 == {{{#!irc [19:02] oh wait, there you are [19:02] sweet [19:02] This next session is How to Contribute to Unity [19:02] with me and DBO [19:02] o/ [19:02] woot! [19:02] ok so I'm going to go through the intro [19:02] and show you guys how we roll in Unity land [19:03] and then DBO's gonna take your questions [19:03] so first things first [19:03] why are we doing this? [19:03] as it ends up, things in Open Source end up more awesome when more people contribute (duh) [19:03] so what we're concentrating on here for Natty is making it easy for people to fix unity [19:03] or to contribute features [19:04] whatever scratches your itch, so that you can put your "brick in the wall" [19:04] yes, like the pink floyd song [19:04] so, for this session you hopefully already know what unity is [19:04] and you're itching to get your hands on the code [19:04] http://unity.ubuntu.com/getinvolved/ [19:04] we're going to start here [19:05] if you're going to do unity I recommend you bookmark this page [19:05] it's the cheat sheet for how to get the code, and do branch proposals [19:05] so, are people comfortable with bzr? This session doesn't cover bzr basics but I can do a quick tutorial (just comment in -chat) [19:06] oh, someone's asked a good question [19:06] akshatj asked: Does contributing to unity require knowledge of compiz? [19:06] DBO: ^ [19:06] akshatj, in short, no === chris_ is now known as bobthebob1234 [19:07] the longer answer is, not unless you want to work on those specific parts that interface between compiz and unity [19:07] about 90% of the code really doesn't touch compiz at all [19:08] ok so the first step is to grab the code [19:08] this is straight forward [19:08] bzr branch lp:unity [19:08] which is "hey bzr, make a branch of the unity project on launchpad, I want to do stuff" [19:08] you will then decide, what is it you want to fix [19:09] now some people know right away "I am going to go make this" [19:09] other people prefer "hey just tell me what needs to get fixed and I'm on it." [19:09] so the unity team takes bugs that they feel are "bitesize" [19:09] things to familiarize yourself with the code [19:09] and not flood you with a ton of stuff [19:10] so you can pick and choose some bufgs to familiarize yourself [19:10] don't worry, we don't put all the crap bugs in bitesize [19:10] we try to pick a mix of "sexy" bugs too [19:10] for example trevino fixed the little fade in the title bar, etc. [19:10] this list is here: [19:10] https://bugs.launchpad.net/unity/+bugs?field.searchtext=&orderby=-importance&field.status:list=NEW&field.status:list=INCOMPLETE_WITH_RESPONSE&field.status:list=INCOMPLETE_WITHOUT_RESPONSE&field.status:list=CONFIRMED&field.status:list=TRIAGED&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_supervisor=&field.bug_commenter=&field.subscriber=&field.tag=bitesize&field.tags_combinator= [19:10] ALL&field.has_cve.used=&field.omit_dupes.used=&field.omit_dupes=on&field.affects_me.used=&field.has_patch.used=&field.has_branches.used=&field.has_branches=on&field.has_no_branches.used=&field.has_no_branches=on&search=Search [19:10] ok so launchpad hates me [19:10] https://wiki.ubuntu.com/Unity/Bitesize [19:10] the list of bugs is on that page there [19:11] (we're on steps 2 and 3) [19:11] its worth noting that most bitesize bugs have been picked because they can be handled with little knowledge beyond C++ and glib [19:11] so, you basically find a bug from that list, something you want to fix [19:11] of course, you can feel free to ignore the bitesizers and dig into compiz and fix the universe, but for this tutorial we're going to keep it simple [19:11] ok so now you find a bug you want to fix [19:11] and you have the code [19:11] the next step is to fix the code itself [19:12] this is basically up to you, you need to fix the bug, DBO can you tell people how they can get coding help for fixing bugs? [19:12] the absolute best resource for getting coding help is us, the primary developers [19:12] where can I find you? [19:12] we all idle in #ayatana and are happy to field your questions about the code [19:13] you can also post on ayatana-dev@lists.launchpad.net [19:13] if you ping me there I will either answer your question or direct you to the proper person to ping :) [19:13] and yes as jorge mentioned, we watch the mailing list too [19:13] ok so for this example we're going to assume that you know how to code (heh) and have fixed the bug. [19:13] you would do normal hacker things here, test it, etc. [19:14] the next thing you need to do is commit the fix to your local repo [19:14] this is easy, "bzr commit" [19:14] now, you've fixed it and committed, now we need to put it somewhere where DBO can check it out [19:14] we're going to push a branch to launchpad [19:15] to do this I'll shove it under my username in launchpad [19:15] so, I'll say: [19:15] bzr push lp:jorge/unity/fix-for-123456 [19:15] or [19:15] bzr push lp:jorge/unity/awesome-new-feature-that-does-foo-bar [19:15] I can name it what I want at the end there [19:15] bzr push lp:~jorge/unity/fix-for-123456 [19:15] people generally just pick something descriptive [19:15] you missed the ~ [19:16] oops, sorry [19:16] thanks [19:16] * DBO got your back [19:16] (I see the doc has a typo, I'll fix that after the class) [19:16] ok, let's field some questions at this point [19:16] mhall119 asked: Are there any bugs yet that Python devs can fix? [19:17] mhall119, totally! we need people using libunity to add support for the launcher in other applications [19:17] since python has gir support, and libunity is a standard gobject library, you are able to use it directly [19:17] libunity and python should be sorted real soon, there's a few bugs but the right people are on the problem [19:17] "it's close" [19:18] doh, speaking ahead of myself :) [19:18] rsajdok asked: Can I develop on maverick or only natty? [19:18] natty only, sorry [19:18] I stayed on maverick as long as I could [19:18] and eventually too many deps needed to be backported for me to keep up [19:18] you would need to backport, glib, gio, gtk, and vala at least [19:19] the nice thing is now that the APIs and stuff are getting hashed out we won't need to break things going forward [19:19] what I recommend is waiting until thursday to grab alpha 3, this will have all the goodies (including fixed nvidia and ati drivers) [19:19] and then installing it on a USB key, boot off of it, and code [19:20] as natty stabilizes and it's not so "scary" to run a devel distro we expect more people to mess with the code [19:20] which is what we want! [19:20] rsajdok asked: Can You describe how to compile? cmake . etc.? [19:21] DBO: ^^ this one is all yours [19:21] rsajdok, yeah one second [19:21] heh, cmake! [19:21] rsajdok, grabbing the command :) [19:21] so what you do [19:21] bzr branch lp:unity [19:22] cd unity; mkdir build; cd build; [19:22] then you run this big command [19:22] cmake .. -DCMAKE_INSTALL_PREFIX=/home/USERNAME/staging/ -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=compiz -DGSETTINGS_LOCALINSTALL=ON [19:22] that will install the unity plugin into your /home/USERNAME/staging directory [19:23] erm [19:23] after you run make and make install that is [19:23] where's the wiki page at? [19:23] You wrote this down right? :) [19:24] on the installing unity wiki page... [19:24] https://wiki.ubuntu.com/Unity/InstallationGuide [19:24] https://wiki.ubuntu.com/Unity/InstallationGuideFromSource [19:24] those 2 pages should help you out [19:24] ah right [19:25] ok [19:25] so, now you have built it === bdrung_ is now known as bdrung [19:25] and fixed your bug [19:25] and tested it [19:25] Pro tip: You will need to test your fix [19:25] as your code will undergo review [19:25] ok, so we submitted the code to launchpad with our last bzr push [19:26] https://code.launchpad.net/unity [19:26] your branch will automagically show up on that page ^ [19:26] what you see here is all the branches for unity [19:26] as people work on the code they do it in branches [19:26] and then submit them [19:26] this is important, as we're very distributed [19:26] so you won't see things going into trunk until people submit a branch [19:27] Pro tip: this page is also a good way to see what's coming down the pipe [19:27] so, every day, when DBO wakes up [19:27] (at like noon) [19:27] he goes through these branches [19:27] DBO: can you tell us what you go through to review these branches? [19:27] so the review process is 2 primary stages [19:27] well 3 [19:28] in the 0th stage I decide what can be reviewed (certain features are outside of the scope of what we can support for natty) [19:29] if your feature/bugfix is able to land for natty, we move on to step 1, otherwise we inform you that your review will be looked at again for Natty +1 [19:29] the first step of code review involves looking over the code itself [19:29] it must conform to the correct coding guidelines (which for now are somewhat loose) and not present any obvious issues [19:30] here I will be looking for memory leaks, crash conditions, general architecture, and overall clarity of the code [19:30] if you pass mustard, we move to step 2, otherwise the problems are noted and the merge will be marked "Needs Fixing" [19:30] you may resubmit at any time if you think the issues have been resolved [19:31] at step 3, I am going to actually install the code on my machine, test that it actually does what its supposed to do, ensure its not doing anything too stupid (leaking tons of memory comes to mind here) [19:31] (coding guidelines here: https://wiki.ubuntu.com/Unity/CodingStyle) [19:31] if that all passes mustard again, I will approve the merge [19:31] if not, I will mark the branch as "Needs Fixing" and send it back to the original developer with the reasoning why [19:32] once approved, assuming the contributor has signed the CA, I will pull the branch into trunk [19:32] and your code ships in the next release [19:32] If you haven't accepted the canonical contributor agreement yet, we'll also send you a mail asking you to either accept/not accept [19:32] https://code.launchpad.net/unity/+merges [19:32] here's the list of all the merges we've had so far [19:32] as you can see, it starts to pile up, which is good [19:33] the more branches we have incoming, the better [19:33] ok so really, those are all the steps, any questions? [19:34] rsajdok asked: Can I develop unity-2d on maverick or only natty? [19:34] Unity-2D has similar requirements to Unity-3d [19:34] I can't say for sure (as I have not checked) but I imagine it would also require natty [19:34] I will ask a Unity-2D dev right now [19:35] mhall119 asked: what info do you want attached to bug reports against Unity? [19:35] General system info is always helpful for starters [19:35] things like CPU, 64 vs 32 bit, GPU, and amount of memory [19:36] we also like to know what package version of compiz and unity you have [19:36] and if you can include steps to reproduce teh issue, that is awesome [19:37] (if you're reporting a bug on the unity in natty "ubuntu-bug unity" will snag a bunch of data for us) [19:37] if the issue is intermittent (and many issues with X/compiz are), if you can manage to get a backtrace using GDB, you instantly become a hero, and we sing your praises on high [19:37] wolfpack asked: Does building and installing UNITY does not removes originally installed unity? [19:38] it depends on where you install it to [19:38] if you install it into /usr, it will overwrite the existing unity plugin [19:38] if you install it anywhere else, it does not [19:38] if you accidentally overwrite the existing plugin, you can do sudo aptitude reinstall unity [19:38] to install the old version again [19:39] more questions? [19:40] DBO: he goes on to ask "So both wiil be working together if installed in directory othe than /usr? " [19:40] wolfpack, you would have to use an env variable to tell compiz which one to use [19:41] ok while we wait for questions [19:41] DBO: why don't you go into some of the architecture [19:41] like, what does what [19:42] wolfpack, I'll get you more details on that in a bit, i actually dont have them off hand because I run my dev setup a bit differently [19:42] jcastro, sure no problem [19:43] jcastro, Unity is broken down into 3 major components. The plugin interface, the UI elements, and the backend elements. [19:43] The plugin interface exists entirely in a file named unityshell.cpp. This is where you go to look for any bug dealing with interactions between unity and compiz [19:44] event handling, grabbing of and passing off events, and other plugin interactions are performed here. This is also the main entry point for Unity [19:44] Unity is also painted from this file (there is a pretty clear paint function if you open it up) [19:45] (jcastro, feel free to interrupt me with questions) [19:45] UI elements are things like the launcher, quicklist, panel, or palces [19:46] these elements are rendered using a library called Nux [19:46] Nux widgets are not that dissimilar from GTK or Qt widgets save for the fact that they can be embedded into existing openGL contexts [19:47] UI elements are laid out in a semi-hierarchal fashion, just like qt and gtk [19:47] really if you have worked in any toolkit before, you should not feel that far out of your comfort zone [19:47] rsajdok asked: Is it possible to develop Unity on virtual machine? [19:47] not last I checked [19:48] most virtual machine drivers still dont do FBO's yet [19:48] which means we cant draw properly [19:48] for a time Virtualbox 4 ran it [19:48] I hear rumors that vmware has fixed this, but I have not tested that [19:48] then we ran into the Xorg transition in natty [19:48] wolfpack asked: Am I allowed to upload patches for bugs? As I can make connection through http only . No ssh is allowed her. [19:49] wolfpack, we take patches :) [19:49] wolfpack, if you can communicate your patch to us through bongos and a string and we understand it, we'll take it [19:50] Amoz asked: sorry for being a bit late, but when you talked about the system info part, and getting a backtrace with GDB, is there a specific command to collect all this information? [19:50] ubuntu-bug unity collects most of the info [19:50] There are 10 minutes remaining in the current session. [19:51] backtraces can be trickier, usually what I do is ssh in from another machine (or switch to a VT), then run "sudo gdb" [19:51] inside gdb, I run "attach [19:51] you will have to check the pid of compiz before you start gdb [19:51] after it finishes attaching, you can simply run "backtrace" adn get the data [19:52] wolfpack, if you need help at the time of collection, you can always stop by #ayatana, and we can walk you through it no problem [19:52] erm [19:52] I am not sure that was wolfpack asking that [19:52] i meant Amoz :) [19:53] 10 minutes left, more questions? [19:54] mhall119 asked: SInce we can't test in a virtualmachine, can we at least run Unity from a LiveCD now? [19:54] live CD is an acceptable way to run unity, we suggest running from a USB key so you can save [19:55] there's been some real churn due to the Xorg transition with people getting working desktops to test on Unity [19:55] Alpha 3 (this thursday) will finally have all that sorted [19:55] There are 5 minutes remaining in the current session. [19:56] jderose asked: I'd like to help document the Python API... what's the best way to do with for gobject introspection? can i make help(Unity.foo) show something useful? [19:57] ohh, please join us in #ayatana after this session [19:57] and we can sort that [19:57] akshatj asked: Are there any plans to provide a Unity Live CD like Gnome Shell does? [19:57] jderose, yes, #ayatana, we'll get you in touch with the right peoples [19:57] akshatj, its called the 11.04 release of Ubuntu :) [19:57] yep, on thursday! [19:58] ok well that's about it [19:58] thanks for participating [19:58] we hope you snag the unity code [19:58] and mess with it, make it better, so that you can contribute! [19:58] DBO: nice job! [19:59] alright, next class, smoke if you got em! [19:59] * DBO bows and dances off stage, ashley simpson style [20:00] * tumbleweed waves [20:00] thanks jcastro and DBO }}}