Skip to content

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

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

Open
lwronski opened this issue Jul 24, 2023 · 1 comment
Open

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

lwronski opened this issue Jul 24, 2023 · 1 comment

Comments

@lwronski
Copy link
Contributor

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

@WojciechMazur
Copy link
Contributor

The reproducer shall change when #18231 is fixed

@WojciechMazur WojciechMazur added area:doctool and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants