[Scons-users] A bug in an error message?

Matthew Marinets Matthew.Marinets at Kardium.com
Wed Jun 20 17:45:33 EDT 2018


This one is a string.

The substitution looks like an issue with the targets, and now that I really squint at my code I realize that the list of targets I pass in might have nested lists inside of it (i.e. [1, 2, [3, 4], 5]). But I thought flattening the target list was handled by the environment’s builder wrapper?

-Matthew

From: Scons-users <scons-users-bounces at scons.org> On Behalf Of Bill Deegan
Sent: June 20, 2018 14:40
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] A bug in an error message?

Are your actions python function actions?

On Wed, Jun 20, 2018 at 4:13 PM, Matthew Marinets <Matthew.Marinets at kardium.com<mailto:Matthew.Marinets at kardium.com>> wrote:
I’m running SCons 3.0.0 with Python 2.6.5, on Windows 10.

I haven’t looked into SCons 3.0.1 yet, though I suppose the upgrade shouldn’t be too difficult.

-Matthew

From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> On Behalf Of Bill Deegan
Sent: June 20, 2018 12:19
To: SCons users mailing list <scons-users at scons.org<mailto:scons-users at scons.org>>
Subject: Re: [Scons-users] A bug in an error message?

Which version of Python?
Have you tried SCons 3.0.1?

On Wed, Jun 20, 2018 at 2:58 PM, Matthew Marinets <Matthew.Marinets at kardium.com<mailto:Matthew.Marinets at kardium.com>> wrote:
So in my build we have many many custom builders associated with code generation. Normally when things go wrong the error messages are difficult to understand, but this one stumped me for quite a while until I noticed something:

Error message:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 62: invalid start byte:
   File "C:\proj\Branches\Sandbox\multiStim\Canopus\SConstruct", line 332:
                 standardBuild('FirmwareCommon', firmwareRoot + '/Common', env.subst('$versionNumber_Firmware'))
   File "C:\proj\Branches\Sandbox\multiStim\Canopus\SConstruct", line 314:
                 SConscript(componentRoot + '/' + scriptName, exports = ['env', 'mbenv', 'versionNumber'])
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Script\SConscript.py", line 607:
                 return method(*args, **kw)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Script\SConscript.py", line 544:
                 return _SConscript(self.fs, *files, **subst_kw)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Script\SConscript.py", line 253:
                  call_stack[-1].globals)
   File "C:\proj\Branches\Sandbox\multiStim\Canopus\Electrical\FPGA\Firmware\Common\SConscript", line 236:
                CMDFLAGS = '/min'))
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Environment.py", line 224:
                 return self.method(*nargs, **kwargs)
   File "C:\proj\Branches\Sandbox\multiStim\Tools\Python\KSCons\GenerationTools\PacketGen.py", line 131:
                  action = packetGenAction,)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Environment.py", line 1965:
                 return bld(self, target, source, **kw)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Builder.py", line 635:
                 return self._execute(env, target, source, OverrideWarner(kw), ekw)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Builder.py", line 557:
                 _node_errors(self, env, tlist, slist)
   File "C:\Program Files\Python36\scons-3.0.0\SCons\Builder.py", line 303:
                 msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))

What this error message is trying to say is that there are two commands to generate the same target. However, the error message displayed at the top is “UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 62: invalid start byte:” This is because the intended error message isn’t formatted properly, and just ends up throwing its own error to mask the original.

Has anyone else run into this problem? Am I doing something wrong or is this a bug?

Thanks,
-Matthew

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180620/e43f196a/attachment-0001.html>


More information about the Scons-users mailing list