Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Compression on Failure #995

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobby285271
Copy link

@bobby285271 bobby285271 commented Jul 24, 2020

7 月 24 日 21:36 已编辑

修复了 GitHub Action 持续构建失败的问题:

2020-07-24T05:42:28.8812198Z for i in `find build/admin/js/ -name '*.js'`; do echo $i && java -Xmx32m -jar yuicompressor-2.4.2.jar $i --charset UTF-8 -o $i; done;
......
2020-07-24T05:42:34.1595263Z build/admin/js/jquery.js
2020-07-24T05:42:34.6563594Z 
2020-07-24T05:42:34.6615587Z [ERROR] 1:53335:invalid property id
2020-07-24T05:42:34.6635484Z 
2020-07-24T05:42:34.6636008Z [ERROR] 1:53870:missing ) after argument list
2020-07-24T05:42:34.6650758Z 
2020-07-24T05:42:34.6651224Z [ERROR] 1:53927:invalid return
2020-07-24T05:42:34.6665182Z 
2020-07-24T05:42:34.6665621Z [ERROR] 1:54388:invalid return
2020-07-24T05:42:34.6698417Z 
2020-07-24T05:42:34.6698927Z [ERROR] 1:54747:missing ; before statement
2020-07-24T05:42:34.6703436Z 
2020-07-24T05:42:34.6703889Z [ERROR] 1:54785:invalid return
2020-07-24T05:42:34.6711558Z 
2020-07-24T05:42:34.6711974Z [ERROR] 1:54988:invalid return
2020-07-24T05:42:34.6720044Z 
2020-07-24T05:42:34.6720502Z [ERROR] 1:55525:invalid return
2020-07-24T05:42:34.6724587Z 
2020-07-24T05:42:34.6724992Z [ERROR] 1:55634:invalid return
2020-07-24T05:42:34.6728855Z 
2020-07-24T05:42:34.6729255Z [ERROR] 1:56020:invalid return
2020-07-24T05:42:34.6844724Z 
2020-07-24T05:42:34.6845702Z [ERROR] 1:64459:invalid property id
2020-07-24T05:42:34.6845840Z 
2020-07-24T05:42:34.6845929Z [ERROR] 1:64563:invalid return
2020-07-24T05:42:34.6848515Z 
2020-07-24T05:42:34.6848789Z [ERROR] 1:64927:invalid return
2020-07-24T05:42:34.6905869Z 
2020-07-24T05:42:34.6906353Z [ERROR] 1:74236:missing name after . operator
2020-07-24T05:42:34.7003440Z 
2020-07-24T05:42:34.7005314Z [ERROR] 1:75431:invalid property id
2020-07-24T05:42:34.7040564Z 
2020-07-24T05:42:34.7042257Z [ERROR] 1:75773:missing ; before statement
2020-07-24T05:42:34.7046078Z 
2020-07-24T05:42:34.7048870Z [ERROR] 1:75950:syntax error
2020-07-24T05:42:34.7053811Z 
2020-07-24T05:42:34.7055151Z [ERROR] 1:75998:invalid return
2020-07-24T05:42:34.7076168Z 
2020-07-24T05:42:34.7077569Z [ERROR] 1:83510:invalid return
2020-07-24T05:42:34.7082890Z 
2020-07-24T05:42:34.7084315Z [ERROR] 1:0:Compilation produced 19 syntax errors.
2020-07-24T05:42:34.7099736Z org.mozilla.javascript.EvaluatorException: Compilation produced 19 syntax errors.
2020-07-24T05:42:34.7102895Z 	at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:135)
2020-07-24T05:42:34.7104512Z 	at org.mozilla.javascript.Parser.parse(Parser.java:410)
2020-07-24T05:42:34.7106528Z 	at org.mozilla.javascript.Parser.parse(Parser.java:355)
2020-07-24T05:42:34.7108415Z 	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
2020-07-24T05:42:34.7110070Z 	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
2020-07-24T05:42:34.7111617Z 	at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:112)
2020-07-24T05:42:34.7113155Z 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-07-24T05:42:34.7114873Z 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-07-24T05:42:34.7116441Z 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-07-24T05:42:34.7118079Z 	at java.lang.reflect.Method.invoke(Method.java:498)
2020-07-24T05:42:34.7119715Z 	at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)
2020-07-24T05:42:34.7266284Z Makefile:8: recipe for target 'update' failed
2020-07-24T05:42:34.7267271Z make: *** [update] Error 2
2020-07-24T05:42:34.7283703Z ##[error]Process completed with exit code 2.

原本已经有了 UglifyJS(tools/build.js)对 admin/src/js/ 的 Javascript 文件做压缩 ,所以 admin/js/jquery.js 这个文件已经是压缩过的。然后在打包流程时被 YUI Compressor 2.8.2 再次压缩,结果有以上报错。根据报错位置定位发现一个没有被引号括起来的 float,在原本的 jquery.js (2.1.1-rc2) 中 float 是被括起来的,应该是 UglifyJS 把引号去掉了。这里有相应的 StackOverflow 提问

修改了 Makefile 使 YUI Compressor 报错时依然继续打包。

@bobby285271
Copy link
Author

插一句题外话,可以考虑更新一下 官网下载页 开发版部分的内容,指引用户去 这里 下载 artifacts,而不是盯着空白的版本信息、1970 年 1 月 1 日的最后更新日期和已经荒废掉的 Travis CI 构建状态图标陷入沉思...

@joyqi
Copy link
Member

joyqi commented Jul 25, 2020

Travis CI 确实到了要被干掉的时候啦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants