9 The Prerequisites System

Each package may or may not have a build dependency on other packages managed by BUILD SCRIPTS. For example a particular version of sim-recon can be built against any of a number of versions of HDDS, including custom versions provided by the user. To insure that the environment being set-up has a consistent set of package versions, a facility is provided to warn the user if possible inconsistencies are detected.

At build time, a version xml file is created in the home directory of a package if that package has dependencies on others in the system. For example, $HALLD_HOME will have the file sim-recon_prereqs_version.xml, listing the versions used to build sim-recon. An example is shown in Fig. [*]

Figure: An example of sim-recon_prereqs_version.xml.
\begin{figure}\begin{verbatim}<gversion version=''1.0''
><package name=''evi...
...ckage name=''ccdb'' version=''1.05''
/></gversion
>\end{verbatim}
\end{figure}

At set-up time, when gluex_env.(c)sh is invoked, if a version file with prerequisites is found in the package home directory, then each package in that file is checked for version consistency. A match is sought between the version number specified in the version set file and the version number encoded in the home directory for the prerequisite package, i. e., the directory defined as home in the environment being set-up. Here the version from the home directory is extracted in two ways depending on how the package was built:

  1. Tar File. If the source code came from a tar file, then the version number is parsed out of the name of the home directory.

  2. Subversion Check-Out. If the source was checked out of a subversion repository, the svn info command is used to get the name of the subversion directory checked out and the version is parsed from that directory name.

  3. Git Clone and Check-Out. If the source code was checked-out from a Git repository, the git remote -v command is issued and the URL is parsed from the “fetch” line. The branch is obtained from the git status command. If the prerequisite file does not contain a branch specification, then the version check will require the master branch to have been checked out. At this writing, version checking for specific commit hashes has not been implemented.

If a version mismatch is found, a warning is written to the screen. To stop the version check from being performed, set the environment variable
BUILD_SCRIPTS_CONSISTENCY_CHECK
to the value "false".

There are cases where the home directory does not contain any information about the source of its source code. For example, the code could have come via the svn export command or the git archive command. If a such a build (for example HDDS) is a prerequisite of another package (for example, sim-recon), then the dependent package (sim-recon) will usually have listed the prerequisite (HDDS) with neither a version nor a url attribute defined in its (sim-recon's) prerequisite file. In that case, a warning will be issued noting the absence of both version and url attributes.