closurebuilder problem with grunt build #22

Closed
zemd opened this Issue Dec 25, 2013 · 5 comments

Comments

Projects
None yet
2 participants
@zemd

zemd commented Dec 25, 2013

There is an error ''IOError: [Errno 2] No such file or directory: 'temp/compiled.js'' during building source code.
This happens in this grunt task:

https://github.com/closureplease/generator-closure/blob/master/templates/Gruntfile.js#L210

app: {
  src: [
    CONF.appPath,
    CONF.closureLibrary,
    CONF.componentPath
  ],
  dest: 'temp/compiled.js'
},

if I create 'temp' folder, after running task it get removed.

Had made quick fix for closurebuilder.py for this

if options.output_file:
    output_dir = os.path.dirname(options.output_file)
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    out = open(options.output_file, 'w+')
  else:
    out = sys.stdout

but I think this is not an closurebuilder's issue.

@thanpolas

This comment has been minimized.

Show comment
Hide comment
@thanpolas

thanpolas Jan 6, 2014

Owner

I could not reproduce the problem... if the issue persists i'd have to have a closer look at either the Grunt Closure Tools or Grunt itself...

What OS are you on? Please provide full environment info if the issue persists.

Owner

thanpolas commented Jan 6, 2014

I could not reproduce the problem... if the issue persists i'd have to have a closer look at either the Grunt Closure Tools or Grunt itself...

What OS are you on? Please provide full environment info if the issue persists.

@zemd

This comment has been minimized.

Show comment
Hide comment
@zemd

zemd Jan 6, 2014

windows 8 x64
Python 2.7.5
node v0.10.24
npm 1.3.22

zemd commented Jan 6, 2014

windows 8 x64
Python 2.7.5
node v0.10.24
npm 1.3.22

@thanpolas

This comment has been minimized.

Show comment
Hide comment
@thanpolas

thanpolas Jan 6, 2014

Owner

nice, please help me debug, paste me the result of the following command:

grunt build --stack --debug
Owner

thanpolas commented Jan 6, 2014

nice, please help me debug, paste me the result of the following command:

grunt build --stack --debug
@zemd

This comment has been minimized.

Show comment
Hide comment
@zemd

zemd Jan 6, 2014

D:\proj>grunt build --stack --debug
Running "clean:dist" (clean) task
[D] Task source: D:\proj\node_modules\grunt-contrib-clean\tasks\clean.js
Cleaning temp...OK

Running "uglify:vendor" (uglify) task
[D] Task source: D:\proj\node_modules\grunt-contrib-uglify\tasks\uglify.js
>> Destination (temp/vendor.js) not written because src files were empty.

Running "closureBuilder:app" (closureBuilder) task
[D] Task source: D:\proj\node_modules\grunt-closure-tools\tasks\closureTools.js
Executing: python app/closure-library/closure/bin/build/closurebuilder.py  -i app/js/main.js --root=app/js/ --root=app/closure-library --root=app/components -o compiled --output_file=temp/compiled.js --compiler_jar=node_modules/superstartup-closure-compiler/build/sscompiler.jar --compiler_flags="--compilation_level=ADVANCED_OPTIMIZATIONS" --compiler_flags="--define='goog.DEBUG=false'" --compiler_flags="--warning_level=verbose" --compiler_flags="--jscomp_off=checkTypes" --compiler_flags="--jscomp_off=fileoverviewTags" --compiler_flags="--summary_detail_level=3" --compiler_flags="--only_closure_dependencies" --compiler_flags="--closure_entry_point=myapp" --compiler_flags="--create_source_map=app/jsc/sourcemap.js.map" --compiler_flags="--source_map_format=V3" --compiler_flags="--output_wrapper=(function(){%output%}).call(this);"
>> Error: Command failed: Traceback (most recent call last):
>>   File "app/closure-library/closure/bin/build/closurebuilder.py", line 268, in <module>
>>     main()
>>   File "app/closure-library/closure/bin/build/closurebuilder.py", line 197, in main
>>     out = open(options.output_file, 'w+')
>> IOError: [Errno 2] No such file or directory: 'temp/compiled.js'
>> FAILED to run command for target: app
Warning: Task "closureBuilder:app" failed. Use --force to continue.
Error: Task "closureBuilder:app" failed.
    at Task.<anonymous> (D:\proj\node_modules\grunt\lib\util\task.js:197:15)
    at null._onTimeout (D:\proj\node_modules\grunt\lib\util\task.js:225:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Aborted due to warnings.

zemd commented Jan 6, 2014

D:\proj>grunt build --stack --debug
Running "clean:dist" (clean) task
[D] Task source: D:\proj\node_modules\grunt-contrib-clean\tasks\clean.js
Cleaning temp...OK

Running "uglify:vendor" (uglify) task
[D] Task source: D:\proj\node_modules\grunt-contrib-uglify\tasks\uglify.js
>> Destination (temp/vendor.js) not written because src files were empty.

Running "closureBuilder:app" (closureBuilder) task
[D] Task source: D:\proj\node_modules\grunt-closure-tools\tasks\closureTools.js
Executing: python app/closure-library/closure/bin/build/closurebuilder.py  -i app/js/main.js --root=app/js/ --root=app/closure-library --root=app/components -o compiled --output_file=temp/compiled.js --compiler_jar=node_modules/superstartup-closure-compiler/build/sscompiler.jar --compiler_flags="--compilation_level=ADVANCED_OPTIMIZATIONS" --compiler_flags="--define='goog.DEBUG=false'" --compiler_flags="--warning_level=verbose" --compiler_flags="--jscomp_off=checkTypes" --compiler_flags="--jscomp_off=fileoverviewTags" --compiler_flags="--summary_detail_level=3" --compiler_flags="--only_closure_dependencies" --compiler_flags="--closure_entry_point=myapp" --compiler_flags="--create_source_map=app/jsc/sourcemap.js.map" --compiler_flags="--source_map_format=V3" --compiler_flags="--output_wrapper=(function(){%output%}).call(this);"
>> Error: Command failed: Traceback (most recent call last):
>>   File "app/closure-library/closure/bin/build/closurebuilder.py", line 268, in <module>
>>     main()
>>   File "app/closure-library/closure/bin/build/closurebuilder.py", line 197, in main
>>     out = open(options.output_file, 'w+')
>> IOError: [Errno 2] No such file or directory: 'temp/compiled.js'
>> FAILED to run command for target: app
Warning: Task "closureBuilder:app" failed. Use --force to continue.
Error: Task "closureBuilder:app" failed.
    at Task.<anonymous> (D:\proj\node_modules\grunt\lib\util\task.js:197:15)
    at null._onTimeout (D:\proj\node_modules\grunt\lib\util\task.js:225:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Aborted due to warnings.

@thanpolas thanpolas closed this in 40e5bec Jan 6, 2014

@thanpolas

This comment has been minimized.

Show comment
Hide comment
@thanpolas

thanpolas Jan 6, 2014

Owner

@Hunterman fixed, generator will now create the temp/ folder for you, v0.1.13 is on npm.

You experienced an edge case were you removed all vendor files so Grunt did not have a chance to create the temp/ folder before closureBuilder was run...

Owner

thanpolas commented Jan 6, 2014

@Hunterman fixed, generator will now create the temp/ folder for you, v0.1.13 is on npm.

You experienced an edge case were you removed all vendor files so Grunt did not have a chance to create the temp/ folder before closureBuilder was run...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment