All the modules should successfully executed.
error during running python file
#python build.py
Traceback (most recent call last):
File "build.py", line 598, in
test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Ubuntu 15.10 & Mozilla Firefox Browser
I'm getting the same error on Windows 10. It happens with Windows 10 console and with the Ubuntu WSDL. The script does work when I run it on Mac OS X though.
Hmm. @regcole are you getting the same error when using WSDL? That stack trace isn't very helpful so any more information would be great.
@thisandagain Yes I am getting the error with WSDL. The error can be tested/reproduced on my machine with effective code of
```
CLOSURE_COMPILER_NPM = "google-closure-compiler"
closure_compiler = CLOSURE_COMPILER_NPM
test_args = [closure_compiler, os.path.join("build", "test_input.js")]
test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
@cwillisf @fsih Could you folks please attempt to repro when you have a moment?
I see this same error if I run python build.py from the command line. However, it works correctly if I let npm run it for me. Specifically, I can use npm install or npm run prepublish to build successfully.
@thisandagain do you think we should update the instructions on the wiki to suggest using npm instead of running python build.py directly? In addition to the issue discussed here, the wiki instructions don't mention running webpack -- which is handled by npm i or npm run prepublish.
@cwillisf Updating the instructions in the wiki sounds like a great idea. @regcole and @rohinipatare can you please confirm that this works for you as well?
I've updated the instructions on the wiki -- basically rewriting the first half of the "Building" section.
@thisandagain could you give that a quick eyeball?
@regcole and @rohinipatare, I believe the updated instructions will solve the issues you're seeing. Please give them a try and let us know what you see, so we can either close this issue or continue investigating. Thanks!
Looks good @cwillisf! Thanks.
@cwillisf could you please say what is you Operating System?i have trie npm run prepublish,and it failed,both on centos7 and win10
unfortunately,your updated instructions in the wiki
doesn't work well with me,actually it will run into an error like:

@jyh129143 me too.
for me It executed successfully with command npm run prepublish instead of python build.py
@rohinipatare could please relate your procedure of successfully run since git clone? And your npm/OS/python -v?
@jyh129143 I followed all the same procedure which are in wiki, I am getting error at last step i.e during executing python file build.py. I was executing it by command python build.py directly which was giving error and terminatin. To build it successfully, I only use command npm run prepublish in place of python build.py inside the respective directory.
I am using
npm 5.5.1, Fedora OS and Pytyhon 2.7.13
i tried it mac os,it succeed.but failed on windows10 and centos7
Aha,it sounds mysterious.Could you please show me how you operated and you version of npm & python?
@jyh129143 I'm getting same error too... (npm 6.1.0, Window10 x64, Python 2.7.15)
looks like many people are stucked here,(node -v9.7.1,npm -v5.6.0,Windows 10x64,Python2.7.10),could anyone help us?
same error as: File "build.py", line 598, in
test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
Still not working although I add shell = True in line 595.
@rohinipatare @lishuai199502 does it convinient for you to share a screenshot of successful building?
For anyone interested I have a workaround to this problem. Simply modify build.py in a text editor and add OSError to the handled exception list. The build should now succeed using the online closure compiler.
603: except (**OSError**, ImportError, AssertionError):
The puzzling thing about the build script is that it tries to execute "google-closure-compiler" in the build directory which would require some work to setup. The advanced compiler steps outlined in the blockly docs here didn't resolve this problem so maybe something got lost in translation.
Anyways, assuming you have correctly installed the required deps (python27 + java) then you can comment out the dubious check on lines 598-601 of build.py and you should be alright for a local build.
598: # test_args = [closure_compiler, os.path.join("build", "test_input.js")]
598: # test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
598: # (stdout, _) = test_proc.communicate()
598: # assert stdout == read(os.path.join("build", "test_expect.js"))
I have the same trouble,anyone solved it ?
me too.
in windows 10,change all "google-closure-compiler" to "google-closure-compiler.cmd"
that will solve it,but have other problem,
the cmd args is too long.(命令行太长)
i've tried your solution but still get an error with no error detail.. (on windows 10)
For anyone interested I have a workaround to this problem. Simply modify build.py in a text editor and add OSError to the handled exception list. The build should now succeed using the online closure compiler.
603: except (**OSError**, ImportError, AssertionError):The puzzling thing about the build script is that it tries to execute "google-closure-compiler" in the build directory which would require some work to setup. The advanced compiler steps outlined in the blockly docs here didn't resolve this problem so maybe something got lost in translation.
Anyways, assuming you have correctly installed the required deps (python27 + java) then you can comment out the dubious check on lines 598-601 of build.py and you should be alright for a local build.
598: # test_args = [closure_compiler, os.path.join("build", "test_input.js")] 598: # test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) 598: # (stdout, _) = test_proc.communicate() 598: # assert stdout == read(os.path.join("build", "test_expect.js"))
in windows 10,change all "google-closure-compiler" to "google-closure-compiler.cmd"
that will solve it,but have other problem,
the cmd args is too long.(命令行太长)
Got the same problem
Using @pawelmisk 's workaround and then getting the closure library does work for me.
the cmd args is too long, try it: https://blog.csdn.net/weixin_42856280/article/details/90288065
I test win10, tks everyone!
I could not get this to work locally on Windows with the Windows Compiler. I think it might be the way that I had npm install the google-closure stuff.
I put this at the same level as the other scratch repository folders.
So I had:
closure-library/
node-modules/
google-closure-library
google-closure-compiler
scratch-blocks/
node-modules/
…
In the end I commented out the local compile attempt which kept throwing an exception which wasn't handled (File Not Found)
and modified the line at 589 to be:
calcdeps = import_path(os.path.join(
closure_root, closure_library, CLOSURE_DIR_NPM, CLOSURE_LIBRARY_NPM, "closure", "bin", "calcdeps.py"))
I think the line 574 expects the compiler to be in your path - if it isn't I'll have to change it to add in the path to the compiler myself.
which got the remote compile started...it does take it's time and as I write this 15 minutes and it's still going.
Not the friendliest setup - has taken hours to get it to this point.
How long does it take to "compile" anyway because I'm wondering if it's failed.
Most helpful comment
For anyone interested I have a workaround to this problem. Simply modify build.py in a text editor and add OSError to the handled exception list. The build should now succeed using the online closure compiler.
603: except (**OSError**, ImportError, AssertionError):The puzzling thing about the build script is that it tries to execute "google-closure-compiler" in the build directory which would require some work to setup. The advanced compiler steps outlined in the blockly docs here didn't resolve this problem so maybe something got lost in translation.
Anyways, assuming you have correctly installed the required deps (python27 + java) then you can comment out the dubious check on lines 598-601 of build.py and you should be alright for a local build.