• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Contact
2=======
3
4The project homepage is at https://sourceware.org/libabigail
5
6The current libabigail source code can be checked out with:
7git clone git://sourceware.org/git/libabigail
8
9The mailing list to send messages and patches to is
10libabigail@sourceware.org.
11
12The archives of that list are available at http://sourceware.org/ml/libabigail.
13
14File bugs
15=========
16
17Bugs are to be filled in bugzilla at
18https://sourceware.org/bugzilla/enter_bug.cgi?product=libabigail
19
20Writing and sending patches
21============================
22
23Please supply patches using git format-patch and git send-email.  If
24you don't know how to use git, send-email, fine.  Just use your
25favorite email client, attach the patch to a nice message, and send us
26the message.
27
28Patches have to be sent by email to libabigail@sourceware.org.
29
30Please read the file COMMIT-LOG-GUIDELINES in the source tree to learn
31about how to write the commit log accompanying the patch.
32
33If you are adding a new public header file to the project, or if you
34are defining a new entry point to the API of libabigail, please take
35some time to read the file VISIBILITY about how you need to handle the
36visibility of symbols that are part of the API and ABI of libabigail.
37
38Make sure you sign your patch.  To learn about signing, please read
39the "Sign your work" chapter below.
40
41One important thing to do before sending your patch is to launch the
42regression tests.
43
44Regression tests
45================
46
47Regression tests are under the directory 'tests'.  They are usually
48written in C++ and are especially designed to be easy to debug.  The
49idea is that if the test fails, the programmer should just have to
50launch them under GDB and debug them right away.  No-bullshit style.
51
52Regression tests are launched by doing:
53
54   make check
55
56If you have N processor cores on your machine, you can launch the
57tests in parallel to make whole thing go faster by doing:
58
59  make -jN -lN check
60
61If you want to test the fabrication of the distribution tarball (this
62is important, because that is how we do to actually release the
63tarball of the project that you can download from the internet) then
64you can do:
65
66  make distcheck
67
68This actually builds the tarball, then untars it, configure/compile
69the untarred source code and launches the regression checks from
70there.
71
72You can also launch this in parallel by doing:
73
74  make -jN -lN distcheck
75
76with N being the number of processor core you have on your system.
77
78Please make sure you always launch "make distcheck" before sending a
79patch, so that you are sure that we can always build a tarball after
80your patch is applied to the source tree.
81
82A variant of distcheck is "make distcheck-fast".  It's like "make
83distcheck" but it's faster.  You can just use that one.
84
85A complementary regression checking target is "check-self-compare".
86You invoke it by doing "make check-self-compare".  That target
87analyzes the ABI of the libabigail.so shared object, serializes it
88into the ABIXML format and then compares the ABI internal
89representation gathered from the libabigail.so binary against the one
90gathered from the ABIXML format.  The two should be equal if
91everything goes right.  This is an important regression test.  The
92problem is that it can takes twice as much time as make distcheck.  So
93we've put it into its own separate target.
94
95So, to be complete the regression checking command to run against your
96patch should be: "make check-self-compare distcheck -j16", if you have
97a machine with a 16 threads processors, for instance.
98
99Coding language and style
100==========================
101
102The coding style is self evident when reading the source code.  So
103please, stick to and mimic what is already in there for the sake of
104consistency at very least.  Just for history, it's derived from the
105style of the C++ standard library from the GNU project.
106
107As of libabigail 2.0, the language we use is C++ 11.  The level
108supported is the one supported by the GCC 4.8.x series of compilers.
109This should be old and well tested enough to be supported by your
110current favorite compiler.
111
112Initially, the code base of the project was written in C++03, with the
113TR1 extensions.  That heritage is well visible in the code base as it
114is today.
115
116Please do not rush and send gazillions of patches that just re-write
117tons of code into your favorite C++ 11 flavour du jour.  We will
118likely reject those patches.  We want to keep the history of the code
119base in such a way that tools like "git blame <sourcefile> are still
120useful.
121
122So we'll accept patches changing parts of the code base to more recent
123C++ 11 constructs only if you happen to add functionality or fix
124things in that area.  If it makes "cultural common" sense to adopt
125those constructs.  What I mean by "cultural" is that must make sense
126in relative to the culture of the project.  And yes, that is
127subjective.  Sorry.
128
129As a generic rule, we tend to favor the lowest possible level of
130abstraction that makes sense without requiring future maintainers of
131the project to have a PhD in design patterns.  We are not impressed by
132design patterns.  We use them where they make clear sense, but we
133don't idolize them.  Put it another way, we will always favor the one
134who *READS* and debug the code over the one who writes it.  To put
135things in a hypothetical perspective, we'll rather accept a repetitive
136code that stays simple to read and debug over a highly abstract one
137using meta programming to save a few lines of repetitive code located
138in a very small number of places.
139
140Really, in this project, we care about low level binary analysis
141stuff.  Issues in that area can be hard to reproduce and quite
142challenging to debug.  So having tons of abstraction layers in the
143code base have proven to be a maintenance burden over the years, from
144our experience in working on similar projects.  So please help us
145avoid those mistakes that we make just for the pleasure of writing
146what can look as "pleasant code" at a first naive sight.
147
148That being said, we also love cleanly designed APIs that are fairly
149re-usable and well documented.  And we also praise abstraction and
150modularisation that we recognize as being the most basic tools of any
151engineer.  So we like to think about ourselves as well rounded people
152who care about maintaining things for a long time to come :-)
153
154Launching regression tests in Valgrind
155--------------------------------------
156
157To detect memory management errors, the tests of the regression test
158suite can be run using Valgrind tools, essentially memcheck and
159helgrind.
160
161To do so, please do:
162
163  make check-valgrind
164
165This runs the tests under the control of Valgrind memcheck and
166helgrind tools.
167
168But then, if you want Valgrind to check the libabigail command line
169tools that are *forked* by some of the tests then type:
170
171  make check-valgrind-recursive
172
173This one takes a long time.  On my system for instance, it takes an
174hour.  But then it checks *everything*.  If you don't have that time,
175then "make check-valgrind" is enough, as the regression tests that use
176the libabigail *library* directly (as opposed to forking libabigail
177command line tools) will be verified.
178
179How tests are organized
180-----------------------
181
182There are two kinds of regression tests.  Those that use the
183libabigail *library* directly, and those that spawn one of the
184libabigail command line tools.
185
186Generally, both are usually made of a loop that churns through a set of input
187binaries to compare.  Once the comparison is done, the resulting
188report is compared against a reference report that is provided.
189
190Test executable have names that starts with 'runtest*'.  For instance,
191under <build-directory>/tests/ you can find tests named
192runtestdiffdwarf, runtestabidiff, etc...
193
194If a test executable is named
195<build-directory>/tests/runtestdiffdwarf, then its source code is
196tests/test-diff-dwarf.cc.  Similarly, the source code of the test
197<build-directory>/tests/runtestabidiff is tests/test-abidiff.cc.
198
199The data provided for each test (for instance the input binaries to
200compare and the reference report that should result from the
201comparison) is to be found under tests/data.  So data for the test
202runtestdiffdwarf is to be found under tests/data/test-diff-dwarf.
203Data for the test runtestabidiff is to be found under
204tests/data/test-abidiff.cc.
205
206So adding your own tests usually just amounts to adding the input
207right input into the right sub-directory of tests/data/.  To do so,
208look at several tests/test-*.cc to see which one you'd like to add
209some input binaries to be compared in.
210
211Then once you know which tests/test-*.cc you'd like to extend, and if
212you added your input binaries and reference reports (maybe other
213things too) to the right sub-director of tests/data/, you just need to
214extend the array of input binaries/reference reports that the test
215walks to perform the comparisons.  It's generally a global variable
216before the main() function of the test.  In test-diff-dwarf.cc, for
217instance, the variable name is "in_out_specs".  You just have to add a
218new entry to that array; that new entry contains the paths to your new
219input binaries and reference reports.  Just read the code in there and
220use your brains.  It should be straight forward.
221
222Ah, also, if you added new files for the tests, then the build system
223needs to be told that those files have to be added to the distribution
224tarball when we do "make dist" (or make distcheck).  To do so, please
225make sure to add your new test input files to the
226tests/data/Makefile.am file, in the EXTRA_DIST variable.  Look at how
227things are organized in that file, and please do things similarly.
228
229Sign your work
230==============
231
232To facilitate tracking of who did what, we've adopted a "sign-off"
233procedure for patches based on the procedure used by the Linux kernel
234project.
235
236The sign-off is a simple line at the end of the explanation for the
237patch, which certifies that you wrote it or otherwise have the right
238to pass it on as a patch under an appropriate license. The rules are
239pretty simple: if you can certify the below:
240
241        Developer's Certificate of Origin
242
243        By making a contribution to this project, I certify that:
244
245	(a) The contribution was created in whole or in part by me,
246	    and I have the right to submit the contribution under the
247	    license indicated in, or otherwise designated as being
248	    applicable to, the file.
249
250        (b) The contribution was provided directly to me by some other
251            person who certified (a), and I have not modified it.
252
253        (c) I understand and agree that the project and the
254            contribution are public and that a record of the
255            contribution (including all personal information I submit
256            with it, including my sign-off) is maintained indefinitely
257            and may be redistributed.
258
259then you just add a line saying
260
261Signed-off-by: Random J Developer <random@developer.example.org>
262
263using your real name (sorry, no pseudonyms or anonymous contributions.)
264
265git commit --signoff will add such a Signed-off-by line at the end of
266the commit log message for you.
267
268Modifying the website
269=====================
270
271The source code of the website of libabigail is stored in CVS (sigh,
272yeah, that is so old school).  You can check out that web source code
273by doing:
274
275    CVS_RSH=ssh cvs -z9 -d :ext:user@sourceware.org:/cvs/libabigail/ co htdocs
276
277where 'user' is your username on the sourceware system.
278Alternatively, you can check out the the web source code anonymously,
279if you don't have any user account on the sourceware system by doing:
280
281    export CVSROOT=:pserver:anoncvs@cygwin.com:/cvs/libabigail
282    cvs login
283    (the CVS anonymous password to use is "anoncvs")
284    cvs checkout htdocs
285
286
287Happy Hacking!
288