angular / clutz

Closure to TypeScript `.d.ts` generator
MIT License
162 stars 60 forks source link

Build are failing #985

Open kwiva opened 4 years ago

kwiva commented 4 years ago

Both all recent CI builds and my local builds are failing. I've tried upgrading to Guava 28.2, but that does not work.

/Users/kwiva/Projects/clone/clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:1318: error: cannot find symbol
        .splitToStream(namespace)
        ^
  symbol:   method splitToStream(String)
  location: variable DOT_SPLITTER of type Splitter
/Users/kwiva/Projects/clone/clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:2356: error: cannot find symbol
      return type.equals(typeRegistry.getNativeType(JSTypeNative.FUNCTION_TYPE));
                                                                ^
  symbol:   variable FUNCTION_TYPE
  location: class JSTypeNative
/Users/kwiva/Projects/clone/clutz/src/main/java/com/google/javascript/clutz/Options.java:183: error: cannot find symbol
    options.setBadRewriteModulesBeforeTypecheckingThatWeWantToGetRidOf(true);
           ^
  symbol:   method setBadRewriteModulesBeforeTypecheckingThatWeWantToGetRidOf(boolean)
  location: variable options of type CompilerOptions
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
mprobst commented 4 years ago

Internal issue created: b/148431526

shicks commented 4 years ago

@mprobst Is this something we can reproduce at all?

mprobst commented 4 years ago

Yes, I can reproduce. I think the problem is as kwiva writes that the Guava version referenced in build.gradle does not match what we're using internally. 28.2 should actually include the missing splitToStream method though:

https://github.com/google/guava/blame/master/guava/src/com/google/common/base/Splitter.java

evmar commented 4 years ago

kwiva, can you talk more about how you use Clutz? One option we're considering is archiving the project completely because it's difficult for us to publish and we don't think there are many users.

joswhite commented 4 years ago

What's the status on this? I've noticed that clutz builds have been failing on CircleCI for about 6 months. Looks like the most recent successful build is https://circleci.com/gh/angular/clutz/563. I'd like to use clutz to convert a Closure project to more modern web frameworks, but I'm not sure whether to use the latest successful build from 6 months ago or to try to get a build working from master.

jonrimmer commented 4 years ago

The problem is you are depending on https://search.maven.org/artifact/com.google.javascript/closure-compiler which is a "shaded" JAR, where all the dependencies (e.g. Guava) are re-packaged inside it. The shading is supposed to rename the deps to prevent conflicts, but it seems this hasn't been configured properly for closure-compiler, so the upshot is that its outdated version of Guava (25.1-jre) is on the classpath no matter what, and Gradle can't override it.

The solution is replace your closure-compiler dependency with the unshaded version, e.g. com.google.javascript:closure-compiler-unshaded:v20200517, then force the Guava version in build.gradle:

compile ('com.google.guava:guava:28.2-jre') {
  force = true
}

😫 Debugging nonsense like this reminds me why I gave up Java development.

evmar commented 4 years ago

As I commented a bit upthread we (the Clutz maintainers) are not great at these kinds of issues and have discussed archiving the project. If you use Clutz, could you comment on https://github.com/angular/clutz/issues/1006 ?