Skip to content
Commits on Source (2)
  • Fred Wright's avatar
    Eliminates unnecessary symlink recreation. · 03d1ef28
    Fred Wright authored
    This makes two changes to the symlink creation code in tests/wscript:
    
    1) It avoids creating the symlink when it already exists and has the
    correct content.
    
    2) It creates it as a relative symlink rather than an absolute
    symlink, so that it doesn't clash with the duplicate logic in
    "afterparty".
    
    Fixing this is a prerequisite to allowing installs from read-only
    trees, though there is still a problem in that area from waf itself.
    
    TESTED:
    The correct relative symlink is now constructed prior to "afterparty",
    and the tests pass.  Running "install" from a read-only mount no
    longer crashes in the symlink code, though it still dies from waf's
    attempt at some sort of database update.
    03d1ef28
  • Fred Wright's avatar
    Removes gratuitous reruns of pythonize-header. · 99943145
    Fred Wright authored
    The code which unconditionally removed the outputs of pythonize-header
    was completely unnecessary, and not only caused unnecessary rebuilding
    of those files, but also made it impossible to perform an install from
    a read-only tree (after building read-write, of course).
    
    Without this code, the targets are still rebuilt whenever the relevant
    sources changed, and not rebuilt redundantly.
    
    TESTED:
    Verified that the targets are rebuilt when needed, and not rebuilt
    when not needed.
    99943145
......@@ -33,9 +33,18 @@ def build(ctx):
sources = srcnode.ant_glob('*.py')
builds = [x.get_bld() for x in sources]
# Remove generated files to ensure they are properly updated
ctx.exec_command("rm -f %s" % target1.abspath())
ctx.exec_command("rm -f %s" % target2.abspath())
# The rm's here were added to fix a reported (but underdocumented) problem
# where the results of pythonize-header were not updated when needed,
# though there is as yet no explanation for why this had occurred, and the
# alleged failure only occurred when changing the code between 'configure'
# and 'build', which is not a legal action, anyway.
# These rm's were causing unnecessary reruns of pythonize-header,
# including during 'install'. They are now disabled but retained as a
# comment.
## Remove generated files to ensure they are properly updated
#ctx.exec_command("rm -f %s" % target1.abspath())
#ctx.exec_command("rm -f %s" % target2.abspath())
# Make sure Python sees .py as well as .pyc/.pyo
ctx(
......
......@@ -121,13 +121,15 @@ def build(ctx):
testpylib.get_bld().mkdir()
pypath = pylib.get_bld()
linkpath = ctx.bldnode.make_node("tests/pylib/ntp")
if (not linkpath.exists()) or os.readlink(linkpath.abspath()):
targdir = "tests/pylib"
linkpath = ctx.bldnode.make_node(targdir + "/ntp").abspath()
relpath = ("../" * (targdir.count("/")+1)) + pypath.path_from(ctx.bldnode)
if (not os.path.exists(linkpath)) or os.readlink(linkpath) != relpath:
try:
os.remove(linkpath.abspath())
os.remove(linkpath)
except OSError:
pass
os.symlink(pypath.abspath(), linkpath.abspath())
os.symlink(relpath, linkpath)
pytests = ["pylib/test_util.py",
"pylib/test_agentx.py",
......