Bug fix

The official version of srt_environment does not correctly include project- or experiment-based customizations to itself. It claims to include $SRT_PRIVATE[PUBLIC]_CONTEXT/SRT_$SRT_PROJECT/special/scripts/srt_environment to support such customizations, but the way that the script is structured, the SRT_PRIVATE_CONTEXT and SRT_PUBLIC_CONTEXT variables are not defined until after the special customization files are included. Hence, any customization files are never found when srt_environment is first run.

One way to work around this is to run srt_environment (or srt_setup which calls it) twice. This is how CDF is working around the issue as described in this email snippet from Lynn Garren:

CDF uses ups to initialize SRT.  I find this in the SoftRelTools table file:
execute(srt_setup, UPS_ENV)
# srt_setup will not see specializations the first time it is run.
# Running it a second time ensures specializations are taken into account.
execute(srt_setup, UPS_ENV)

So I guess that the answer is to call srt_setup twice.  Seems to be a feature that we've all been using.

For novadaq use, a modified version of the primary srt_environment script has been checked into SRT_NOVADAQ/scripts. This version allows us to over-ride the add_extra_vars() and remove_extra_vars() functions in the script, and that is enough to support our customizations to srt_environment. Unfortunately, the implemented fix is not general enough to support the customizations that are used at CDF. So, a better fix needs to be implemented before the script can truly be considered fixed.

Part of the pain is the fact that the initial invocation of srt_environment comes from the "boot" base release. So, even though we have a modified copy of srt_environment in SRT_NOVADAQ/scripts, this version is not used until the second, third, etc. times that srt_setup is run. To work around this, we have modified the install_nova script to over-write the official srt_environment script in the boot release with our modified copy when novadaq releases are first installed. If/when a full fix is implemented in the official version of the script in the SoftRelTools package, presumably this hack of the boot release should be removed.

[Some background: the first time that a user sets up a novadaq SRT environment, he first runs 'source /nova/novadaq/srt/' (or something similar) followed by 'srt_setup'. All that the script does is set SRT_DIST, define the srt_setup alias, and add the boot base release "bin" area to the PATH. So, the subsequent invocation of srt_environment via the srt_setup alias is guaranteed to use the boot release version - that is all that is in the user's path.]

If, at some point, we want to back out this change, the following steps should be used:
  • remove the over-write of the boot release version of srt_environment from the install_novadaq script [necessary]
  • remove the modified version of srt_environment from the SRT_NOVADAQ package (in the scripts directory) [recommended]
  • modify the local script that runs srt_setup initially (e.g. so that it runs it twice [necessary]