user tests fail to compile

97 views
Skip to first unread message

Colin Alworth

unread,
Jun 12, 2014, 4:25:51 PM6/12/14
to google-web-tool...@googlegroups.com
I’m trying to bring https://gwt-review.googlesource.com/#/c/3361/ up to date, and after rebasing and fixing a few whitespace nits I tried to run the tests by they failed. Concerned that I had broken something I backed off to current master, and ran tests again. First I did a clean dist-dev in the root directory, then simply compiling user tests, I get a failure:

[colin@modo user (master)]$ ant clean compile.tests
Buildfile: /Users/colin/Documents/idea/gwt/user/build.xml

clean:
   [delete] Deleting directory /Users/colin/Documents/idea/gwt/build/out/user

compile.dev.tests:

compiler.standalone:

build.alldeps.jar:

compile:

-filter.props:

build:

compile.emma.if.enabled:

-compile.emma.if.enabled:

compile.tests:
[gwt.javac] Compiling 1 source file to /Users/colin/Documents/idea/gwt/build/out/dev/bin-test

compile.emma.if.enabled:

-compile.emma.if.enabled:

compile.tests:
    [mkdir] Created dir: /Users/colin/Documents/idea/gwt/build/out/user/bin-test
[gwt.javac] Compiling 1514 source files to /Users/colin/Documents/idea/gwt/build/out/user/bin-test
[gwt.javac] /Users/colin/Documents/idea/gwt/user/test/com/google/gwt/dev/testdata/incrementalbuildsystem/super/com/google/gwt/dev/testdata/incrementalbuildsystem/ImmediateCompileFails.java:19: error: duplicate class: com.google.gwt.dev.testdata.incrementalbuildsystem.ImmediateCompileFails
[gwt.javac] public class ImmediateCompileFails {
[gwt.javac]        ^
[gwt.javac] /Users/colin/Documents/idea/gwt/user/test/com/google/web/bindery/requestfactory/apt/RfValidatorTest.java:177: error: cannot find symbol
[gwt.javac]     rfValidator.setClientOnly(clientOnly);
[gwt.javac]                ^
[gwt.javac]   symbol:   method setClientOnly(boolean)
[gwt.javac]   location: variable rfValidator of type RfValidator
[gwt.javac] Note: Some input files use or override a deprecated API.
[gwt.javac] Note: Recompile with -Xlint:deprecation for details.
[gwt.javac] Note: Some input files use unchecked or unsafe operations.
[gwt.javac] Note: Recompile with -Xlint:unchecked for details.
[gwt.javac] 2 errors

BUILD FAILED
/Users/colin/Documents/idea/gwt/user/build.xml:150: Compile failed; see the compiler error output for details.

Total time: 15 seconds

Anyone else seeing this, or is it likely a local env issue? I’ve confirmed that my tools/ dir is up to date, and I’m not sure what other local configuration might be required just to compile tests.

Colin Alworth

unread,
Jun 12, 2014, 6:12:39 PM6/12/14
to google-web-tool...@googlegroups.com
With some help from Jens Nehlmeier over in ##gwt, it looks like there are two distinct issues preventing the build from passing presently The first is that the class ImmediateCompileFails does in fact cause problems with compiling - the simplest fix was to tell the compile.tests target to leave off compiling any super sources:
diff --git a/user/build.xml b/user/build.xml
index 274f4ef..54fc17d 100755
--- a/user/build.xml
+++ b/user/build.xml
@@ -147,7 +147,7 @@
           depends="compile.dev.tests, compile.emma.if.enabled"
           unless="compile.tests.complete">
     <mkdir dir="${javac.junit.out}"/>
-    <gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**" destdir="${javac.junit.out}">
+    <gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**,**/super/**" destdir="${javac.junit.out}">
       <classpath>
         <pathelement location="${javac.out}"/>
         <pathelement location="${gwt.tools.lib}/junit/junit-4.8.2.jar"/>

The second issue is that the requestfactory-apt.jar in the GWT Tools SVN repo appears to be out of date. Doing a dist-dev build and copying the newly generated -apt over to my local SVN checkout seems to bring this back into working order.

Michael Prentice

unread,
Jun 13, 2014, 12:34:21 AM6/13/14
to google-web-tool...@googlegroups.com
I hit the same thing last night. The fix you suggested may help with Ant, but it does not resolve the compile errors in Eclipse :( It doesn't look like Eclipse has any Annotations to ignore these types of severe errors either,

I just pulled in the 4 commits from today and they don't help with this:

  • List cannot be resolved to a type ImmediateCompileFails.java
    • /gwt-user/core/test/com/google/gwt/dev/testdata/incrementalbuildsystem/super/com/google/gwt/dev/testdata/incrementalbuildsystem line 20 Java Problem
  • ArrayList cannot be resolved to a type ImmediateCompileFails.java
    • /gwt-user/core/test/com/google/gwt/dev/testdata/incrementalbuildsystem/super/com/google/gwt/dev/testdata/incrementalbuildsystem line 20 Java Problem
  • The declared package "com.google.gwt.dev.testdata.incrementalbuildsystem" does not match the expected package "com.google.gwt.dev.testdata.incrementalbuildsystem.super.com.google.gwt.dev.testdata.incrementalbuildsystem"
    • ImmediateCompileFails.java /gwt-user/core/test/com/google/gwt/dev/testdata/incrementalbuildsystem/super/com/google/gwt/dev/testdata/incrementalbuildsystem line 14 Java Problem
I also get errors on the Ant build even after replacing the requestfactory-apt.jar in the GWT Tools SVN repo with the output of my dist-dev build.

Michael Prentice

unread,
Jun 13, 2014, 12:43:46 AM6/13/14
to google-web-tool...@googlegroups.com
Full clean Ant build just finished and it passed with the build.xml tweak and the requestfactory-apt.jar update. Thanks Colin.

Eclipse still unhappy though of course.

Is there an issue/patch for this? Has anyone tracked down the original change set that caused this? I might be able to take a look in the morning if not.

Jens

unread,
Jun 13, 2014, 4:28:29 AM6/13/14
to google-web-tool...@googlegroups.com
Eclipse still unhappy though of course.

In Eclipse any folder that contains super source should be excluded from the classpath so that its not treated as Java package but instead a simple folder with java files. So go to gwt-user project settings -> build path -> source. Select gwt-user/core/test -> Excluded and click edit. Add exclusion pattern **/super/** . Then the errors are gone in Eclipse.

-- J.

Michael Prentice

unread,
Jun 14, 2014, 10:22:47 AM6/14/14
to google-web-tool...@googlegroups.com
Thanks Jens, that worked great. 

This .classpath file is in source control, so this should probably go into a patch. Is anyone working on one already?

<classpathentry excluding="**/super/**" kind="src" path="core/test"/>

Michael Prentice

unread,
Jun 14, 2014, 2:55:23 PM6/14/14
to google-web-tool...@googlegroups.com
I've uploaded a patch for this:

Ray Cromwell

unread,
Jun 14, 2014, 3:07:18 PM6/14/14
to google-web-toolkit-contributors
I'm not sure why or when that happened. I checked in a big patch (#7600) recently that may or may not have caused it. I wonder if someone can seek back before my commit and see if the failure is still present.



--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/6d1e9862-1217-49cd-994c-7faf9dfc36be%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jens

unread,
Jun 14, 2014, 3:51:13 PM6/14/14
to google-web-tool...@googlegroups.com
I'm not sure why or when that happened. I checked in a big patch (#7600) recently that may or may not have caused it. I wonder if someone can seek back before my commit and see if the failure is still present.

Its not your commit that caused these errors. 

The RequestFactory error simply exists because no one seems to keep requestfactory-apt.jar up-to-date in the SVN tools repo. Maybe the build script can be updated to first build requestfactory-apt.jar and then use this build version in other tasks. That way we don't need to have requestfactory-apt.jar in the SVN repo.

The other error has been introduced in https://gwt-review.googlesource.com/#/c/7865/ . Prior to this CL there wasn't any super source folder present in /user/test so ant script and the eclipse .classpath file did not exclude **/super/**. 

However I am wondering if the super source files in #7865 are better placed into user/test-super ? I guess thats why test-super exists (?) and we would not need to change the ant build script and eclipse .classpath.

-- J.

Thomas Broyer

unread,
Jun 14, 2014, 6:55:58 PM6/14/14
to google-web-tool...@googlegroups.com


On Saturday, June 14, 2014 9:51:13 PM UTC+2, Jens wrote:
I'm not sure why or when that happened. I checked in a big patch (#7600) recently that may or may not have caused it. I wonder if someone can seek back before my commit and see if the failure is still present.

Its not your commit that caused these errors. 

The RequestFactory error simply exists because no one seems to keep requestfactory-apt.jar up-to-date in the SVN tools repo. Maybe the build script can be updated to first build requestfactory-apt.jar and then use this build version in other tasks. That way we don't need to have requestfactory-apt.jar in the SVN repo.

Just pushed https://gwt-review.googlesource.com/7855 which should fix this.
 
The other error has been introduced in https://gwt-review.googlesource.com/#/c/7865/ . Prior to this CL there wasn't any super source folder present in /user/test so ant script and the eclipse .classpath file did not exclude **/super/**. 

The gwt.javac macro in common.ant.xml excludes **/super/** by default, but the call point in compile.tests in user/build.xml overrides the excludes="" and removed the **/super/** exclusion. I think that was a bug (by oversight).
Also note that user/BUILD already excluded **/super/** from user-test-code.
 
However I am wondering if the super source files in #7865 are better placed into user/test-super ? I guess thats why test-super exists (?)

There's no strict rule. com.google.gwt.regexp.super is in user/src, not user/test for instance.
I think the super/ root was originally more about IDEs than a real will to segregate those files.

Jens

unread,
Jun 14, 2014, 9:07:17 PM6/14/14
to google-web-tool...@googlegroups.com
The gwt.javac macro in common.ant.xml excludes **/super/** by default, but the call point in compile.tests in user/build.xml overrides the excludes="" and removed the **/super/** exclusion. I think that was a bug (by oversight).

Hmm I don't see anything that tells gwt.javac to exclude **/super/** by default. But maybe it is a good idea to add it. The compile task explicitly excludes  **/super/** in user/build.xml and the compile.tests task does not exclude it because there was no need to do so until now.
 


 However I am wondering if the super source files in #7865 are better placed into user/test-super ? I guess thats why test-super exists (?)

There's no strict rule. com.google.gwt.regexp.super is in user/src, not user/test for instance.
I think the super/ root was originally more about IDEs than a real will to segregate those files.

I would prefer to have one strategy instead of two. But I guess that will happen anyways sooner or later with gwt modularization.


-- J.

Thomas Broyer

unread,
Jun 15, 2014, 4:43:00 AM6/15/14
to google-web-tool...@googlegroups.com


On Sunday, June 15, 2014 3:07:17 AM UTC+2, Jens wrote:
The gwt.javac macro in common.ant.xml excludes **/super/** by default, but the call point in compile.tests in user/build.xml overrides the excludes="" and removed the **/super/** exclusion. I think that was a bug (by oversight).

Hmm I don't see anything that tells gwt.javac to exclude **/super/** by default. But maybe it is a good idea to add it. The compile task explicitly excludes  **/super/** in user/build.xml and the compile.tests task does not exclude it because there was no need to do so until now.

Whoops! Totally misread my "git grep" results! ;-)
 
 However I am wondering if the super source files in #7865 are better placed into user/test-super ? I guess thats why test-super exists (?)

There's no strict rule. com.google.gwt.regexp.super is in user/src, not user/test for instance.
I think the super/ root was originally more about IDEs than a real will to segregate those files.

I would prefer to have one strategy instead of two. But I guess that will happen anyways sooner or later with gwt modularization.

I remember making that same remark when c.g.g.regexp was added that "broke the rule", but that ship has sailed years ago.
I must say I wouldn't be opposed to having everything in src/ and test/ and removing super/ and test-super/ altogether (for user/ we have test_i18n_bar and test_i18n_dollar, that was added a while back [1,2], I wonder if we couldn't refactor the tests with a single "source root")

Reply all
Reply to author
Forward
0 new messages