[Scons-users] symlink builder

Mark Diekhans markd at kermodei.com
Wed Mar 1 21:17:26 EST 2017


I have a symlink builder I got off the net:

   symlink.py from  http://stackoverflow.com/questions/3532307/how-to-create-a-symbolic-link-with-scons


Our goal is to have a directory in the variant directory be
symlinks to avoid developers edit the wrong scripting language
source.

This works find on the when the symlink is not present. On
subsequence builds, it generates the below error, indicating
that it has mistakenly identified the symlink as a directory.
This appears to be caused by FS.py using stat rather than lstat
or that the logic in diskcheck_match functions is incorrect.

Is this a problem with scons or is there another way to build
symbolic links.

scons: Reading SConscript files ...
TypeError: Directory /cluster/home/markd/compbio/compartiveGenomics/projs/springClean/src/cgtBuild/build/sonLib/lib/py/cgt/sonLib found where file expected.:
  File "/cluster/home/markd/compbio/compartiveGenomics/projs/springClean/src/cgtBuild/sconstruct", line 40:
    variant_dir="build/sonLib", duplicate=False)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Script/SConscript.py", line 604:
    return method(*args, **kw)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Script/SConscript.py", line 541:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Script/SConscript.py", line 250:
    exec _file_ in call_stack[-1].globals
  File "/cluster/home/markd/compbio/compartiveGenomics/projs/springClean/src/cgtBuild/mods/sonLib/sconscript", line 66:
    env.SymLink("./lib/py/cgt/sonLib", "#/mods/sonLib/py/cgt/sonLib")
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Environment.py", line 260:
    return MethodWrapper.__call__(self, target, source, *args, **kw)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Builder.py", line 626:
    return self._execute(env, target, source, OverrideWarner(kw), ekw)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Builder.py", line 547:
    tlist, slist = self._create_nodes(env, target, source)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Builder.py", line 494:
    tlist = env.arg2nodes(target, target_factory, target=target, source=source)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Environment.py", line 483:
    v = node_factory(self.subst(v, **kw))
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 1404:
    return self._lookup(name, directory, File, create)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 1383:
    return root._lookup_abs(p, fsclass, create)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 2395:
    result.diskcheck_match()
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 2593:
    "Directory %s found where file expected.")
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 398:
    return self.func(*args, **kw)
  File "/cluster/home/markd/opt/centos6.0/x86_64/lib/python2.7/site-packages/scons-2.5.1/SCons/Node/FS.py", line 419:
    raise TypeError(errorfmt % node.get_abspath())



More information about the Scons-users mailing list