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

Breaks under 2.13.1 #195

Closed
nrinaudo opened this issue Oct 13, 2019 · 2 comments · Fixed by #196
Closed

Breaks under 2.13.1 #195

nrinaudo opened this issue Oct 13, 2019 · 2 comments · Fixed by #196

Comments

@nrinaudo
Copy link

Running mdoc under 2.13.1 yields the following runtime error:

 java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter

Which is true:

Tools that use the scala compiler jar are expected to be fully cross-versioned - not one version for 2.13, but one for 2.13.0, another for 2.13.1, ... Many tools suffer from the same issue (scoverage and kind-projector, for example).

@nrinaudo
Copy link
Author

I'm happy to help with this - already have a version that appears to work with 2.13.1 - but I'll need some instructions on how to deal with cross publishing.

As far as I understand, I'll have to set things up so that versions of mdoc are available for every supported scala version - so, not 2.12, say, but 2.12.9, 2.12.10, ... should I just take whatever is the latest 2.11 and 2.12, or do you want to support older versions as well? If so, you wouldn't happen to have a list, would you?

I'm also running in weird build issues, but these might be local. I'll ask for help if they also occur in the CI once I have something to push.

@olafurpg
Copy link
Member

Thank you for reporting! It looks like we'll have to cross-publish mdoc against exact Scala versions using crossVersion := CrossVersion.full. We used to do this before but changed to the simpler CrossVersion.binary setting to support new Scala versions as they are published. It's a shame 2.13.1 introduced this breaking change...

As far as I understand, I'll have to set things up so that versions of mdoc are available for every supported scala version - so, not 2.12, say, but 2.12.9, 2.12.10, ... should I just take whatever is the latest 2.11 and 2.12, or do you want to support older versions as well

I'm fine with supporting only the latest 2.12/2.11/2.13 versions. We'll have to update the module ID in sbt-mdoc

List("org.scalameta" %% s"mdoc$suffix" % BuildInfo.version)

The mdoc-js module will continue to be CrossVersion.binary.

A PR updating support for 2.13.1 would be welcome!

tgodzik added a commit to tgodzik/mdoc that referenced this issue Jan 15, 2021
It seems that we are once again hit by:
```
[error] (run-main-0) java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error] java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error]         at java.lang.ClassLoader.defineClass1(Native Method)
[error]         at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
[error]         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[error]         at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
[error]         at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
[error]         at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
[error]         at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
[error]         at java.security.AccessController.doPrivileged(Native Method)
[error]         at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
[error] Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.reporters.AbstractReporter
[error]         at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
```

which is similar to scalameta#195

I updated the version to 2.12.13 as was the case in the previous issue.
tgodzik added a commit to tgodzik/mdoc that referenced this issue Jan 15, 2021
It seems that we are once again hit by:
```
[error] (run-main-0) java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error] java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error]         at java.lang.ClassLoader.defineClass1(Native Method)
[error]         at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
[error]         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[error]         at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
[error]         at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
[error]         at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
[error]         at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
[error]         at java.security.AccessController.doPrivileged(Native Method)
[error]         at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
[error] Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.reporters.AbstractReporter
[error]         at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
```

which is similar to scalameta#195

I updated the version to 2.12.13 as was the case in the previous issue.
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

Successfully merging a pull request may close this issue.

2 participants