[Scons-users] Reading Python 3.8.0 .dblite file from Python 2.7

Don Baldwin donb at qti.qualcomm.com
Tue Dec 3 19:35:39 EST 2019


Hi,

We're trying to migrate our builds from SCons 2.0.0.final.0 to SCons 3.1.1, and from Python 2.7 to 3.8.0.  However, we still need to maintain some kind of compatibility between these versions because:


  1.  We still need to support older builds using older versions of Python and SCons 2.0.0.final.0.
  2.  We have several tools outside of the build that use the sconsign tool to read the .dblite files, and these are still running with Python 2.x.

We see the following error when trying to read the .dblite file from builds built with Python 3.8.0 from a tool that's running under Python 2.7:

ignoring invalid `dblite' file

>From what I've read, this seems to be due to the incompatibility between the pickle library between Python 2 and 3.

I see the following code in lib/SCons/compat/__init__.py:

# Was pickle.HIGHEST_PROTOCOL
# Changed to 2 so py3.5+'s pickle will be compatible with py2.7.
PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL

When I modify this to set PICKLE_PROTOCOL = 2, my tools are able to successfully read the .dblite files, but I'd prefer not to have to modify the native SCons code.

Is there a way to set this value from my SConscript file, or some other preferred way to handle this situation?

Thanks,
Don Baldwin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20191204/c682bd3d/attachment.html>


More information about the Scons-users mailing list