From fb48afbb637e35becf463e26399f9ad90cc74e7d Mon Sep 17 00:00:00 2001 From: Kevin Koch Date: Tue, 27 Mar 2007 18:42:51 +0000 Subject: [PATCH] Update documentation Target_Version: 1.6.1 Ticket: 5490 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19294 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/build/bkw-automation.html | 486 +++++++++++++++----------- 1 file changed, 277 insertions(+), 209 deletions(-) diff --git a/src/windows/build/bkw-automation.html b/src/windows/build/bkw-automation.html index f018b348b..eb41053c5 100644 --- a/src/windows/build/bkw-automation.html +++ b/src/windows/build/bkw-automation.html @@ -10,218 +10,286 @@ -
- - +
+
The + Kerberos For Windows build is being automated. This description consists of +
+ +

Build steps

+

Building the complete KfW product consists of these steps:

+
    +
  • + Setting up the environment +
  • + Fetching sources from repositories +
  • + Building the sources with nmake +
  • + Setting up the packaging environment +
  • + Building the two installers -- a msi installer and an exe installer +
  • + Building other distribution components +
      +
    • + KfW source distribution +
    • + KfW core binaries +
    • + KfW SDK +
    • + Microsoft redistributable components +
    • + Individual files: release notes, Leash user guide, MSI Deployment Guide. +
    • +
    +
  • +
+

Script structure

+

The build is a perl script controlled by command line switches and an XML + configuration file. The config file is required. Settings in the config file + can be overridden by optional command line switches.

+

The main steps in the script are

+
    +
  • + Setting up the environment +
  • + Fetching the sources from repositories +
  • + Building the sources +
  • + Setting up the packaging environment +
  • + Building the msi with the package nmake +
  • + Building the rest of the components +
  • +
+

The usage message shows the available switches:

+

C:\Projects\KfW>perl bkw.pl /?
+ Usage: bkw.pl (-f --config) config-file [options] NMAKE-options

+

Options are case insensitive.

+

Options:
+ /help /? usage information (what you now see)
+ /srcdir dir   Source directory to use. Should contain
+               + pismere/athena. If cvstag or svntag is null,
+               + the directory should be prepopulated.
+ /cvstag tag   \ For whichever of these tags is specified,
+ /svntag url   / a checkout will be done into srcdir
+ /debug        Do debug make instead of + release make
+ /outdir dir   Directory to be created where build results will go
+ /nomake       Skip make step
+ /nopackage    Skip packaging step
+ /clean        Build clean target
+ /verbose      Debug mode - verbose output
+ /vverbose     very verbose output
+ /config path  Path to config file
+ /logfile path Where to write output. If omitted, ...
+ /srcdir dir   Source directory to use. Should contain +
+              
pismere/athena. + If cvstag or svntag is null, +
+               + the directory should be prepopulated. +
+
/outdir dir   Directory to be created where build results will + go +
+ /repository checkout | co \ What repository action to take. +
+            
update   + | up | Options are to checkout, update or
+             skip          + / take no action [skip]. +
+ /cvstag tag   \ For whichever of these tags is specified, +
+
/svntag url   / the repository action will be done into srcdir +
+ /debug        Do debug make instead of + release make +
+ /nomake       Skip make step +
+ /nopackage    Skip packaging step +
+ /clean        Build clean target +
+ /verbose      Debug mode - verbose output +
+ /config path  Path to config file +
+ /logfile path Where to write output. If omitted, ...
+
Other:
+ NMAKE-options any options you want to pass to NMAKE, which can be:
+ (note: /nologo is always used)
+ [ nmake options follow ]

+

Additional controls, not available from the command line:

+

<CVSROOT name=":kserver:cvs.mit.edu:/cvs/pismere" />
+ <SVNURL name="" />
+ <CopyList><Config><DebugArea value="dbg" />
+                   + <ReleaseArea value="rel" />
+                   <AlwaysTag + value="%bldtype%" />
+                   + <DebugTag value="%debug%" />
+                   + <ReleaseTag value="%release%" />
+                   + <Files><Include path="copyfiles.xml" />

+

The pre-package steps gathers up build results and puts them in + a target area.  "target" is hardwired in the + build script.

+

The post-package step zips up various files and then copies the + zips and other files tosrcdir/public.  + "public" is hardwired in the build script.

+

Config file

+

+ CopyLists

+

+ CopyLists are used in many places.  There is an optional + Configuration section and a required Files section. 

+

The configuration section defines the roots of the from and to paths and can + optionally define path substitutions.  +

+

Internally, the to and from paths are required.  They are forced by the + script rather than being set in the config file.  Comments in the copyfile + xml indicate this.

+

The overall build configuration specifies a debug or release build.  The + debug and release results are put in different places.  File entries can + indicate a variable part of a path with a tag such as %bldtype%.  The + script will substitute %bldtype% with either dbg or rel, depending on the build + type.  The substitution tags are specified with these declarations:

+

+

- + + + + + + + + + + + + + + + + + + + + + + +
- - - - - -
-
-
The Kerberos - For Windows build is being automated. This description consists of -
-
-
-
-
    -
  • - Build steps -
  • - Script structure -
  • - Script step details -
  • - Remaining work / bug list -
  • -
-

Build steps

-

Building the complete KfW product consists of these steps:

-
    -
  • - Setting up the environment [Done except for subversion, logging] -
  • - Fetching sources from repositories [cvs done; subversion being worked on] -
  • - Building the sources with nmake [Done] -
  • - Setting up the packaging environment [Done] -
  • - Building KfW.msi with the packaging nmake [Done] -
  • - Building other distribution components [Not done] -
      -
    • - .exe installer -
    • - KfW source distribution -
    • - KfW core binaries -
    • - KfW SDK -
    • - Microsoft redistributable components -
    • - Individual files: release notes, Leash user guide, MSI Deployment Guide. -
    • -
    -
  • -
-

Script structure

-

The build is a perl script controlled by command line switches and an XML - configuration file. The config file is required. Settings in the config file - can be overridden by optional command line switches.

-

The main steps in the script are

-
    -
  • - Setting up the environment -
  • - Fetching the sources from repositories -
  • - Building the sources -
  • - Setting up the packaging environment -
  • - Building the msi with the package nmake -
  • - Building the rest of the components [tbd] -
  • -
-

The usage message shows the available switches:

-

C:\Projects\KfW>perl bkw.pl /?
- Usage: bkw.pl (-f --config) config-file [options] NMAKE-options

-

Options are case insensitive.

-

Options:
- /help /? usage information (what you now see)
- /srcdir dir   Source directory to use. Should contain
-               - pismere/athena. If cvstag or svntag is null,
-               - the directory should be prepopulated.
- /cvs?ag tag   \ For whichever of these tags is specified,
- /svntag url   / a checkout will be done into srcdir
- /debug        Do debug make instead of - release make
- /outdir dir   Directory to be created where build results will go
- /nomake       Skip make step
- /nopackage    Skip packaging step
- /clean        Build clean target
- /verbose      Debug mode - verbose output
- /vverbose     very verbose output
- /config path  Path to config file
- /logfile path Where to write output. If omitted, ...
- /srcdir dir   Source directory to use. Should contain -
-              
pismere/athena. - If cvstag or svntag is null, -
-               - the directory should be prepopulated. -
-
/outdir dir   Directory to be created where build results will - go -
- /repository checkout | co \ What repository action to take. -
-            
update   - | up | Options are to checkout, update or
-             skip          - / take no action [skip]. -
- /cvstag tag   \ For whichever of these tags is specified, -
-
/svntag url   / the repository action will be done into srcdir -
- /debug Do debug make instead of release make -
- /nomake Skip make step -
- /nopackage Skip packaging step -
- /clean Build clean target -
- /verbose Debug mode - verbose output -
- /config path Path to config file -
- /logfile path Where to write output. If omitted, ...
-
Other:
- NMAKE-options any options you want to pass to NMAKE, which can be:
- (note: /nologo is always used)
- [ nmake options follow ]

-

Additional controls, not available from the command line:

-

<CVSROOT name=":kserver:cvs.mit.edu:/cvs/pismere" />
- <SVNURL name="" />
- <CopyList><Config><DebugArea value="dbg" />
-                   - <ReleaseArea value="rel" />
-                   <AlwaysTag - value="%bldtype%" />
-                   - <DebugTag value="%debug%" />
-                   - <ReleaseTag value="%release%" />
-                   - <Files><Include path="copyfiles.xml" />

