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

Incremental compiler API incompatibility with Scala Compiler 2.13.1 #363

Closed
martin-g opened this issue Sep 18, 2019 · 8 comments
Closed

Comments

@martin-g
Copy link

Upgrading from 2.13.0 to 2.13.1 fails my build with:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.2.0:compile (scala-compile-first) on project wicketstuff-scala: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:4.2.0:compile failed: An API incompatibility was encountered while executing net.alchim31.maven:scala-maven-plugin:4.2.0:compile: java.lang.NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>net.alchim31.maven:scala-maven-plugin:4.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/martin/.m2/repository/net/alchim31/maven/scala-maven-plugin/4.2.0/scala-maven-plugin-4.2.0.jar
...

Related-to: scala/bug#11742

@slandelle
Copy link
Collaborator

Thanks for reporting. Actually, the problem is similar, but here it's a zinc component that gets broken. I've opened an issue against zinc: sbt/zinc#698

@ghost
Copy link

ghost commented Oct 10, 2019

Is there any update on this please? Seeing that the discussion over sbt/zinc seems to indicate the "precompiled binary" for compiler-bridge cannot be used.

@slandelle slandelle changed the title API incompatibility with Scala Compiler 2.13.1 Incremental compiler API incompatibility with Scala Compiler 2.13.1 Oct 10, 2019
@slandelle
Copy link
Collaborator

Renaming issue to make it clear that only the incremental compiler mode suffers from this incompatibility issue and not the all one.

@slandelle
Copy link
Collaborator

@davidB Would you mind cutting a release, please?

@davidB
Copy link
Owner

davidB commented Oct 15, 2019

@slandelle , I have issue with the release process (I will diseable some of doc generation, api,... - useless). I'll try to release this week.

@slandelle
Copy link
Collaborator

Cool, thanks!

@davidB
Copy link
Owner

davidB commented Oct 16, 2019

4.2.4 published on maven central

@slandelle
Copy link
Collaborator

Thanks!

HyukjinKwon pushed a commit to apache/spark that referenced this issue Oct 21, 2019
…for Scala 2.13.1

### What changes were proposed in this pull request?

This PR upgrades `scala-maven-plugin` to `4.2.4` for Scala `2.13.1`.

### Why are the changes needed?
Scala 2.13.1 seems to break the binary compatibility.

We need to upgrade `scala-maven-plugin` to bring the the following fixes for the latest Scala 2.13.1.
- davidB/scala-maven-plugin#363
- sbt/zinc#698

### Does this PR introduce any user-facing change?

No.

### How was this patch tested?

For now, we don't support Scala-2.13. This PR at least needs to pass the existing Jenkins with Maven to get prepared for Scala-2.13.

Closes #26185 from dongjoon-hyun/SPARK-29528.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
dongjoon-hyun added a commit to apache/spark that referenced this issue Nov 10, 2019
…13.1

### What changes were proposed in this pull request?

This PR aims to upgrade `scala-maven-plugin` to `4.3.0` for Scala `2.13.1`.
We tried 4.2.4, but it's reverted due to Windows build issue. Now, `4.3.0` has a Window fix.

### Why are the changes needed?
Scala 2.13.1 seems to break the binary compatibility.

We need to upgrade `scala-maven-plugin` to bring the the following fixes for the latest Scala 2.13.1.
- davidB/scala-maven-plugin#363
- sbt/zinc#698

Also, `4.3.0` has the following Window fix.
- davidB/scala-maven-plugin#370 (4.2.4 throws error on Windows)

### Does this PR introduce any user-facing change?

No.

### How was this patch tested?

- For now, we don't support Scala-2.13. This PR at least needs to pass the existing Jenkins with Maven to get prepared for Scala-2.13.
- `AppVeyor` passed. (https://ci.appveyor.com/project/ApacheSoftwareFoundation/spark/builds/28745383)

Closes #26457 from dongjoon-hyun/SPARK-29528.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
ittaiz added a commit to wix-playground/intellij that referenced this issue Aug 18, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Sep 1, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Sep 11, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Sep 19, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Oct 24, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Oct 24, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Nov 2, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Nov 10, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
ittaiz added a commit to wix-playground/intellij that referenced this issue Nov 13, 2022
Doesn't work
Issues:
Biggest one is mess with classpath:
    Source compiling compiler_bridge
        NoSuchMethodError: 'scala.tools.nsc.settings.AbsSettings$AbsSetting scala.tools.nsc.Settings.nowarn()'
        davidB/scala-maven-plugin#363
        sbt/zinc#698
    Need uber jars in various forms (not hacked all the way through and where I gave up)
        Caused by: java.lang.ClassNotFoundException: jline.TerminalFactory
    Required adding ~40 dependencies of Zinc
    Conflicts with IJ scala plugin classes
        com.intellij.diagnostic.PluginException: Cannot load class scala.Option (
          error: loader constraint violation: loader com.intellij.ide.plugins.cl.PluginClassLoader @29446114 wants to load abstract class scala.Option. A different abstract class with the same name was previously loaded by com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc. (scala.Option is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @61ed07dc, parent loader 'bootstrap'),
          classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Bazel, id=com.google.idea.bazel.ijwb, descriptorPath=plugin.xml, path=~/Library/Caches/JetBrains/IntelliJIdea2022.2/plugins-sandbox/plugins/ijwb, version=9999-api-version-222, package=null, isBundled=false), packagePrefix=null, instanceId=282, state=active)
        )
            at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:411)

Smaller:
    Hack in how to find the jar of the fast scalac
    Hardcoding the scala version and the SDK
    No access for now to scalaCompilerPlugins, scalaCompilerOptions, javaCompilerOptions

Tech debt in the PR:
    Two compiler impls (fast_build_scalac2, ScalaCompilerImpl2)
    Especially in the BUILD files
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

No branches or pull requests

3 participants