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-fast 67 68This actually builds the tarball, then untars it, configure/compile 69the untarred source code and launches the regression checks from 70there. 71 72Here, "make distcheck-fast" is a variant of the standard "make distcheck". 73It compresses with "--fast" instead of default "--best", and is 74significantly faster, given the size of the distribution. You very likely 75want to use that one for local regression testing. (However, don't use 76"make distcheck-fast" to create artifacts for distribution.) 77 78You can also launch this in parallel by doing: 79 80 make -jN -lN distcheck-fast 81 82with N being the number of processor core you have on your system. 83 84Please make sure you always launch "make distcheck-fast" before sending a 85patch, so that you are sure that we can always build a tarball after 86your patch is applied to the source tree. 87 88A complementary regression checking target is "check-self-compare". 89You invoke it by doing "make check-self-compare". That target 90analyzes the ABI of the libabigail.so shared object, serializes it 91into the ABIXML format and then compares the ABI internal 92representation gathered from the libabigail.so binary against the one 93gathered from the ABIXML format. The two should be equal if 94everything goes right. This is an important regression test. The 95problem is that it can take a considerable amount of time. 96So we've put it into its own separate target. 97 98So, to be complete the regression checking command to run against your 99patch should be: "make check-self-compare distcheck-fast -j16", if you have 100a machine with a 16 threads processors, for instance. 101 102Launching regression tests in Valgrind 103-------------------------------------- 104 105To detect memory management errors, the tests of the regression test 106suite can be run using Valgrind tools, essentially memcheck and 107helgrind. 108 109To do so, please do: 110 111 make check-valgrind 112 113This runs the tests under the control of the Valgrind memcheck and 114helgrind tools. 115 116But then, if you want Valgrind to check the libabigail command line 117tools that are *forked* by some of the tests then type: 118 119 make check-valgrind-recursive 120 121This one takes a long time. On my system for instance, it takes an 122hour. But then it checks *everything*. If you don't have that time, 123then "make check-valgrind" is enough, as the regression tests that use 124the libabigail *library* directly (as opposed to forking libabigail 125command line tools) will be verified. 126 127How tests are organized 128----------------------- 129 130There are two kinds of regression tests. Those that use the 131libabigail *library* directly, and those that spawn one of the 132libabigail command line tools. 133 134Generally, both are usually made of a loop that churns through a set of input 135binaries to compare. Once the comparison is done, the resulting 136report is compared against a reference report that is provided. 137 138Test executables have names that starts with 'runtest*'. For instance, 139under <build-directory>/tests/ you can find tests named 140runtestdiffdwarf, runtestabidiff, etc... 141 142If a test executable is named 143<build-directory>/tests/runtestdiffdwarf, then its source code is 144tests/test-diff-dwarf.cc. Similarly, the source code of the test 145<build-directory>/tests/runtestabidiff is tests/test-abidiff.cc. 146 147The data provided for each test (for instance the input binaries to 148compare and the reference report that should result from the 149comparison) is to be found under tests/data. So data for the test 150runtestdiffdwarf is to be found under tests/data/test-diff-dwarf. 151Data for the test runtestabidiff is to be found under 152tests/data/test-abidiff.cc. 153 154So adding your own tests usually just amounts to adding the right input 155into the right sub-directory of tests/data/. To do so, 156look at several tests/test-*.cc to see which one you'd like to add 157some input binaries to be compared in. 158 159Then once you know which tests/test-*.cc you'd like to extend, and if 160you added your input binaries and reference reports (maybe other 161things too) to the right sub-director of tests/data/, you just need to 162extend the array of input binaries/reference reports that the test 163walks to perform the comparisons. It's generally a global variable 164before the main() function of the test. In test-diff-dwarf.cc, for 165instance, the variable name is "in_out_specs". You just have to add a 166new entry to that array; that new entry contains the paths to your new 167input binaries and reference reports. Just read the code in there and 168use your brains. It should be straight forward. 169 170Ah, also, if you added new files for the tests, then the build system 171needs to be told that those files have to be added to the distribution 172tarball when we do "make dist" (or make distcheck). To do so, please 173make sure to add your new test input files to the 174tests/data/Makefile.am file, in the EXTRA_DIST variable. Look at how 175things are organized in that file, and please do things similarly. 176 177fedabipkgdiff testing 178--------------------- 179 180This depends on the Python koji and a few support modules. If these are 181not available, 'configure' disables fedabipkgdiff and its 'make check' 182testing. 183 184Debian and Ubuntu, for example, don't provide packages for the Python 185koji module. If you'd like to run fedabipkgdiff testing without manually 186doing a proper Koji installation, you may simply download Koji sources 187(<https://pagure.io/koji>, releases, or Git clone) and point to these via 188the Python search path. For example, tested 2021-12-11: 189 190 wget https://pagure.io/koji/archive/koji-1.27.0/koji-koji-1.27.0.tar.gz 191 tar -xzf koji-koji-1.27.0.tar.gz 192 export PYTHONPATH="$PWD"/koji-koji-1.27.0 193 194A libabigail 'configure' run then enables fedabipkgdiff and its 195'make check' testing. 196 197Coding language and style 198========================== 199 200The coding style is self evident when reading the source code. So 201please, stick to and mimic what is already in there for the sake of 202consistency at very least. Just for history, it's derived from the 203style of the C++ standard library from the GNU project. 204 205As of libabigail 2.0, the language we use is C++ 11. The level 206supported is the one supported by the GCC 4.8.x series of compilers. 207This should be old and well tested enough to be supported by your 208current favorite compiler. 209 210Initially, the code base of the project was written in C++03, with the 211TR1 extensions. That heritage is well visible in the code base as it 212is today. 213 214Please do not rush and send gazillions of patches that just re-write 215tons of code into your favorite C++ 11 flavour du jour. We will 216likely reject those patches. We want to keep the history of the code 217base in such a way that tools like "git blame <sourcefile> are still 218useful. 219 220So we'll accept patches changing parts of the code base to more recent 221C++ 11 constructs only if you happen to add functionality or fix 222things in that area. If it makes "cultural common" sense to adopt 223those constructs. What I mean by "cultural" is that must make sense 224in relative to the culture of the project. And yes, that is 225subjective. Sorry. 226 227As a generic rule, we tend to favor the lowest possible level of 228abstraction that makes sense without requiring future maintainers of 229the project to have a PhD in design patterns. We are not impressed by 230design patterns. We use them where they make clear sense, but we 231don't idolize them. Put it another way, we will always favor the one 232who *READS* and debug the code over the one who writes it. To put 233things in a hypothetical perspective, we'll rather accept a repetitive 234code that stays simple to read and debug over a highly abstract one 235using meta programming to save a few lines of repetitive code located 236in a very small number of places. 237 238Really, in this project, we care about low level binary analysis 239stuff. Issues in that area can be hard to reproduce and quite 240challenging to debug. So having tons of abstraction layers in the 241code base have proven to be a maintenance burden over the years, from 242our experience in working on similar projects. So please help us 243avoid those mistakes that we make just for the pleasure of writing 244what can look as "pleasant code" at a first naive sight. 245 246That being said, we also love cleanly designed APIs that are fairly 247re-usable and well documented. And we also praise abstraction and 248modularisation that we recognize as being the most basic tools of any 249engineer. So we like to think about ourselves as well rounded people 250who care about maintaining things for a long time to come :-) 251 252Sign your work 253============== 254 255To facilitate tracking of who did what, we've adopted a "sign-off" 256procedure for patches based on the procedure used by the Linux kernel 257project. 258 259The sign-off is a simple line at the end of the explanation for the 260patch, which certifies that you wrote it or otherwise have the right 261to pass it on as a patch under an appropriate license. The rules are 262pretty simple: if you can certify the below: 263 264 Developer's Certificate of Origin 265 266 By making a contribution to this project, I certify that: 267 268 (a) The contribution was created in whole or in part by me, 269 and I have the right to submit the contribution under the 270 license indicated in, or otherwise designated as being 271 applicable to, the file. 272 273 (b) The contribution was provided directly to me by some other 274 person who certified (a), and I have not modified it. 275 276 (c) I understand and agree that the project and the 277 contribution are public and that a record of the 278 contribution (including all personal information I submit 279 with it, including my sign-off) is maintained indefinitely 280 and may be redistributed. 281 282then you just add a line saying 283 284Signed-off-by: Random J Developer <random@developer.example.org> 285 286using your real name (sorry, no pseudonyms or anonymous contributions.) 287 288git commit --signoff will add such a Signed-off-by line at the end of 289the commit log message for you. 290 291Modifying the website 292===================== 293 294The source code of the website of libabigail is stored in CVS (sigh, 295yeah, that is so old school). You can check out that web source code 296by doing: 297 298 CVS_RSH=ssh cvs -z9 -d :ext:user@sourceware.org:/cvs/libabigail/ co htdocs 299 300where 'user' is your username on the sourceware system. 301Alternatively, you can check out the the web source code anonymously, 302if you don't have any user account on the sourceware system by doing: 303 304 export CVSROOT=:pserver:anoncvs@cygwin.com:/cvs/libabigail 305 cvs login 306 (the CVS anonymous password to use is "anoncvs") 307 cvs checkout htdocs 308 309 310Happy Hacking! 311