-

The CopyList

-

The CopyList is used during the Setting Up The Packaging Environment - step. Build results and files from all over the source tree are copied into a - 'staging' area in a structure the packaging script expects. The staging area is - <src>/pismere/staging.

-

The original copy list on which this is based had duplicate entries for debug - and release build results. This version only names each file once, which could - reduce maintenance.

-

A copylist entry looks like this:

-
<File name="comerr32.dll" from="..\target\bin\i386\%bldtype%\" to="\bin\i386" />
-
-
-

From paths are relative to <src>\pismere\athena and To paths are - relative to <src>\pismere\staging.

-

Debug and release build results go into directories containing either 'dbg' or - 'rel.' DebugArea and ReleaseArea describe these strings. If - an entry in the copy list contains the AlwaysTag string ('%bldtype%'), - the debug or release file will be copied, depending on the build type. If the - copy list entry contains DebugTag ('%debug%'), the file will only be - copied if packaging a debug build. Ditto for ReleaseTag.

-

If we are doing a debug build, the above copylist entry will copy <src>\pismere\athena\..\target\bin\i386\dbg\comerr32.dll - to <src>\pismere\staging\bin\i386\comerr32.dll.

-

There are two other possible attributes in a copylist entry:

-
    -
  • - notrequired -
  • - newname="filename" -
  • -
-

Most copylist entries are required and the script will die if they aren't - present. To ignore missing files, add notrequired.

-

To rename the file, set the newname attribute.

-

Remaining work / bug list

-

This is a work in progress. What's left:

-
    -
  • - Produce the remainder of the distribution components. [Listed - above.] -
  • -
-

Bugs:

-
    -
  • - Propogate leash removal through wix scripts. -
  • - Eliminate need for redundant /debug debug. -
  • -
-
-
-
+
DebugAreaPath value used in debug build.  Must match what the build + script uses.  Typically "dbg."
ReleaseAreaPath value used in release build.  Must match the build + script.  Typically "rel."
AlwaysTagString in file entries which will always be changed to either + DebugArea or ReleaseArea. File is always copied.  Typically "%bldtype%."
DebugTagString in file entries which will only be changed to DebugArea during a debug + build.  File is only copied in a debug build.  Typically "%debug%."
ReleaseTagString in file entries which will only be changed to ReleaseArea during a + release build.  File is only copied in a release build.  Typically + "%release%."
FileStem%filestem% will always be changed to FileStem.  Example:  + "kfw-3-2-0."  This is used in when building or copying the final build + results.
+

+

Example

+

Each segment of the file's path that comes from a different place is in a + different color.

+

+ Release build.  Config file: +

+

+ + + + + + + + + + + + + + + + + + -
<BKW_Config>
<CommandLine>
<Directories>
<src path ="C:\projects\Autobuild" + />
+ +

+

Copylist comments:

+

+ <!-- File from paths are relative to + \pismere\athena --> +
+ <!-- File to paths are relative to \pismere\staging + --> +

+

When the script processes this copylist, it will force the from and to paths as + indicated.

+

This line +

+

<File name="comerr32.dll" from="..\target\bin\i386\%bldtype%\" + to="\bin\i386" />

+

will result in C:\projects\Autobuild\pismere\athena\..\target\bin\i386\rel\comerr32.dll

+

being copied to C:\projects\Autobuild\pismere\staging\bin\i386\comerr32.dll.

+ +

+ Other possible attributes in a copylist entry:

+
    +
  • + notrequired +
  • + newname="filename" +
  • +
+

By default, copylist entries are required and the script will die if they aren't + present. To ignore missing files, add notrequired.

+

To rename the file, set the newname attribute.

+

Lengthy copy lists can be kept in separate files and included with the Include + directive.  Example:

+

<Include path="sdkfiles.xml" />

+

Remaining work / bug list

+

This is a work in progress. What's left:

+

Bugs:

+
    +
  • + Eliminate need for redundant /debug debug. +
  • + Handle checkout into non-existant directory. +
  • +
+

Troubleshooting +

+

svn can't create tunnel:
+
Make sure environment variable SVN_SSH points to a valid + plink.exe.  Path separators must be backslashes and must be doubled.

+
-- 2.26.2