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

Documentation generation failed #3230

Open
pcotret opened this issue Jan 18, 2023 · 2 comments · May be fixed by #3313
Open

Documentation generation failed #3230

pcotret opened this issue Jan 18, 2023 · 2 comments · May be fixed by #3313

Comments

@pcotret
Copy link

pcotret commented Jan 18, 2023

Type of issue: bug report

Impact: unknown

If the current behavior is a bug, please provide the steps to reproduce the problem:

git clone https://github.com/chipsalliance/rocket-chip
cd rocket-chip
git submodule update --init
sbt

In the SBT prompt:

sbt:rocketchip> docs/mdoc

Got following errors:

[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] running mdoc.Main --cwd docs
[error] (run-main-0) java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error] java.lang.NoClassDefFoundError: scala/tools/nsc/reporters/AbstractReporter
[error]         at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[error]         at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
[error]         at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
[error] 	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
[error] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
[error] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
[error] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
[error] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
[error] 	at sbt.internal.ManagedClassLoader.findClass(ManagedClassLoader.java:98)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[error] 	at mdoc.internal.markdown.MarkdownBuilder$.fromClasspath(MarkdownBuilder.scala:92)
[error] 	at mdoc.internal.cli.Context$.fromOptions(Context.scala:33)
[error] 	at mdoc.internal.cli.Settings.validate(Settings.scala:231)
[error] Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.reporters.AbstractReporter
[error] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[error] 	at sbt.internal.ManagedClassLoader.findClass(ManagedClassLoader.java:98)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[error] 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[error] 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
[error] 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
[error] 	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
[error] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
[error] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
[error] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
[error] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
[error] 	at sbt.internal.ManagedClassLoader.findClass(ManagedClassLoader.java:98)
[error] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[error] Nonzero exit code: 1
[error] (docs / Compile / runMain) Nonzero exit code: 1
[error] Total time: 3 s, completed Jan 18, 2023, 10:59:44 AM
sbt:rocketchip> show discoveredMainClasses
[info] * freechips.rocketchip.groundtest.Generator
[info] * freechips.rocketchip.system.Generator
[info] * freechips.rocketchip.unittest.Generator

Please tell us about your environment:

  • rocket-chip master branch
$ sbt --script-version
1.8.2
$ scala -version
Scala code runner version 3.2.2 -- Copyright 2002-2023, LAMP/EPFL
@pcotret
Copy link
Author

pcotret commented Jan 18, 2023

Made another try, my sbt/scala setup was a bit inaccurate (still sbt 1.8.2 and scala 3.2.2).
Anyway, docs/mdoc still fails:

info: Compiling 5 files to ~/rocket-chip/docs/generated
error: ~/rocket-chip/docs/src/diplomacy/adder_tutorial.md:298:10: value io is not a member of freechips.rocketchip.diplomacy.LazyModuleImp
    when(monitor.module.io.error) {
         ^^^^^^^^^^^^^^^^^
info: Compiled in 2.92s (1 error)

Exception: sbt.TrapExitSecurityException thrown from the UncaughtExceptionHandler in thread "run-main-0"
[error] Nonzero exit code: 1
[error] (docs / Compile / runMain) Nonzero exit code: 1
[error] Total time: 102 s (01:42), completed Jan 18, 2023, 2:00:57 PM

Is there a pre-generated documentation somewhere? (I'll read the source code in the meantime 😉 )

@michael-etzkorn
Copy link
Contributor

If you change that code block (and the two that follow) to scala mdoc:fail, you'll be able to compile ok, but the scala mdoc is bugged since monitor is being typed up to the parent class.

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

Successfully merging a pull request may close this issue.

2 participants