Changes between Version 1 and Version 2 of Obsolete/Development/Build


Ignore:
Timestamp:
Mar 21, 2010, 10:50:38 AM (16 years ago)
Author:
loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Obsolete/Development/Build

    v1 v2  
    44
    55Any 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/`;
    77* '''core modules''' all the others.
    88
    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!'''
     9Each 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!'''
    1010
    1111= 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>.
     12The 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`.
    1313
    1414= Workspace setup =
    1515First, 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{{{
    1717  $ chfn -f <full-name> -o <email-address> <your-login>
    18 
     18}}}
    1919We recommend to check out repository directories with their original names, f.i.:
    20 
     20{{{
    2121  $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/foo/bar quattor/foo/bar
    22 
     22}}}
    2323The above command makes <tt>$PWD/quattor</tt> your working directory (a.k.a. the quattor checkout root).
    2424If however you prefer to use a different checkout root as a working directory, you should set the following environment variable:
    25 
     25{{{
    2626  $ 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}}}
     28Better 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.
    2929
    3030== Core modules ==
    3131In order to work with core modules, just check out the directory you're interested in, f.i.:
    32 
     32{{{
    3333  $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/trunk/ccm quattor/trunk/ccm
    34 
     34}}}
    3535then
    36 
     36{{{
    3737  $ cd quattor/trunk/ccm
    3838  $ make ...
     39}}}
    3940
    4041== NCM components ==
    4142In order to work with NCM components, you need to check out the '''whole''' components' tree, i.e., for the head revisions:
    42 
     43{{{
    4344  $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/trunk/ncm-components \
    4445  quattor/trunk/ncm-components
    45 
     46}}}
    4647and for the tags:
    47 
     48{{{
    4849  $ svn co https://quattor.svn.sourceforge.net/svnroot/quattor/tags/ncm-components \
    4950  quattor/tags/ncm-components
    50 
     51}}}
    5152then, f.i.:
    52 
     53{{{
    5354  $ cd quattor/tags/ncm-components/core/ncm-pakiti/1.0.0/
    5455  $ make ...
     56}}}
    5557
    5658= 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 
     59From 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{{{
    5961 $ make help
    6062 usage: make target [target...]
     
    8082   tagstable    -- tag in SVN the HEAD revision with 'STABLE'
    8183   test         -- run the tests, if any, coming with the module
     84}}}
    8285
     86The 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`.
    8387
    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.
     88Since "tags" are meant as read-only directories, many of the above tags will fail when called inside the `tags/` tree.
    8789
    8890
    8991= Versioning =
    9092Module versions are made up of a 3-digit ''version'' number and a 1-digit ''release'' number:
    91 
     93{{{
    9294 x.y.z-n
    93 
     95}}}
    9496The two strings are placed in the special file <tt>config.mk</tt> (mandatory for any Quattor module):
    95 
     97{{{
    9698 VERSION=x.y.z
    9799 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}}}
     101The 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.
    100102
    101103= 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:
     104After the initial check-in to add a module to the repository, subsequent releases are handled via the following '''make''' targets:
    103105
    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
    113110
    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!'''
    115112
    116113The 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}}}
    117117
    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>.
     118The 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/`.
    121119
    122120=Tagging a release as stable=
     
    127125A ''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'.
    128126If you answer 'no', you can tag the trunk revision of the component at a later stage as follows:
    129 
     127{{{
    130128  $ make tagstable
    131 
     129}}}
    132130This will cause a <tt>stable</tt> tag to be created with the contents of the current revision.
    133131
    134132= Checking code =
    135133In 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]].
     134performing checkins. You can run these checks manually using the `check` target. Further details of the checks performed may be found [[Build_Framework_Checks|here]].
    137135
    138136= Deprecating a module =
    139137When 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.
     138The 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.
    144142
    145 You don't need to edit <tt>config.mk</tt> by hand, just call:
     143You don't need to edit `config.mk` by hand, just call:
     144{{{
     145  $ make OBSOLETE_MSG=<your reason or module name> markobsolete
     146}}}
     147which will modify `config.mk` and commit it (no special tag is added).
    146148
    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.
     149Once 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.
    152150
    153151= 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]].
     152If 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].
    155153
    156154= 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 
     155Normally, 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{{{
    159157  $ cd <your-svn-co>/trunk/aii
    160158  $ svn pg svn:externals
    161159  quattor-build-tools -r15 https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools
    162 
     160}}}
    163161
    164162At any time, the developer of a given module can update its pointer to the ''head'' revision, by running
    165 
     163{{{
    166164  $ make buildtools
    167 
     165}}}
    168166Should the above command fail, you can proceed as follows.
    169167* Get the head revision number of the build tools
    170 
     168{{{
    171169  $ svn info https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools | egrep Revision
    172170  Revision: 211
    173 
     171}}}
    174172* Update the "svn:externals" property on the local module checkout, commit and update:
    175 
     173{{{
    176174  $ svn ps svn:externals "quattor-build-tools -r211 \
    177175  https://quattor.svn.sourceforge.net/svnroot/quattor/quattor-build-tools" ./
    178176  $ svn ci -m "Updated pointer to the qbt"
    179177  $ svn up
    180 
     178}}}
    181179'''<u>Note</u>: NCM components use always the head revision of the build tools''', thus the above procedure does not apply to them.
    182180
    183181== Updating all pointers to the build tools ==
    184182From the top-level trunk directory it is possible to update all the pointers to the latest build tools in just one go:
    185 
     183{{{
    186184  $ cd <your-svn-co>/trunk/
    187185  $ svn update
    188186  $ 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.
    189189
    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