Skip to content

Exit code of scaladoc is 0 even when it fails with errors #18279

Open
@lwronski

Description

@lwronski

Compiler version

3.3.2-RC1-bin-20230715-4851278-NIGHTLY

Minimized code

//> using option -release:8

object Foo {
    @Deprecated
    def foo(): Unit = ???
}

Output

$  cat repro.scala 
//> using option -release:8

object Foo {
    @Deprecated
    def foo(): Unit = ???
}
$ scala-cli compile repro.scala --print-class-path --jvm 17
Compiling project (Scala 3.3.0, JVM)
Compiled project (Scala 3.3.0, JVM)
/Users/lwronski/scala-demo/.scala-build/scala-demo_b1e873a624-8194c29cd5/classes/main:/Users/lwronski/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.0/scala3-library_3-3.3.0.jar:/Users/lwronski/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.10/scala-library-2.13.10.jar
$ cs launch scaladoc:3.3.2-RC1-bin-20230715-4851278-NIGHTLY -M dotty.tools.scaladoc.Main --  /Users/lwronski/scala-demo/.scala-build/scala-demo_b1e873a624-8194c29cd5/classes/main
Destination is not provided, please provide '-d' parameter pointing to directory where docs should be created
-- Error: repro.scala:4:4 ------------------------------------------------------
4 |    @Deprecated
  |    ^^^^^^^^^^^
  |wrong number of arguments at <no phase> for (since: String, forRemoval: Boolean): Deprecated: (Deprecated#<init> : (since: String, forRemoval: Boolean): Deprecated), expected: 2, found: 0
1 error found
$ echo $?
0

To reproduce this issue, classes generated by scala-cli should to be passed to scaladoc. These can be obtained from the first part of the classpath, printed using the --print-class-path option. In my case, the path is /Users/lwronski/scala-demo/.scala-build/scala-demo_b1e873a624-8194c29cd5/classes/main.

Expectation

The scaladoc should fail with exit code 1 instead of 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions