[Scons-users] Possible bug with cache and Value()

Rob Spanton rob at robspanton.com
Wed Nov 22 06:36:44 EST 2017


Hi,

I recently upgraded to scons 3.0.1, and I'm encountering a problem with using
CacheDir() in combination with Value().  I can replicate the issue with this
minimal SConstruct:

    CacheDir("cache")
    Command("somefile", Value("test"), "echo hi > $TARGET")

    I've included the traceback that this produces at the end of this email.  I
    think what I'm doing with CacheDir, Command and Value is legitimate but am
    entirely happy to be persuaded that it is not!

    I can work with this for the moment by disabling the cache, but it would be
    useful if someone with some more in-depth scons knowledge than me could shed
    some light on what's going on.

    Thanks,

    Rob Spanton

    ---

    scons: Reading SConscript files ...
    scons: done reading SConscript files.
    scons: Building targets ...
    scons: *** [somefile] TypeError : sequence item 0: expected str instance, bytes found
    Traceback (most recent call last):
      File "/usr/lib/scons/SCons/Action.py", line 689, in __call__
        cmd = self.strfunction(target, source, env, executor)
    TypeError: CacheRetrieveString() takes 3 positional arguments but 4 were given

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/scons/SCons/Taskmaster.py", line 241, in execute
        if not t.retrieve_from_cache():
      File "/usr/lib/scons/SCons/Node/FS.py", line 2925, in retrieve_from_cache
        return self.get_build_env().get_CacheDir().retrieve(self)
      File "/usr/lib/scons/SCons/CacheDir.py", line 263, in retrieve
        if CacheRetrieve(node, [], env, execute=1) == 0:
      File "/usr/lib/scons/SCons/Action.py", line 691, in __call__
        cmd = self.strfunction(target, source, env)
      File "/usr/lib/scons/SCons/CacheDir.py", line 66, in CacheRetrieveString
        cachedir, cachefile = cd.cachepath(t)
      File "/usr/lib/scons/SCons/CacheDir.py", line 224, in cachepath
        sig = node.get_cachedir_bsig()
      File "/usr/lib/scons/SCons/Node/FS.py", line 3391, in get_cachedir_bsig
        result = self.cachesig = SCons.Util.MD5collect(sigs)
      File "/usr/lib/scons/SCons/Util.py", line 1550, in MD5collect
        return MD5signature(', '.join(signatures))
    TypeError: sequence item 0: expected str instance, bytes found
    scons: building terminated because of errors.


More information about the Scons-users mailing list