Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Compilation for GWT 2.7 SOYC Fails

Tags:

gwt-2.7

How do i generate GWT Soyc report in 2.7?

GWT 2.7 maven project created using following archetype command.

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.7.0

I am trying to generate soyc report for it. I have tried 2 approaches and both are failing in creating a soyc report. Is this feature abandoned.

Approach 1 - I have tried using configuration parameters in the pom.xml

            <compilerMetrics>true</compilerMetrics>
            <compileReport>true</compileReport>
            <detailedSoyc>true</detailedSoyc>

Approach 2 - I have tried using mvn command line argument

mvn -Dgwt.compiler.soycDetailed=true clean install

However, the build passes without creating soyc with following exception

[INFO] Compiling module com.appbootup.explore.gwt.HelloGWTApp
[INFO]    Compiling 5 permutations
[INFO]       Compiling permutation 0...
[INFO]       Process output
[INFO]          Compiling
[INFO]             Compiling permutation 1...
[INFO]       Process output
[INFO]          Compiling
[INFO]             Compiling permutation 4...
[INFO]       Process output
[INFO]          Compiling
[INFO]             Compiling permutation 2...
[INFO]       Process output
[INFO]          Compiling
[INFO]             Compiling permutation 3...
[INFO]       Creating Stories file for the compile report
[INFO]          [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO]  at java.util.Stack.peek(Stack.java:102)
[INFO]  at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO]  at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO]  at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO]  at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO]  at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO]  at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO]  at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO]  at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO]  at java.lang.Thread.run(Thread.java:745)
[INFO]             Creating Stories file for the compile report
[INFO]                [ERROR] Could not write dependency file.
[INFO]          java.util.EmptyStackException
[INFO]              at java.util.Stack.peek(Stack.java:102)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO]              at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO]              at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO]              at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO]              at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO]              at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO]              at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO]             Creating Stories file for the compile report
[INFO]                [ERROR] Could not write dependency file.
[INFO]          java.util.EmptyStackException
[INFO]              at java.util.Stack.peek(Stack.java:102)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO]              at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO]              at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO]              at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO]              at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO]              at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO]              at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO]             Creating Stories file for the compile report
[INFO]                [ERROR] Could not write dependency file.
[INFO]          java.util.EmptyStackException
[INFO]              at java.util.Stack.peek(Stack.java:102)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO]              at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO]              at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO]              at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO]              at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO]              at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO]              at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO]             Creating Stories file for the compile report
[INFO]                [ERROR] Could not write dependency file.
[INFO]          java.util.EmptyStackException
[INFO]              at java.util.Stack.peek(Stack.java:102)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO]              at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO]              at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO]              at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO]              at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO]              at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO]              at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO]              at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO]              at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO]    Compile of permutations succeeded
[INFO]    Compilation succeeded -- 14.936s
[INFO] Linking into D:\workspace\GWork\hello-gwt-app\target\hello-gwt-app-1.0-SNAPSHOT\HelloGWTApp; Writing extras to D:\workspace\GWork\hello-gwt-app\target\extra\HelloGWTApp
[INFO]    Link succeeded
[INFO]    Linking succeeded -- 0.873s
like image 257
appbootup Avatar asked Sep 30 '22 00:09

appbootup


1 Answers

Try removing the detailed Soyc parameter. I ran into this issue as well; I was generating SOYC no problem, then it started failing, so I tweaked my settings until I got SOYC back. With json soyc enabled and detailed Soyc disabled, I still get plenty of details showing me where my compile size is coming from.

Here's what I'm using at present:

-XjsInteropMode JS -XmethodNameDisplayMode NONE -Xnamespace NONE
-style OBFUSCATED -sourceLevel 1.8 -compileReport -XnocompilerMetrics
-XnocheckCasts -XnoclassMetadata -XclusterFunctions -XinlineLiteralParameters
 -XoptimizeDataflow -noincrementalCompileWarnings -XenableJsonSoyc 
-nooverlappingSourceWarnings -saveSource -soycReport -XnodetailedSoyc 
-optimize 9 -setProperty compiler.stackMode=strip net.wetheinter.webcomponent.GwtcTest

Note to anyone else who stumbles upon this, I set a java exception breakpoint on EmptyStackException and found the empty stack seemed to happen around LongLibBase. This may be a compiler bug, as this is an intrinsic class that is generally treated differently than other classes.

like image 148
Ajax Avatar answered Dec 31 '22 22:12

Ajax