HelpingWithUnity
Dev Week -- Taking bite out of Unity -- jcastro and DBO -- Mon, Feb 28th, 2011
1 [19:02] <DBO> oh wait, there you are
2 [19:02] <DBO> sweet
3 [19:02] <jcastro> This next session is How to Contribute to Unity
4 [19:02] <jcastro> with me and DBO
5 [19:02] <jcastro> o/
6 [19:02] <DBO> woot!
7 [19:02] <jcastro> ok so I'm going to go through the intro
8 [19:02] <jcastro> and show you guys how we roll in Unity land
9 [19:03] <jcastro> and then DBO's gonna take your questions
10 [19:03] <jcastro> so first things first
11 [19:03] <jcastro> why are we doing this?
12 [19:03] <jcastro> as it ends up, things in Open Source end up more awesome when more people contribute (duh)
13 [19:03] <jcastro> so what we're concentrating on here for Natty is making it easy for people to fix unity
14 [19:03] <jcastro> or to contribute features
15 [19:04] <jcastro> whatever scratches your itch, so that you can put your "brick in the wall"
16 [19:04] <jcastro> yes, like the pink floyd song
17 [19:04] <jcastro> so, for this session you hopefully already know what unity is
18 [19:04] <jcastro> and you're itching to get your hands on the code
19 [19:04] <jcastro> http://unity.ubuntu.com/getinvolved/
20 [19:04] <jcastro> we're going to start here
21 [19:05] <jcastro> if you're going to do unity I recommend you bookmark this page
22 [19:05] <jcastro> it's the cheat sheet for how to get the code, and do branch proposals
23 [19:05] <jcastro> so, are people comfortable with bzr? This session doesn't cover bzr basics but I can do a quick tutorial (just comment in -chat)
24 [19:06] <jcastro> oh, someone's asked a good question
25 [19:06] <ClassBot> akshatj asked: Does contributing to unity require knowledge of compiz?
26 [19:06] <jcastro> DBO: ^
27 [19:06] <DBO> akshatj, in short, no
28 === chris_ is now known as bobthebob1234
29 [19:07] <DBO> the longer answer is, not unless you want to work on those specific parts that interface between compiz and unity
30 [19:07] <DBO> about 90% of the code really doesn't touch compiz at all
31 [19:08] <jcastro> ok so the first step is to grab the code
32 [19:08] <jcastro> this is straight forward
33 [19:08] <jcastro> bzr branch lp:unity
34 [19:08] <jcastro> which is "hey bzr, make a branch of the unity project on launchpad, I want to do stuff"
35 [19:08] <jcastro> you will then decide, what is it you want to fix
36 [19:09] <jcastro> now some people know right away "I am going to go make this"
37 [19:09] <jcastro> other people prefer "hey just tell me what needs to get fixed and I'm on it."
38 [19:09] <jcastro> so the unity team takes bugs that they feel are "bitesize"
39 [19:09] <jcastro> things to familiarize yourself with the code
40 [19:09] <jcastro> and not flood you with a ton of stuff
41 [19:10] <jcastro> so you can pick and choose some bufgs to familiarize yourself
42 [19:10] <jcastro> don't worry, we don't put all the crap bugs in bitesize
43 [19:10] <jcastro> we try to pick a mix of "sexy" bugs too
44 [19:10] <jcastro> for example trevino fixed the little fade in the title bar, etc.
45 [19:10] <jcastro> this list is here:
46 [19:10] <jcastro> 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=
47 [19:10] <jcastro> 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
48 [19:10] <jcastro> ok so launchpad hates me
49 [19:10] <jcastro> https://wiki.ubuntu.com/Unity/Bitesize
50 [19:10] <jcastro> the list of bugs is on that page there
51 [19:11] <jcastro> (we're on steps 2 and 3)
52 [19:11] <DBO> its worth noting that most bitesize bugs have been picked because they can be handled with little knowledge beyond C++ and glib
53 [19:11] <jcastro> so, you basically find a bug from that list, something you want to fix
54 [19:11] <jcastro> 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
55 [19:11] <jcastro> ok so now you find a bug you want to fix
56 [19:11] <jcastro> and you have the code
57 [19:11] <jcastro> the next step is to fix the code itself
58 [19:12] <jcastro> 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?
59 [19:12] <DBO> the absolute best resource for getting coding help is us, the primary developers
60 [19:12] <jcastro> where can I find you?
61 [19:12] <DBO> we all idle in #ayatana and are happy to field your questions about the code
62 [19:13] <jcastro> you can also post on ayatana-dev@lists.launchpad.net
63 [19:13] <DBO> if you ping me there I will either answer your question or direct you to the proper person to ping :)
64 [19:13] <DBO> and yes as jorge mentioned, we watch the mailing list too
65 [19:13] <jcastro> ok so for this example we're going to assume that you know how to code (heh) and have fixed the bug.
66 [19:13] <jcastro> you would do normal hacker things here, test it, etc.
67 [19:14] <jcastro> the next thing you need to do is commit the fix to your local repo
68 [19:14] <jcastro> this is easy, "bzr commit"
69 [19:14] <jcastro> now, you've fixed it and committed, now we need to put it somewhere where DBO can check it out
70 [19:14] <jcastro> we're going to push a branch to launchpad
71 [19:15] <jcastro> to do this I'll shove it under my username in launchpad
72 [19:15] <jcastro> so, I'll say:
73 [19:15] <jcastro> bzr push lp:jorge/unity/fix-for-123456
74 [19:15] <jcastro> or
75 [19:15] <jcastro> bzr push lp:jorge/unity/awesome-new-feature-that-does-foo-bar
76 [19:15] <jcastro> I can name it what I want at the end there
77 [19:15] <DBO> bzr push lp:~jorge/unity/fix-for-123456
78 [19:15] <jcastro> people generally just pick something descriptive
79 [19:15] <DBO> you missed the ~
80 [19:16] <jcastro> oops, sorry
81 [19:16] <jcastro> thanks
82 [19:16] * DBO got your back
83 [19:16] <jcastro> (I see the doc has a typo, I'll fix that after the class)
84 [19:16] <jcastro> ok, let's field some questions at this point
85 [19:16] <ClassBot> mhall119 asked: Are there any bugs yet that Python devs can fix?
86 [19:17] <DBO> mhall119, totally! we need people using libunity to add support for the launcher in other applications
87 [19:17] <DBO> since python has gir support, and libunity is a standard gobject library, you are able to use it directly
88 [19:17] <jcastro> libunity and python should be sorted real soon, there's a few bugs but the right people are on the problem
89 [19:17] <jcastro> "it's close"
90 [19:18] <DBO> doh, speaking ahead of myself :)
91 [19:18] <ClassBot> rsajdok asked: Can I develop on maverick or only natty?
92 [19:18] <DBO> natty only, sorry
93 [19:18] <DBO> I stayed on maverick as long as I could
94 [19:18] <DBO> and eventually too many deps needed to be backported for me to keep up
95 [19:18] <DBO> you would need to backport, glib, gio, gtk, and vala at least
96 [19:19] <jcastro> the nice thing is now that the APIs and stuff are getting hashed out we won't need to break things going forward
97 [19:19] <jcastro> what I recommend is waiting until thursday to grab alpha 3, this will have all the goodies (including fixed nvidia and ati drivers)
98 [19:19] <jcastro> and then installing it on a USB key, boot off of it, and code
99 [19:20] <jcastro> as natty stabilizes and it's not so "scary" to run a devel distro we expect more people to mess with the code
100 [19:20] <jcastro> which is what we want!
101 [19:20] <ClassBot> rsajdok asked: Can You describe how to compile? cmake . etc.?
102 [19:21] <jcastro> DBO: ^^ this one is all yours
103 [19:21] <DBO> rsajdok, yeah one second
104 [19:21] <jcastro> heh, cmake!
105 [19:21] <DBO> rsajdok, grabbing the command :)
106 [19:21] <DBO> so what you do
107 [19:21] <DBO> bzr branch lp:unity
108 [19:22] <DBO> cd unity; mkdir build; cd build;
109 [19:22] <DBO> then you run this big command
110 [19:22] <DBO> cmake .. -DCMAKE_INSTALL_PREFIX=/home/USERNAME/staging/ -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=compiz -DGSETTINGS_LOCALINSTALL=ON
111 [19:22] <DBO> that will install the unity plugin into your /home/USERNAME/staging directory
112 [19:23] <DBO> erm
113 [19:23] <DBO> after you run make and make install that is
114 [19:23] <jcastro> where's the wiki page at?
115 [19:23] <jcastro> You wrote this down right? :)
116 [19:24] <DBO> on the installing unity wiki page...
117 [19:24] <DBO> https://wiki.ubuntu.com/Unity/InstallationGuide
118 [19:24] <jcastro> https://wiki.ubuntu.com/Unity/InstallationGuideFromSource
119 [19:24] <jcastro> those 2 pages should help you out
120 [19:24] <DBO> ah right
121 [19:25] <jcastro> ok
122 [19:25] <jcastro> so, now you have built it
123 === bdrung_ is now known as bdrung
124 [19:25] <jcastro> and fixed your bug
125 [19:25] <jcastro> and tested it
126 [19:25] <jcastro> Pro tip: You will need to test your fix
127 [19:25] <jcastro> as your code will undergo review
128 [19:25] <jcastro> ok, so we submitted the code to launchpad with our last bzr push
129 [19:26] <jcastro> https://code.launchpad.net/unity
130 [19:26] <jcastro> your branch will automagically show up on that page ^
131 [19:26] <jcastro> what you see here is all the branches for unity
132 [19:26] <jcastro> as people work on the code they do it in branches
133 [19:26] <jcastro> and then submit them
134 [19:26] <jcastro> this is important, as we're very distributed
135 [19:26] <jcastro> so you won't see things going into trunk until people submit a branch
136 [19:27] <jcastro> Pro tip: this page is also a good way to see what's coming down the pipe
137 [19:27] <jcastro> so, every day, when DBO wakes up
138 [19:27] <jcastro> (at like noon)
139 [19:27] <jcastro> he goes through these branches
140 [19:27] <jcastro> DBO: can you tell us what you go through to review these branches?
141 [19:27] <DBO> so the review process is 2 primary stages
142 [19:27] <DBO> well 3
143 [19:28] <DBO> in the 0th stage I decide what can be reviewed (certain features are outside of the scope of what we can support for natty)
144 [19:29] <DBO> 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
145 [19:29] <DBO> the first step of code review involves looking over the code itself
146 [19:29] <DBO> it must conform to the correct coding guidelines (which for now are somewhat loose) and not present any obvious issues
147 [19:30] <DBO> here I will be looking for memory leaks, crash conditions, general architecture, and overall clarity of the code
148 [19:30] <DBO> if you pass mustard, we move to step 2, otherwise the problems are noted and the merge will be marked "Needs Fixing"
149 [19:30] <DBO> you may resubmit at any time if you think the issues have been resolved
150 [19:31] <DBO> 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)
151 [19:31] <jcastro> (coding guidelines here: https://wiki.ubuntu.com/Unity/CodingStyle)
152 [19:31] <DBO> if that all passes mustard again, I will approve the merge
153 [19:31] <DBO> if not, I will mark the branch as "Needs Fixing" and send it back to the original developer with the reasoning why
154 [19:32] <DBO> once approved, assuming the contributor has signed the CA, I will pull the branch into trunk
155 [19:32] <DBO> and your code ships in the next release
156 [19:32] <jcastro> If you haven't accepted the canonical contributor agreement yet, we'll also send you a mail asking you to either accept/not accept
157 [19:32] <jcastro> https://code.launchpad.net/unity/+merges
158 [19:32] <jcastro> here's the list of all the merges we've had so far
159 [19:32] <jcastro> as you can see, it starts to pile up, which is good
160 [19:33] <jcastro> the more branches we have incoming, the better
161 [19:33] <jcastro> ok so really, those are all the steps, any questions?
162 [19:34] <ClassBot> rsajdok asked: Can I develop unity-2d on maverick or only natty?
163 [19:34] <DBO> Unity-2D has similar requirements to Unity-3d
164 [19:34] <DBO> I can't say for sure (as I have not checked) but I imagine it would also require natty
165 [19:34] <DBO> I will ask a Unity-2D dev right now
166 [19:35] <ClassBot> mhall119 asked: what info do you want attached to bug reports against Unity?
167 [19:35] <DBO> General system info is always helpful for starters
168 [19:35] <DBO> things like CPU, 64 vs 32 bit, GPU, and amount of memory
169 [19:36] <DBO> we also like to know what package version of compiz and unity you have
170 [19:36] <DBO> and if you can include steps to reproduce teh issue, that is awesome
171 [19:37] <jcastro> (if you're reporting a bug on the unity in natty "ubuntu-bug unity" will snag a bunch of data for us)
172 [19:37] <DBO> 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
173 [19:37] <ClassBot> wolfpack asked: Does building and installing UNITY does not removes originally installed unity?
174 [19:38] <DBO> it depends on where you install it to
175 [19:38] <DBO> if you install it into /usr, it will overwrite the existing unity plugin
176 [19:38] <DBO> if you install it anywhere else, it does not
177 [19:38] <DBO> if you accidentally overwrite the existing plugin, you can do sudo aptitude reinstall unity
178 [19:38] <DBO> to install the old version again
179 [19:39] <jcastro> more questions?
180 [19:40] <jcastro> DBO: he goes on to ask "So both wiil be working together if installed in directory othe than /usr? "
181 [19:40] <DBO> wolfpack, you would have to use an env variable to tell compiz which one to use
182 [19:41] <jcastro> ok while we wait for questions
183 [19:41] <jcastro> DBO: why don't you go into some of the architecture
184 [19:41] <jcastro> like, what does what
185 [19:42] <DBO> 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
186 [19:42] <DBO> jcastro, sure no problem
187 [19:43] <DBO> jcastro, Unity is broken down into 3 major components. The plugin interface, the UI elements, and the backend elements.
188 [19:43] <DBO> 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
189 [19:44] <DBO> event handling, grabbing of and passing off events, and other plugin interactions are performed here. This is also the main entry point for Unity
190 [19:44] <DBO> Unity is also painted from this file (there is a pretty clear paint function if you open it up)
191 [19:45] <DBO> (jcastro, feel free to interrupt me with questions)
192 [19:45] <DBO> UI elements are things like the launcher, quicklist, panel, or palces
193 [19:46] <DBO> these elements are rendered using a library called Nux
194 [19:46] <DBO> Nux widgets are not that dissimilar from GTK or Qt widgets save for the fact that they can be embedded into existing openGL contexts
195 [19:47] <DBO> UI elements are laid out in a semi-hierarchal fashion, just like qt and gtk
196 [19:47] <DBO> really if you have worked in any toolkit before, you should not feel that far out of your comfort zone
197 [19:47] <ClassBot> rsajdok asked: Is it possible to develop Unity on virtual machine?
198 [19:47] <DBO> not last I checked
199 [19:48] <DBO> most virtual machine drivers still dont do FBO's yet
200 [19:48] <DBO> which means we cant draw properly
201 [19:48] <jcastro> for a time Virtualbox 4 ran it
202 [19:48] <DBO> I hear rumors that vmware has fixed this, but I have not tested that
203 [19:48] <jcastro> then we ran into the Xorg transition in natty
204 [19:48] <ClassBot> wolfpack asked: Am I allowed to upload patches for bugs? As I can make connection through http only . No ssh is allowed her.
205 [19:49] <DBO> wolfpack, we take patches :)
206 [19:49] <DBO> wolfpack, if you can communicate your patch to us through bongos and a string and we understand it, we'll take it
207 [19:50] <ClassBot> 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?
208 [19:50] <DBO> ubuntu-bug unity collects most of the info
209 [19:50] <ClassBot> There are 10 minutes remaining in the current session.
210 [19:51] <DBO> backtraces can be trickier, usually what I do is ssh in from another machine (or switch to a VT), then run "sudo gdb"
211 [19:51] <DBO> inside gdb, I run "attach <pid of compiz>
212 [19:51] <DBO> you will have to check the pid of compiz before you start gdb
213 [19:51] <DBO> after it finishes attaching, you can simply run "backtrace" adn get the data
214 [19:52] <DBO> 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
215 [19:52] <DBO> erm
216 [19:52] <DBO> I am not sure that was wolfpack asking that
217 [19:52] <DBO> i meant Amoz :)
218 [19:53] <jcastro> 10 minutes left, more questions?
219 [19:54] <ClassBot> mhall119 asked: SInce we can't test in a virtualmachine, can we at least run Unity from a LiveCD now?
220 [19:54] <DBO> live CD is an acceptable way to run unity, we suggest running from a USB key so you can save
221 [19:55] <jcastro> there's been some real churn due to the Xorg transition with people getting working desktops to test on Unity
222 [19:55] <jcastro> Alpha 3 (this thursday) will finally have all that sorted
223 [19:55] <ClassBot> There are 5 minutes remaining in the current session.
224 [19:56] <ClassBot> 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?
225 [19:57] <jcastro> ohh, please join us in #ayatana after this session
226 [19:57] <jcastro> and we can sort that
227 [19:57] <ClassBot> akshatj asked: Are there any plans to provide a Unity Live CD like Gnome Shell does?
228 [19:57] <DBO> jderose, yes, #ayatana, we'll get you in touch with the right peoples
229 [19:57] <DBO> akshatj, its called the 11.04 release of Ubuntu :)
230 [19:57] <jcastro> yep, on thursday!
231 [19:58] <jcastro> ok well that's about it
232 [19:58] <jcastro> thanks for participating
233 [19:58] <jcastro> we hope you snag the unity code
234 [19:58] <jcastro> and mess with it, make it better, so that you can contribute!
235 [19:58] <jcastro> DBO: nice job!
236 [19:59] <jcastro> alright, next class, smoke if you got em!
237 [19:59] * DBO bows and dances off stage, ashley simpson style
238 [20:00] * tumbleweed waves
239 [20:00] <tumbleweed> thanks jcastro and DBO
MeetingLogs/devweek1103/HelpingWithUnity (last edited 2011-03-02 05:48:10 by 111)