FixingSmallBugsInUnity
Dev Week -- Fixing small bugs in Unity -- Trevinho and andyrock -- Wed, Feb 1st, 2012
1 [21:01] <Trevinho> Hello all
2 [21:01] <andyrock> hey all! :)
3 [21:01] <Trevinho> To begin let's introduce ourselves...
4 [21:01] <Trevinho> We were two Unity Community hackers
5 [21:02] <Trevinho> that after hacking on the unity and nux code get contracted by Canonical
6 [21:02] <Trevinho> to develop unity for 12.04
7 [21:03] <andyrock> Now we're working on bug fixing
8 [21:04] <Trevinho> This describes our work, anyway we're two Italian guys... That's why we're often called "The Italians" on our team
9 [21:04] <andyrock> and to implement small features
10 [21:06] <Trevinho> We're getting here thanks to the work that we started as community guys, lead by the passion on the free software development
11 [21:09] <andyrock> So as by description, this session is about Unity and after bug fixing in Unity
12 [21:09] <Trevinho> First of all...
13 [21:09] <Trevinho> Why contributing to unity?
14 [21:10] <Trevinho> Well... The first reason can be simple... As it's a quite new software with a very important role and as every software is not bug free
15 [21:11] <Trevinho> so... We need to squash them out
16 [21:11] <Trevinho> to make unity and so the main ubuntu interface to rock
17 [21:11] <Trevinho> Then personally, you can enjoy to work on a big piece of software
18 [21:12] <Trevinho> that will be used by millions of users
19 [21:12] <andyrock> From my point of the view, contributing to unity (and open source software in general) can be an opportunity to learn a lot of cool stuff
20 [21:13] <Trevinho> Also... If unity doesn't fill exactly to your needs maybe you can work on it to improve it.. That's the main reason I joined at the beginning
21 [21:14] <andyrock> instead of criticizing without doing anything :)
22 [21:16] <Trevinho> Or finally, you can just join the development to be welcomed by Jorge in a such way, once you're at the UDS: http://www.flickr.com/photos/trevi55/5701699276/in/photostream
23 [21:16] <Trevinho> ;)
24 [21:17] <Trevinho> Ok... I think you got what we meant...
25 [21:18] <Trevinho> By the way if you're here, maybe the main thing you want is start doing something for our beautiful shell
26 [21:18] <Trevinho> So... Let's start
27 [21:19] <Trevinho> First of all... Talking about unity we talk about an (united) ecosystem... So Unity is just one of the projects that makes the "unity experience" possible
28 [21:19] <Trevinho> The main launchpad branches you should start to branch and look are
29 [21:19] <Trevinho> lp:bamf - for the Windows /applications matching and management
30 [21:20] <Trevinho> lp:nux as the widget library
31 [21:20] <Trevinho> lp:libunity
32 [21:20] <Trevinho> and then
33 [21:20] <ClassBot> nava asked: what basics we should know to help in unity project (i mean programming language) ?
34 [21:20] <Trevinho> lp:unity
35 [21:20] <andyrock> nava, basic c++
36 [21:21] <Trevinho> Yes, nux and untiy are in C++
37 [21:21] <Trevinho> while bamf is in C and libunity in Vala
38 [21:22] <andyrock> autopilot in pythong
39 [21:22] <Trevinho> So, I was listing the projects... lp:unity is anyway the "core" of our shell... Basically is a compiz plugin that gets loaded when compiz runs, but to do many patches this shouldn't worry you
40 [21:22] <andyrock> without the g :)
41 [21:23] <Trevinho> So.. To get started on development, first of all, we suggest to always stay up-dated to the last ubuntu version
42 [21:23] <Trevinho> *development version*
43 [21:23] <Trevinho> so precise, now
44 [21:24] <Trevinho> Then, to install the main dependencies you can use the unity-team staging ppa
45 [21:24] <Trevinho> that is at https://launchpad.net/~unity-team/+archive/staging
46 [21:24] <Trevinho> and you can get the needed dependencies by doing something like
47 [21:24] <Trevinho> sudo apt-get build-dep unity
48 [21:24] <andyrock> keep in mind the staging ppa can break your pc :)
49 [21:24] <Trevinho> yes, that's the coolest part :)
50 [21:25] <andyrock> most of the time, you'll need to play with nux
51 [21:25] <andyrock> so it can be useful
52 [21:25] <andyrock> sudo apt-get build-dep nux
53 [21:26] <andyrock> btw to build unity from trunk read here http://askubuntu.com/questions/28470/how-do-i-build-unity-from-source
54 [21:27] <andyrock> now that we know how to build unity, let's talk about what bugs we can solve :)
55 [21:27] <Trevinho> Now... If you want to start, you'd maybe remember the famous "bitesize list"... Well that's still valid and you can check it at https://bugs.launchpad.net/unity/+bugs?field.tag=bitesize
56 [21:27] <andyrock> But if you want to be really useful you can fix the "backlog bugs"
57 [21:28] <andyrock> https://bugs.launchpad.net/unity/+bugs?field.tag=backlog
58 [21:28] <Trevinho> All these bugs are also listed in this more useful page: http://people.canonical.com/~platform/design/upstream.html
59 [21:28] <Trevinho> that shows the bugs that have more design priority
60 [21:29] <andyrock> A bitesize bug is a really simple to solve bug (or at least is should be easy to solve)
61 [21:29] <andyrock> Let's talk about the backlog bugs
62 [21:30] <andyrock> What is a backlog bug?
63 [21:30] <Trevinho> You can also subscribe to the unity bugs at https://bugs.launchpad.net/unity
64 [21:31] <andyrock> A backlog is a feature that needs to be implemented
65 [21:31] <andyrock> a feature or an improvement to a feature
66 [21:32] <andyrock> as you can see we have a quite long backlog list :/
67 [21:33] <andyrock> So the first step is: "Decide what bug do you want do solve"
68 [21:33] <Trevinho> Once you've decided... You just need to branch unity (or the project you want to fix)
69 [21:33] <Trevinho> So for example, considering unity
70 [21:33] <Trevinho> just do
71 [21:34] <Trevinho> bzr branch lp:unity
72 [21:34] <andyrock> then
73 [21:34] <andyrock> cd unity
74 [21:34] <andyrock> mkdir build
75 [21:34] <andyrock> cd build
76 [21:34] <Trevinho> cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=/usr
77 [21:34] <Trevinho> this will configure your branch to be compiled
78 [21:34] <Trevinho> ensuring that you've all the dependencies needed
79 [21:34] <Trevinho> At this point the hardest thing begings
80 [21:35] <Trevinho> that's coding your feature
81 [21:35] <Trevinho> now... If you need some documentations for the libraries we mostly use
82 [21:35] <Trevinho> you can go to http://developer.ubuntu.com/resources/platform/api/
83 [21:38] <andyrock> So let's say we want to fix this bug
84 [21:38] <andyrock> he document that andyrock just linked is another useful tool you can use to understand how unity is made
85 [21:39] <andyrock> sorry :)
86 [21:39] <andyrock> http://www.google.it/url?sa=t&rct=j&q=alt%20%2B%20f4%20dash&source=web&cd=1&ved=0CCsQFjAA&url=https%3A%2F%2Fbugs.launchpad.net%2Fbugs%2F891818&ei=6LApT52gI8jc4QSr_bzYAw&usg=AFQjCNFLgM3TIF4Q5cR-2yTt7uWI_6rxgw&sig2=3e3RioCBKXjA-b4MgZFDxA
87 [21:39] <andyrock> sorry again :)
88 [21:40] <andyrock> https://bugs.launchpad.net/bugs/891818
89 [21:40] <andyrock> Dash - dash is not closed with alt+f4
90 [21:41] <andyrock> The first thing to do so is to study
91 [21:41] <andyrock> and the first question is: "What is the best way to solve this bug"
92 [21:42] <andyrock> Maybe we can just intercept the alt+f4 key and the close the dash
93 [21:42] <andyrock> but there is a best way...
94 [21:43] <andyrock> intercept a WM_DELETE_WINDOW message
95 [21:44] <andyrock> that is send from the windows manager when you press alt+f4
96 [21:44] <Trevinho> You can get this by using xev for example
97 [21:44] <Trevinho> an useful tool to understand what's going on an X window...
98 [21:44] <Trevinho> if you run it on a terminal and you do Alt+F4
99 [21:44] <andyrock> Why this is the best wat to do this?
100 [21:45] <Trevinho> you get an output:
101 [21:45] <Trevinho> ClientMessage event, serial 36, synthetic YES, window 0x6400001,
102 [21:45] <Trevinho> message_type 0x13a (WM_PROTOCOLS), format 32, message 0x138 (WM_DELETE_WINDOW)
103 [21:45] <andyrock> Why this is the best wat to do this?
104 [21:45] <andyrock> because it's easy to test
105 [21:46] <andyrock> and because if you change the key binding to close a window
106 [21:46] <andyrock> the code will continue to work :)
107 [21:46] <ClassBot> kedde asked: Is it possible to set up a breakpoint in an IDE?
108 [21:47] <andyrock> kedde, yes, but you need to do it using gdb
109 [21:47] <andyrock> from another tty
110 [21:47] <andyrock> so alt+ctrl+f1
111 [21:47] <andyrock> login
112 [21:47] <andyrock> then
113 [21:48] <andyrock> DISPLAY=:0 unity --advanced-debug
114 [21:48] <andyrock> or
115 [21:48] <andyrock> DISPLAY=:0 gdb --args compiz --replace
116 [21:49] <andyrock> Let's return to our bug...
117 [21:50] <ClassBot> There are 10 minutes remaining in the current session.
118 [21:50] <andyrock> so what we want to do is to intercepet that event
119 [21:51] <andyrock> you should know that the dash has an associated X window
120 [21:51] <andyrock> so we'll use that window to receive the event
121 [21:52] <andyrock> but we have a little problem :)
122 [21:52] <andyrock> we should add the support in nux
123 [21:52] <andyrock> to send the event to unity
124 [21:54] <andyrock> and this is the tricky part of this bug :)
125 [21:54] <andyrock> Now've not the time to go into the details
126 [21:55] <ClassBot> There are 5 minutes remaining in the current session.
127 [21:55] <Trevinho> Yes.. Anyway in that case basically you need to make nux get that event and to emit to a BaseWindow
128 [21:55] <Trevinho> then on the Unity side you only have to connect to that event and close the window
129 [21:55] <Trevinho> Now, in Precise we're also focusing a lot on testing
130 [21:56] <Trevinho> and on quality
131 [21:56] <Trevinho> so, tetsing can be another way to contribute to the project
132 [21:56] <Trevinho> We have many ways to test...
133 [21:56] <andyrock> Google test for example
134 [21:56] <andyrock> http://code.google.com/p/googletest/
135 [21:56] <Trevinho> They mostly depends on what you should test
136 [21:57] <Trevinho> so, we use google test when we have to just check a data structure, for example
137 [21:57] <Trevinho> or we use Autopilot https://wiki.ubuntu.com/Unity/QA/Autopilot to autogically move unity and check if it's doing the right thing
138 [21:57] <Trevinho> Give a look to Autopilot, it could be fun to test with it
139 [21:58] <Trevinho> So, we slightly shown the process we generally follow when doing something for unity
140 [21:58] <Trevinho> what we can say is that it's not that hard
141 [21:59] <Trevinho> if you know a little the language and you can use grep, you can just start to scratch your itches from now
142 [21:59] <Trevinho> fixing the bugs the most are breaking your head
143 [21:59] <Trevinho> Just branch unity, and have fun
144 [22:00] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/02/01/%23ubuntu-classroom.html
145 [22:00] <Trevinho> If you want, you can also check to our branches to see how to do things https://code.launchpad.net/~3v1n0/unity and https://code.launchpad.net/~andyrock/unity
146 [22:00] <andyrock> thank you guys
147 [22:01] <Trevinho> Thank you all
148 [22:01] <Trevinho> Hope to see your code in launchpad, and to review it! ;)
MeetingLogs/devweek1201/FixingSmallBugsInUnity (last edited 2012-02-02 09:34:09 by dholbach)