diff options
author | Steven Knight <knight@baldmt.com> | 2005-08-20 23:10:35 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-08-20 23:10:35 (GMT) |
commit | d0f209df83f9bef3769e7241f10d00e69b5169df (patch) | |
tree | 0f8aba7fb052a1dfc6efa91287951f007a752892 /src/engine/SCons/Node | |
parent | e50a8da8cd0201e3f567e2d87c14b5c2ab2126de (diff) | |
download | SCons-d0f209df83f9bef3769e7241f10d00e69b5169df.zip SCons-d0f209df83f9bef3769e7241f10d00e69b5169df.tar.gz SCons-d0f209df83f9bef3769e7241f10d00e69b5169df.tar.bz2 |
Handle IOError exceptions when pushing files to CacheDir (and elsewhere).
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index c7905b5..6eb61d9 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -156,7 +156,13 @@ def LinkFunc(target, source, env): try: func(src,dest) break - except OSError: + except (IOError, OSError): + # An OSError indicates something happened like a permissions + # problem or an attempt to symlink across file-system + # boundaries. An IOError indicates something like the file + # not existing. In either case, keeping trying additional + # functions in the list and only raise an error if the last + # one failed. if func == Link_Funcs[-1]: # exception of the last link method (copy) are fatal raise @@ -240,10 +246,12 @@ def CachePushFunc(target, source, env): fs.rename(tempfile, cachefile) st = fs.stat(t.path) fs.chmod(cachefile, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) - except OSError: - # It's possible someone else tried writing the file at the same - # time we did. Print a warning but don't stop the build, since - # it doesn't affect the correctness of the build. + except (IOError, OSError): + # It's possible someone else tried writing the file at the + # same time we did, or else that there was some problem like + # the CacheDir being on a separate file system that's full. + # In any case, inability to push a file to cache doesn't affect + # the correctness of the build, so just print a warning. SCons.Warnings.warn(SCons.Warnings.CacheWriteErrorWarning, "Unable to copy %s to cache. Cache file is %s" % (str(target), cachefile)) |