title: Scons Cyclic Dependency
body: <p>We updated from scons 2.4.1 to 2.5.1 and suddenly get several errors like so:
  scons: *** Found dependency cycle(s):
    Internal Error: no cycle found for node ...</p>
  
  <p>The issue I believe pertains to a version file that we attempt to automatically update if our SCM detects an edit to source files. The gist of the process is that we maintain a file 'version.cfg' that has #defines. This file is checked into our SCM. If the file has already been updated once, it will not be updated a second time until the file is commited to the SCM. This file is then used to autogenerate a C++ header file named 'kb_version.hh'.</p>
  
  <p>What is the cyclic dependency and how can I eliminate it? (note, whatever the issue is, did not cause problems in scons 2.4.1 (only if we use the new version 2.5.1 does it detect the cyclic dependency).</p>
  
  <p>The relevant scons snippet is below:</p>
  
  <pre><code> SRCDIR = '../../src'
  
   SRCS = [
     'kb.cc',
   ]
  
   SOURCE = [ os.path.join(SRCDIR, s) for s in SRCS ]
  
   SCRIPT_VERSION_GEN = os.path.join(env['_ROOT'], 'kb/build/scripts/versionGen.sh')
   SCRIPT_VERSION_UPD = os.path.join(env['_ROOT'], 'kb/build/scripts/versionUpdate.sh')
  
   FILE_VERSION_CFG = 'version.cfg'
   FILE_VERSION_HH  = 'kb_version.hh'
  
   scriptVerGen = env.File(SCRIPT_VERSION_GEN)
   scriptVerUpd = env.File(SCRIPT_VERSION_UPD)
   verCfg = env.File(os.path.join(SRCDIR, FILE_VERSION_CFG))
   verHH  = env.File(os.path.join(SRCDIR, FILE_VERSION_HH))
  
   ## this command detects for change in source files, then updates, when necessary, the source version.cfg
   env.Command(
     target = verCfg,
     source = [ SOURCE, scriptVerUpd ],
     action = [ scriptVerUpd.path + ' ' + env['BS_DIR_SRCROOT'] + '/kb/foo' + verCfg.srcnode().path, Copy(verCfg.path, verCfg.srcnode().path) ]
   )
  
   env.Command(
     target = verHH,
     source = [ verCfg, scriptVerGen ],
     action = scriptVerGen.path + ' ' + verHH.path + ' ' + verCfg.path
   )
  </code></pre>