google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.38k stars 1.15k forks source link

getBuiltinExterns - Externs zip must contain es6.js #2164

Closed bardware closed 7 years ago

bardware commented 7 years ago

I build a simple program utilizing CommandLineRunner to compress JS files. When I call CommandLineRunner.getBuiltinExterns(options) I get the error message Externs zip must contain es6.js This is the case für the binary provided on this site. I got the code and added a simple debug code at around line 470 in AbstractCommandLineRunner.java

                String s = String.format("Entry: %s len %d added %TD",
                                entry.getName(), entry.getSize(),
                                new Date(entry.getTime()));
                System.out.println(s);

After executing the code again my log reads:

Entry: chrome.js len 3348 added 11/14/13
Entry: deprecated.js len 1403 added 10/15/13
Entry: es3.js len 63518 added 11/14/13
Entry: es5.js len 6969 added 07/16/13
Entry: fileapi.js len 24258 added 07/16/13
Entry: flash.js len 6891 added 07/16/13
Entry: gears_symbols.js len 1025 added 07/16/13
Entry: gears_types.js len 16577 added 11/14/13
Entry: gecko_css.js len 6127 added 07/16/13
Entry: gecko_dom.js len 26649 added 07/16/13
Entry: gecko_event.js len 2484 added 07/16/13
Entry: gecko_xml.js len 2369 added 07/16/13
Entry: google.js len 974 added 07/16/13
Entry: html5.js len 69484 added 11/14/13
Entry: ie_css.js len 6083 added 07/16/13
Entry: ie_dom.js len 33940 added 07/16/13
Entry: ie_event.js len 6637 added 07/16/13
Entry: ie_vml.js len 1902 added 07/16/13
Entry: iphone.js len 11234 added 07/16/13
Entry: w3c_anim_timing.js len 4628 added 07/16/13
Entry: w3c_css.js len 56895 added 11/18/13
Entry: w3c_css3d.js len 6250 added 07/16/13
Entry: w3c_device_sensor_event.js len 2091 added 09/30/13
Entry: w3c_dom1.js len 25243 added 07/16/13
Entry: w3c_dom2.js len 64243 added 10/15/13
Entry: w3c_dom3.js len 21984 added 07/16/13
Entry: w3c_elementtraversal.js len 1605 added 07/16/13
Entry: w3c_event.js len 5856 added 08/26/13
Entry: w3c_event3.js len 1805 added 07/16/13
Entry: w3c_geolocation.js len 3551 added 07/16/13
Entry: w3c_indexeddb.js len 18416 added 09/30/13
Entry: w3c_navigation_timing.js len 6324 added 07/16/13
Entry: w3c_range.js len 7134 added 07/16/13
Entry: w3c_selectors.js len 2089 added 07/16/13
Entry: w3c_xml.js len 10887 added 10/11/13
Entry: webgl.js len 70299 added 10/11/13
Entry: webkit_css.js len 28885 added 07/16/13
Entry: webkit_dom.js len 6108 added 11/14/13
Entry: webkit_event.js len 1341 added 07/16/13
Entry: webkit_notifications.js len 5251 added 11/14/13
Entry: webstorage.js len 3113 added 07/16/13
Entry: window.js len 4503 added 07/16/13

There actually are a few files missing, among them es6.js and browser/fetchapi.js When I open the JAR files in jd decompiler and navigate to externs.zip everything seems to be complete. The zip file generated during my compile also includes every js file. What might cause the problems reading and extracting the zip file during the call to getBuiltinExterns?

Dominator008 commented 7 years ago

Some caching problem?

bardware commented 7 years ago

Strange, but not impossible. I write Coldfusion code and trust I access my self compiled jar file. Coldfusion actually delivers a version of closure compiler. I just happened to look in their jar file. The externs.zip there contains less files than the one built from current HEAD. Seems, my jar file accesses externs.zip from another closure jar in the path.

concavelenz commented 7 years ago

So you can close this issue then?

bardware commented 7 years ago

seems, so.