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