User Tools

Site Tools


library-hacking

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

library-hacking [2012/07/14 16:13]
127.0.0.1 external edit
library-hacking [2016/01/03 19:50] (current)
didier [Submitting your modifications] add an example of ci msg
Line 3: Line 3:
 Follow this procedure in order to know how to get and modify the in-development source code of the ROHC library and send your changes for inclusion in the library. Follow this procedure in order to know how to get and modify the in-development source code of the ROHC library and send your changes for inclusion in the library.
  
-===== Get source code with Bazaar ​=====+===== Get source code with Git =====
  
-In order to modify the ROHC library, you must first get the in-development source code of the library. This may be achieved by using the Bazaar (bzr) Version Control System (VCS). ​Bazaar ​may often be found in the software packages of your distribution. Otherwise, ​follow ​the instructions at http://bazaar-vcs.org/Download. You may also want to read the Bazaar User Guide at http://doc.bazaar-vcs.org/latest/​en/​user-guide/​index.html. In any case, you may get help by running 'bzr help' or 'bzr help <​command>'​ at the shell prompt.+In order to modify the ROHC library, you must first get the in-development source code of the library. This may be achieved by using the [[wp>​Revision control|Version Control System (VCS)]] called [[wp>Git (software)|Git]]Git may often be found in the software packages of your distribution. Otherwise, ​get it from the [[http://git-scm.com/downloads|official web site]]. You may also want to read the [[http://git-scm.com/doc|Git documentation]]. In any case, you may get help by running ''git --help'' or ''​git ​<​command> ​--help'​' at the shell prompt.
  
 To get a fresh copy of the source code, type the following:<​code>​ To get a fresh copy of the source code, type the following:<​code>​
-bzr branch lp:​rohc</​code>​+git clone https://​github.com/​didier-barvaux/​rohc.git</​code>​
  
-You should now have a copy of the ROHC repository on your disk in the '​rohc'​ subdirectory.+You should now have a copy of the ROHC repository on your disk in the ''rohc'' subdirectory.
  
 +You may speed up the download by retrieving only the last N changesets, eg. for 10 changesets:<​code>​
 +$ git clone --depth 10 https://​github.com/​didier-barvaux/​rohc.git</​code>​
 ===== Build the source code ===== ===== Build the source code =====
  
-Enter the '​rohc'​ subdirectory and then follow the instructions to [[library-install-sources#​versions_1301|configure and build the library]] starting with step 7.+Enter the ''rohc'' subdirectory and then follow the instructions to [[library-install-sources#​native_build_on_unix-like_systems|configure and build the library]] starting with step 4.
  
 ===== Run the non-regression tests ===== ===== Run the non-regression tests =====
  
-Follow the [[library-tests#​versions_140|instructions to run the non-regression tests]]. It is important that there is no regression in the source code before you start modifying the library.+Follow the [[library-tests|instructions to run the non-regression tests]]. It is important that there is no regression in the source code before you start modifying the library.
  
 ===== Modifying the source code ===== ===== Modifying the source code =====
  
-Use your favorite ​code editor to change the source ​code of the ROHC library.+First create a local Git branch to host your changes:<​code
 +$ git checkout -b dev_my_cool_feature</​code>
  
-You may have a look at the [[http://​rohc-lib.org/​|API documentation]]. You may also read the [[http://​lists.launchpad.net/​rohc/​|questions asked by developers]] on the public mailing list dedicated to the ROHC library or [[http://​launchpad.net/​~rohc/​+join|send new questions by subscribing to the list]].+Then, use your favorite code editor to change the source code of the ROHC library. 
 + 
 +You may have a look at the [[https://​rohc-lib.org/​support/​documentation/#​library-api|API documentation]]. You may also read the [[http://​lists.launchpad.net/​rohc/​|questions asked by developers]] on the public mailing list dedicated to the ROHC library or [[http://​launchpad.net/​~rohc/​+join|send new questions by subscribing to the list]].
  
 ===== Building and testing your changes ===== ===== Building and testing your changes =====
  
-Please build your changes on different environments. Please also test your changes by running the non-regression ​tests. Adding new tests that check your changes is also a great idea.+Please build your changes on different environments. Please also test your changes by running the [[library-tests|library tests]]. Adding new tests that check your changes is also a great idea.
  
 ===== Submitting your modifications ===== ===== Submitting your modifications =====
  
-Add all new source or capture files with Bazaar:<​code>​ +Add all new source or capture files with Git:<​code>​ 
-bzr add <new source files> <new captures files></​code>​+git add <new source files> <new captures files> 
 +$ git commit</​code>​ 
 +Your default editor pops up. Write a short summary on first line, leave an empty line, then write a longer description on the next lines. Example:<​code>​ 
 +TCP profile: handle sack_unchanged_irregular() encoding 
 +     
 +The ROHC compressor had no support for the sack_unchanged_irregular() 
 +encoding, so the decoding part in the ROHC decompressor was untested 
 +and wrong. 
 + 
 +This change adds support for the sack_unchanged_irregular() encoding to 
 +the ROHC compressor. It also fixes the support at decompressor. 
 + 
 +The problem was reported and fixed by Klaus Warnke in bug #​1496023.</​code>​ 
 + 
 +Make more changes if needed. Don't forget to add and commit them.
  
-Create a patch that contains all your modifications ​(or several small patches if applicable) ​with Bazaar:<​code>​ +When your feature is complete, create the patches ​that contains all your modifications with Git:<​code>​ 
-bzr diff > /path/to/my/patch</​code>​+git format-patch -o patchesremotes/origin/HEAD</​code>​ 
 +The generated patches are available in the ''​patches/''​ folder.
  
-Now, send an email to the ROHC mailing list. Please describe carefully your changes and attach your patch. Be careful to not send too large attachments (this could be the case if you added some non-regression tests with PCAP files). Put your files on an HTTP or FTP server and send a link to them to the mailing list.+Now, send an email to the ROHC mailing list. Please describe carefully your changes and attach your patches. Be careful to not send too large attachments (this could be the case if you added some non-regression tests with PCAP files). Put your files on a public ​HTTP/FTP server ​or any upload platform of your choice ​and send a link to them to the mailing list. You may also upload your Git repository to [[https://​github.com/​didier-barvaux/​rohc|GitHub]].
  
library-hacking.1342282390.txt.gz · Last modified: 2015/05/25 12:47 (external edit)