1*7c568831SAndroid Build Coastguard Worker# Maintainer's Guide 2*7c568831SAndroid Build Coastguard Worker 3*7c568831SAndroid Build Coastguard Worker## Working with the test suite 4*7c568831SAndroid Build Coastguard Worker 5*7c568831SAndroid Build Coastguard WorkerMost of the tests are contained in the `runtest` executable which 6*7c568831SAndroid Build Coastguard Workergenerally reads test cases from the `test` directory and compares output 7*7c568831SAndroid Build Coastguard Workerto files in the `result` directory. 8*7c568831SAndroid Build Coastguard Worker 9*7c568831SAndroid Build Coastguard WorkerYou can simply add new test cases and run `runtest -u` to update the 10*7c568831SAndroid Build Coastguard Workerresults. If you debug test failures, it's also useful to execute 11*7c568831SAndroid Build Coastguard Worker`runtest -u` and then `git diff result` to get a diff between actual and 12*7c568831SAndroid Build Coastguard Workerexpected results. You can restore the original results by running 13*7c568831SAndroid Build Coastguard Worker`git restore result` and `git clean -xd result`. 14*7c568831SAndroid Build Coastguard Worker 15*7c568831SAndroid Build Coastguard Worker## Generated files 16*7c568831SAndroid Build Coastguard Worker 17*7c568831SAndroid Build Coastguard WorkerThe documentation and other generated files can be rebuilt by running 18*7c568831SAndroid Build Coastguard Worker 19*7c568831SAndroid Build Coastguard Worker make -C doc rebuild 20*7c568831SAndroid Build Coastguard Worker 21*7c568831SAndroid Build Coastguard WorkerThis requires `xsltproc`, the DocBook stylesheets in your XML Catalog 22*7c568831SAndroid Build Coastguard Workerand the libxml2 Python bindings to be installed, so it's best done on a 23*7c568831SAndroid Build Coastguard WorkerLinux system. On Debian/Ubuntu, try 24*7c568831SAndroid Build Coastguard Worker 25*7c568831SAndroid Build Coastguard Worker apt install xsltproc python3-libxml2 docbook-xsl docbook-xml 26*7c568831SAndroid Build Coastguard Worker 27*7c568831SAndroid Build Coastguard Workerdoc/apibuild.py generates doc/libxml2-api.xml which is used to generate 28*7c568831SAndroid Build Coastguard Worker 29*7c568831SAndroid Build Coastguard Worker- API documentation with XSLT stylesheets 30*7c568831SAndroid Build Coastguard Worker- testapi.c with gentest.py 31*7c568831SAndroid Build Coastguard Worker- Python bindings with python/generator.py 32*7c568831SAndroid Build Coastguard Worker 33*7c568831SAndroid Build Coastguard WorkerMan pages and HTML documentation for xmllint and xmlcatalog are 34*7c568831SAndroid Build Coastguard Workergenerated with xsltproc and DocBook stylesheets. 35*7c568831SAndroid Build Coastguard Worker 36*7c568831SAndroid Build Coastguard Worker## Making a release 37*7c568831SAndroid Build Coastguard Worker 38*7c568831SAndroid Build Coastguard Worker### Rebuild generated files and documentation 39*7c568831SAndroid Build Coastguard Worker 40*7c568831SAndroid Build Coastguard WorkerSee above for details and run `make -C doc rebuild`. 41*7c568831SAndroid Build Coastguard Worker 42*7c568831SAndroid Build Coastguard WorkerLook for new warning messages and inspect changes for correctness 43*7c568831SAndroid Build Coastguard Workerbefore committing. 44*7c568831SAndroid Build Coastguard Worker 45*7c568831SAndroid Build Coastguard Worker### Update the NEWS file 46*7c568831SAndroid Build Coastguard Worker 47*7c568831SAndroid Build Coastguard WorkerYou can get started by running 48*7c568831SAndroid Build Coastguard Worker 49*7c568831SAndroid Build Coastguard Worker git log --format='- %s (%an)' [previous-release-tag].. 50*7c568831SAndroid Build Coastguard Worker 51*7c568831SAndroid Build Coastguard Worker### Bump the version number 52*7c568831SAndroid Build Coastguard Worker 53*7c568831SAndroid Build Coastguard WorkerUpdate the version number in `VERSION` if you haven't done so already. 54*7c568831SAndroid Build Coastguard Worker 55*7c568831SAndroid Build Coastguard Worker### Build the tarball 56*7c568831SAndroid Build Coastguard Worker 57*7c568831SAndroid Build Coastguard WorkerI'd recommend to build the tarball by running 58*7c568831SAndroid Build Coastguard Worker 59*7c568831SAndroid Build Coastguard Worker make distcheck 60*7c568831SAndroid Build Coastguard Worker 61*7c568831SAndroid Build Coastguard Workerwhich performs some useful checks as well. 62*7c568831SAndroid Build Coastguard Worker 63*7c568831SAndroid Build Coastguard Worker### Upload the tarball 64*7c568831SAndroid Build Coastguard Worker 65*7c568831SAndroid Build Coastguard WorkerFollow the instructions at 66*7c568831SAndroid Build Coastguard Worker<https://wiki.gnome.org/MaintainersCorner/Releasing>: 67*7c568831SAndroid Build Coastguard Worker 68*7c568831SAndroid Build Coastguard Worker scp libxml2-[version].tar.xz master.gnome.org: 69*7c568831SAndroid Build Coastguard Worker ssh master.gnome.org ftpadmin install libxml2-[version].tar.xz 70*7c568831SAndroid Build Coastguard Worker 71*7c568831SAndroid Build Coastguard Worker### Tag the release 72*7c568831SAndroid Build Coastguard Worker 73*7c568831SAndroid Build Coastguard WorkerCreate an annotated tag and push it: 74*7c568831SAndroid Build Coastguard Worker 75*7c568831SAndroid Build Coastguard Worker git tag -a [version] -m 'Release [version]' 76*7c568831SAndroid Build Coastguard Worker git push origin [version] 77*7c568831SAndroid Build Coastguard Worker 78*7c568831SAndroid Build Coastguard Worker### Create a GitLab release 79*7c568831SAndroid Build Coastguard Worker 80*7c568831SAndroid Build Coastguard WorkerCreate a new GitLab release on 81*7c568831SAndroid Build Coastguard Worker<https://gitlab.gnome.org/GNOME/libxml2/-/releases>. 82*7c568831SAndroid Build Coastguard Worker 83*7c568831SAndroid Build Coastguard Worker### Announce the release 84*7c568831SAndroid Build Coastguard Worker 85*7c568831SAndroid Build Coastguard WorkerAnnounce the release on https://discourse.gnome.org under topics 'libxml2' 86*7c568831SAndroid Build Coastguard Workerand 'announcements'. 87*7c568831SAndroid Build Coastguard Worker 88*7c568831SAndroid Build Coastguard Worker## Breaking the ABI 89*7c568831SAndroid Build Coastguard Worker 90*7c568831SAndroid Build Coastguard WorkerUnfortunately, libxml2 exposes many internal structs which makes some 91*7c568831SAndroid Build Coastguard Workerbeneficial changes impossible without breaking the ABI. 92*7c568831SAndroid Build Coastguard Worker 93*7c568831SAndroid Build Coastguard WorkerThe following changes are allowed (after careful consideration): 94*7c568831SAndroid Build Coastguard Worker 95*7c568831SAndroid Build Coastguard Worker- Appending members to structs which client code should never allocate 96*7c568831SAndroid Build Coastguard Worker directly. A notable example is xmlParserCtxt. Other structs like 97*7c568831SAndroid Build Coastguard Worker xmlError are allocated directly by client code and must not be changed. 98*7c568831SAndroid Build Coastguard Worker 99*7c568831SAndroid Build Coastguard Worker- Making a void function return a value. 100*7c568831SAndroid Build Coastguard Worker 101*7c568831SAndroid Build Coastguard Worker- Making functions accept const pointers unless it's a typedef for a 102*7c568831SAndroid Build Coastguard Worker callback. 103*7c568831SAndroid Build Coastguard Worker 104*7c568831SAndroid Build Coastguard Worker- Changing signedness of struct members or function arguments. 105*7c568831SAndroid Build Coastguard Worker 106*7c568831SAndroid Build Coastguard Worker## Updating the CI Docker image 107*7c568831SAndroid Build Coastguard Worker 108*7c568831SAndroid Build Coastguard WorkerNote that the CI image is used for libxslt as well. First create a 109*7c568831SAndroid Build Coastguard WorkerGitLab access token with `read_registry` and `write_registry` 110*7c568831SAndroid Build Coastguard Workerpermissions. Then run the following commands with the Dockerfile in the 111*7c568831SAndroid Build Coastguard Worker.gitlab-ci directory: 112*7c568831SAndroid Build Coastguard Worker 113*7c568831SAndroid Build Coastguard Worker docker login -u <username> -p <access_token> \ 114*7c568831SAndroid Build Coastguard Worker registry.gitlab.gnome.org 115*7c568831SAndroid Build Coastguard Worker docker build -t registry.gitlab.gnome.org/gnome/libxml2 - \ 116*7c568831SAndroid Build Coastguard Worker < .gitlab-ci/Dockerfile 117*7c568831SAndroid Build Coastguard Worker docker push registry.gitlab.gnome.org/gnome/libxml2 118*7c568831SAndroid Build Coastguard Worker 119