Changes between Version 1 and Version 2 of Obsolete/Development/Build
- Timestamp:
- Mar 21, 2010, 10:50:38 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Obsolete/Development/Build
v1 v2 4 4 5 5 Any part of quattor susceptible of being packaged in a software unit is called a ''product''. We distinguish two classes of products: 6 * '''NCM components''' which live in the subtrees <tt>{trunk/,tags/}ncm-components/</tt>;6 * '''NCM components''' which live in the subtrees `{trunk/,tags/}ncm-components/`; 7 7 * '''core modules''' all the others. 8 8 9 Each core module has its own pointer to the build tools, which appears as a normal subdirectory named <tt>quattor-build-tools</tt> in the checkout directory. For NCM components there is instead a single pointer located at <tt>quattor/ncm-components/</tt>. '''In any case, please, refrain from making any change to the content of any <tt>quattor-build-tools</tt>directory!'''9 Each core module has its own pointer to the build tools, which appears as a normal subdirectory named `quattor-build-tools` in the checkout directory. For NCM components there is instead a single pointer located at `quattor/ncm-components/`. '''In any case, please, refrain from making any change to the content of any `quattor-build-tools` directory!''' 10 10 11 11 = System requirements = 12 The framework is based on GNU <tt>make</tt>, <tt>sed</tt>, <tt>grep</tt>, <tt>perl</tt>, etc. Please make sure you're using some version of GNU/Linux. MacOS, BSD and others are '''not''' supported. Then of course, you need a recent version (at least <tt>>= 1.4.4</tt>) of <tt>svn</tt>.12 The framework is based on GNU '''make''', '''sed''', '''grep''', '''perl''', etc. Please make sure you're using some version of GNU/Linux. MacOS, BSD and others are '''not''' supported. Then of course, you need a recent version (at least `>= 1.4.4`) of `svn`. 13 13 14 14 = Workspace setup = 15 15 First, make sure your finger information is up-to-date. This is needed to fill the 'author' field in the change logs. If needed run the following command: 16 16 {{{ 17 17 $ chfn -f <full-name> -o <email-address> <your-login> 18 18 }}} 19 19 We recommend to check out repository directories with their original names, f.i.: 20 20 {{{ 21 21 $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/foo/bar quattor/foo/bar 22 22 }}} 23 23 The above command makes <tt>$PWD/quattor</tt> your working directory (a.k.a. the quattor checkout root). 24 24 If however you prefer to use a different checkout root as a working directory, you should set the following environment variable: 25 25 {{{ 26 26 $ export QTTR_CO_ROOT=/your/quattor/working/dir 27 28 Better off placing it in your <tt>~/.bashrc</tt>. Make sure you have write permission on <tt>/your/quattor/working/dir</tt>! The above variable will help the build tools to guess where to create the tags in your local system.27 }}} 28 Better off placing it in your `~/.bashrc`. Make sure you have write permission on `/your/quattor/working/dir`! The above variable will help the build tools to guess where to create the tags in your local system. 29 29 30 30 == Core modules == 31 31 In order to work with core modules, just check out the directory you're interested in, f.i.: 32 32 {{{ 33 33 $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/trunk/ccm quattor/trunk/ccm 34 34 }}} 35 35 then 36 36 {{{ 37 37 $ cd quattor/trunk/ccm 38 38 $ make ... 39 }}} 39 40 40 41 == NCM components == 41 42 In order to work with NCM components, you need to check out the '''whole''' components' tree, i.e., for the head revisions: 42 43 {{{ 43 44 $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/trunk/ncm-components \ 44 45 quattor/trunk/ncm-components 45 46 }}} 46 47 and for the tags: 47 48 {{{ 48 49 $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/tags/ncm-components \ 49 50 quattor/tags/ncm-components 50 51 }}} 51 52 then, f.i.: 52 53 {{{ 53 54 $ cd quattor/tags/ncm-components/core/ncm-pakiti/1.0.0/ 54 55 $ make ... 56 }}} 55 57 56 58 = Available targets = 57 From now we assume each ''target'' is called via <tt>make</tt>. For example, to invoke the help command inside a given product directory, f.i. <tt>ncm-components/core/ncm-grub/</tt>:58 59 From now we assume each ''target'' is called via `make`. For example, to invoke the help command inside a given product directory, f.i. `ncm-components/core/ncm-grub/`: 60 {{{ 59 61 $ make help 60 62 usage: make target [target...] … … 80 82 tagstable -- tag in SVN the HEAD revision with 'STABLE' 81 83 test -- run the tests, if any, coming with the module 84 }}} 82 85 86 The build also include other targets for use by developers of the quattor build tools. For details, consult the file `quattor-build-tools/quattor-buildtools.mk`. 83 87 84 The build also include other targets for use by developers of the quattor build tools. For details, consult the file <tt>quattor-build-tools/quattor-buildtools.mk</tt>. 85 86 Since "tags" are meant as read-only directories, many of the above tags will fail when called inside the <tt>tags/</tt> tree. 88 Since "tags" are meant as read-only directories, many of the above tags will fail when called inside the `tags/` tree. 87 89 88 90 89 91 = Versioning = 90 92 Module versions are made up of a 3-digit ''version'' number and a 1-digit ''release'' number: 91 93 {{{ 92 94 x.y.z-n 93 95 }}} 94 96 The two strings are placed in the special file <tt>config.mk</tt> (mandatory for any Quattor module): 95 97 {{{ 96 98 VERSION=x.y.z 97 99 RELEASE=n 98 99 The VERSION string <tt>x.y.z</tt> is ''automatically'' modified by the build tools, whereas the RELEAE string <tt>n</tt>must be modified ''manually'' in special situations, such as when back porting fixes to an old version.100 }}} 101 The VERSION string `x.y.z` is ''automatically'' modified by the build tools, whereas the RELEAE string `n` must be modified ''manually'' in special situations, such as when back porting fixes to an old version. 100 102 101 103 = Checking in releases = 102 After the initial check-in to add a module to the repository, subsequent releases are handled via the following <tt>make</tt>targets:104 After the initial check-in to add a module to the repository, subsequent releases are handled via the following '''make''' targets: 103 105 104 {| border="1" 105 ! Target !! Result !! Scope 106 |- 107 | <tt>release</tt> || commit and tag a release <tt>x.y.Z+1</tt> || a very minor change, such as bug fixes and new options 108 |- 109 | <tt>minorversion</tt> || commit and tag a minor version <tt>x.Y+1.0</tt> || minor changes, such as schema add-ons, support for new functionalities and status change from '''test''' to '''stable''' 110 |- 111 | <tt>majorversion</tt> || commit and tag a milestone <tt>X+1.0.0</tt> || major changes, such as whole rewrite or refactoring 112 |} 106 || '''Target''' || '''Result''' || '''Scope''' 107 || `release` || commit and tag a release `x.y.Z+1` || a very minor change, such as bug fixes and new options 108 || `minorversion` || commit and tag a minor version `x.Y+1.0` || minor changes, such as schema add-ons, support for new functionalities and status change from '''test''' to '''stable''' 109 || `majorversion` || commit and tag a milestone `X+1.0.0` || major changes, such as whole rewrite or refactoring 113 110 114 '''Please, avoid direct usage of <tt>svn commit</tt>, since this bypasses the checks meant for improving code quality!'''111 '''Please, avoid direct usage of `svn commit`, since this bypasses the checks meant for improving code quality!''' 115 112 116 113 The svn commands involved in these operations are silent, but if you like to see what's actually going on, just define the shell variable SVN_VERB, f.i. 114 {{{ 115 $ make SVN_VERB=1 release 116 }}} 117 117 118 $ make SVN_VERB=1 release 119 120 The above targets create some subdirectories in your local working directory. If you followed the tips [[#Workspace setup|above]], you should see the result of your check-in in <tt>/your/quattor/working/dir/tags/</tt>. 118 The above targets create some subdirectories in your local working directory. If you followed the tips [[#Workspace setup|above]], you should see the result of your check-in in `/your/quattor/working/dir/tags/`. 121 119 122 120 =Tagging a release as stable= … … 127 125 A ''stable'' release is unique for each module. When checking in a release via one of the above targets, you will be asked whether you would like to tag it as 'stable'. If the release has received sufficient testing, answer 'yes'. 128 126 If you answer 'no', you can tag the trunk revision of the component at a later stage as follows: 129 127 {{{ 130 128 $ make tagstable 131 129 }}} 132 130 This will cause a <tt>stable</tt> tag to be created with the contents of the current revision. 133 131 134 132 = Checking code = 135 133 In order to improve the quality of our code base, the build framework runs some automatic checks when 136 performing checkins. You can run these checks manually using the <tt>check</tt>target. Further details of the checks performed may be found [[Build_Framework_Checks|here]].134 performing checkins. You can run these checks manually using the `check` target. Further details of the checks performed may be found [[Build_Framework_Checks|here]]. 137 135 138 136 = Deprecating a module = 139 137 When a module or NCM component is deprecated for any reason, it should be marked as 'obsolete'. 140 The convention for obsolete modules is to have an <tt>OBSOLETE</tt> tag in <tt>config.mk</tt>with three possible values:141 * <tt>1</tt>: default value, no special reason given;142 * <tt><mod-name></tt>: where <tt>mod-name</tt>is the component/module to use instead of the deprecated one;143 * <tt><another-particular-reason></tt>: where an appropriate explanation is given.138 The convention for obsolete modules is to have an `OBSOLETE` tag in `config.mk` with three possible values: 139 * `1`: default value, no special reason given; 140 * `<mod-name>`: where `mod-name` is the component/module to use instead of the deprecated one; 141 * `<another-particular-reason>`: where an appropriate explanation is given. 144 142 145 You don't need to edit <tt>config.mk</tt> by hand, just call: 143 You don't need to edit `config.mk` by hand, just call: 144 {{{ 145 $ make OBSOLETE_MSG=<your reason or module name> markobsolete 146 }}} 147 which will modify `config.mk` and commit it (no special tag is added). 146 148 147 $ make OBSOLETE_MSG=<your reason or module name> markobsolete 148 149 which will modify <tt>config.mk</tt> and commit it (no special tag is added). 150 151 Once a module is marked as obsolete, unless you define the shell variable <tt>CHKOBS_OK</tt>, <tt>make check</tt> fails. Other targets depending on <tt>check</tt>, such as <tt>rpm</tt>, will also fail. 149 Once a module is marked as obsolete, unless you define the shell variable `CHKOBS_OK`, '''make check''' fails. Other targets depending on `check`, such as `rpm`, will also fail. 152 150 153 151 = Running unit tests = 154 If your module comes with unit tests, you can call them via <tt>make test</tt>, provided that a test ''harness'' is found in your checkout. Further details may be found on [[https://twiki.cern.ch/twiki/bin/view/FIOgroup/SWDevUnitTestPerl CERN's Perl unit test page]].152 If your module comes with unit tests, you can call them via '''make test''', provided that a test ''harness'' is found in your checkout. Further details may be found on [https://twiki.cern.ch/twiki/bin/view/FIOgroup/SWDevUnitTestPerl CERN's Perl unit test page]. 155 153 156 154 = Updating a core module's pointer to the build tools = 157 Normally, each core module has a pointer to a specific version of the build tools, set as an <tt>svn:externals</tt> property. You can query it by running <tt>svn pg svn:externals</tt>, f.i. for the <tt>aii</tt>core module:158 155 Normally, each core module has a pointer to a specific version of the build tools, set as an `svn:externals` property. You can query it by running '''svn pg svn:externals''', f.i. for the `aii` core module: 156 {{{ 159 157 $ cd <your-svn-co>/trunk/aii 160 158 $ svn pg svn:externals 161 159 quattor-build-tools -r15 https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools 162 160 }}} 163 161 164 162 At any time, the developer of a given module can update its pointer to the ''head'' revision, by running 165 163 {{{ 166 164 $ make buildtools 167 165 }}} 168 166 Should the above command fail, you can proceed as follows. 169 167 * Get the head revision number of the build tools 170 168 {{{ 171 169 $ svn info https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools | egrep Revision 172 170 Revision: 211 173 171 }}} 174 172 * Update the "svn:externals" property on the local module checkout, commit and update: 175 173 {{{ 176 174 $ svn ps svn:externals "quattor-build-tools -r211 \ 177 175 https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools" ./ 178 176 $ svn ci -m "Updated pointer to the qbt" 179 177 $ svn up 180 178 }}} 181 179 '''<u>Note</u>: NCM components use always the head revision of the build tools''', thus the above procedure does not apply to them. 182 180 183 181 == Updating all pointers to the build tools == 184 182 From the top-level trunk directory it is possible to update all the pointers to the latest build tools in just one go: 185 183 {{{ 186 184 $ cd <your-svn-co>/trunk/ 187 185 $ svn update 188 186 $ make refreshbt 187 }}} 188 '''<u>Note</u>.''' Only the modules/component listed in the "release" file `<your-svn-co>/trunk/release-list` will be affected. Please, keep the list up-to-date. 189 189 190 '''<u>Note</u>.''' Only the modules/component listed in the "release" file <tt><your-svn-co>/trunk/release-list</tt> will be affected. Please, keep the list up-to-date.191