Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

gradle and zinc 3.x #44

Closed
mockitoguy opened this issue Jan 20, 2014 · 8 comments · Fixed by #55
Closed

gradle and zinc 3.x #44

mockitoguy opened this issue Jan 20, 2014 · 8 comments · Fixed by #55
Labels

Comments

@mockitoguy
Copy link

Hey guys,

There seem to be some breaking changes in the zinc api. Here's the error I get from upgrading a sample gradle build to use scala 2.10.3 and zinc 0.3.1-RC1. Can you shed some light on this issue: https://gist.github.com/szczepiq/9601aa06ab4be5d4fe64

Apologize if this is not the right place to raise this question / problem.

Thanks!

@jsuereth
Copy link
Contributor

Looks like a binary compatibility breakage.

The addition of the "fork java method": https://github.com/typesafehub/zinc/blob/master/src/main/scala/com/typesafe/zinc/Setup.scala#L114

@pvlugter Just curious, is 0.3.1 meant to be binary compatible?

@jsuereth jsuereth added the bug label Feb 14, 2014
@pvlugter
Copy link
Contributor

That's a mistake. It should stay compatible. It looks like 0.3.1 final was never released, so could be fixed there.

In the future the Java APIs could use a builder pattern and be easier to extend: #40

@mockitoguy
Copy link
Author

Hey guys,

Thanks for the comments. I'm trying to come up with some plan about this issue. Here's the state of things:

  1. Gradle currently ships and is compiled against with zinc 0.2.1
  2. zinc 0.2.1 does not seem to work correctly with scala 2.10.3: https://gist.github.com/szczepiq/8180f8628745d58545f7
  3. zinc 0.3.0/0.3.1-RC1/0.3.2-M1 does not seem to work correctly with Gradle, due to incompatible changes in Inputs.create and Setup.create.

Some questions:

  1. Do you plan to change the api so that it is backwards compatible. If you don't plan such changes I'll respect it - I just would like to know what's the plan.
  2. We'll add some extra coverage in order to catch this kind of problems earlier. Do you have any other suggestions on how we could avoid this in future? (e.g. deprecation, etc.)

Cheers!

@mockitoguy
Copy link
Author

One more question: we use Inputs.create() method: https://github.com/gradle/gradle/blob/master/subprojects/scala/src/main/groovy/org/gradle/api/internal/tasks/scala/jdk6/ZincScalaCompiler.java#L64

Now this method also requires IncOptions instance. Can you point me to some docs/code that I could inspire on when creating the IncOptions? The constructor expects a bunch of parameters that I don't have much clue about :)

@gkossakowski
Copy link
Contributor

It turns out that there is one more binary compatibility issue that has been not fixed by #55. This time it's related to zinc's version of IncOptions:

Caused by: java.lang.NoSuchMethodError: com.typesafe.zinc.IncOptions.<init>(IDZZILscala/Option;ZLscala/Option;)V
    at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler$Compiler.getIncOptions(ZincScalaCompiler.java:84)
    at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler$Compiler.execute(ZincScalaCompiler.java:57)
    at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler.execute(ZincScalaCompiler.java:43)
    at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler.execute(ZincScalaCompiler.java:39)
    at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)

Binary compatibility has been broken by 6f74673.

@gkossakowski
Copy link
Contributor

The issue with IncOptions has been fixed by #59.

@yhslai
Copy link

yhslai commented Oct 14, 2014

I still get the same exception with zinc 0.3.5.3. Any idea?

Caused by: java.lang.NoSuchMethodError: com.typesafe.zinc.IncOptions.<init>(IDZZILscala/Option;ZLscala/Option;)V
at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler$Compiler.getIncOptions(ZincScalaCompiler.java:84)
at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler$Compiler.execute(ZincScalaCompiler.java:57)
at org.gradle.api.internal.tasks.scala.jdk6.ZincScalaCompiler.execute(ZincScalaCompiler.java:43)

This problem seems only to occur when I use gradle with zinc.

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

Successfully merging a pull request may close this issue.

6 participants