build.py error

212 views
Skip to first unread message

Marcus F

unread,
Oct 24, 2014, 10:03:45 AM10/24/14
to blo...@googlegroups.com
I'm trying to apply the patch to import/export json, I've used SmartSVN and applied the patch file, now I'm trying to use build.py, but I'm getting this error:

C:\svn\blockly>build.py
  File "C:\svn\blockly\build.py", line 256
    print 'SERVER ERROR: %s' % target_filename
                           ^
SyntaxError: Missing parentheses in call to 'print'


Anyone run into this before?

Marcus F

unread,
Oct 24, 2014, 10:18:48 AM10/24/14
to blo...@googlegroups.com
Ok, turns out that build.py requites python 2.x and I had 3.something installed.

Next issue is Closure, installing that then we'll see if it works.

Marcus F

unread,
Oct 24, 2014, 10:24:29 AM10/24/14
to blo...@googlegroups.com
Ok, so now it sort of compiles.

I do get some errors:

WARNING: definition of CONTROLS_IF_TOOLTIP_4 in msg\json\lt.json contained a newline character.
WARNING: definition of CONTROLS_IF_TOOLTIP_2 in msg\json\lt.json contained a newline character.
WARNING: definition of CONTROLS_IF_TOOLTIP_3 in msg\json\lt.json contained a newline character.

SUCCESS: blockly_uncompressed.js
WARNING
unreachable code
??? at line 566:
    return null;
    ^
()

(I do get a bunch of successes, but these are the errors popping up)

Marcus F

unread,
Oct 24, 2014, 10:36:55 AM10/24/14
to blo...@googlegroups.com
Someone might want to update this page: https://developers.google.com/blockly/hacking/building

And include the Python version needed.

Neil Fraser

unread,
Nov 6, 2014, 8:28:44 PM11/6/14
to blo...@googlegroups.com
Yikes, I was not aware that build.py was so narrowly defined.  Python 2.6 fails, 2.7 works, 3.x fails.  I've made some simple fixes to build.py but the 2.7 requirement stands.  Python is not my language of choice, so I'd probably just make things even less robust if I attempted to force Python 2.7/3.x compatibility.  If anyone wants to take a stab at this, be my guest.

I've submitted an update to the developer's page specifying Python 2.7.  Should land tomorrow.  Thanks.

Regarding the warnings in msg\json\lt.json, that file does not exist in the current repo.  I don't see a Lithuanian language pack in our recent history.  Just delete the offending file.  And consider resynching.

Regarding the "unreachable code", this warning came then disappeared on its own.  I searched the codebase and found no matches.  Not sure if it was in Closure Library or in the Closure Compiler.  Either way, it's gone now.

On 24 October 2014 07:36, Marcus F <tren...@gmail.com> wrote:
Someone might want to update this page: https://developers.google.com/blockly/hacking/building

And include the Python version needed.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Chris Rowat

unread,
Nov 7, 2014, 9:23:02 AM11/7/14
to blo...@googlegroups.com, ro...@neil.fraser.name
You are experiencing errors when building with python 2.6?  I have been building blockly using python 2.6 for a week or so now without any troubles.  When I build with 2.7 I get the following error:

c:\blockly>c:\Python27\python.exe build.py
Traceback (most recent call last):
  File "build.py", line 38, in <module>
    import errno, glob, httplib, json, os, re, subprocess, sys, threading, urllib
  File "c:\Python27\lib\httplib.py", line 71, in <module>
    import socket
  File "c:\Python27\lib\socket.py", line 47, in <module>
    import _socket
ImportError: Module use of python26.dll conflicts with this version of Python.

Admittedly I don't know anything at all about python and the error could be with my configuration but this made me think that the build script was only compatible with 2.6 and so I switched over to that and I can build blockly on my machine without any issues using 2.6.
Reply all
Reply to author
Forward
0 new messages