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

sbt stage fails when sbt compile succeeds #1364

Closed
arjundhawan-tomtom opened this issue Aug 28, 2020 · 3 comments
Closed

sbt stage fails when sbt compile succeeds #1364

arjundhawan-tomtom opened this issue Aug 28, 2020 · 3 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@arjundhawan-tomtom
Copy link

arjundhawan-tomtom commented Aug 28, 2020

Expected behaviour

sbt stage should successfully compile a project (involving macros), whenever sbt compile successfully compiles a project.

Actual behaviour

sbt stage fails on compilation, whereas sbt compile succeeds. The problem seems to lie with macros, in particular the zio.macros.accessible annotation (https://zio.dev/docs/howto/howto_macros#description).

I have annotated an object like so:

@accessible
object Foo {

Which is generating the function in the object Foo: Foo.functionA.
When running sbt stage, compilation fails however with error:

[error] /***/Main.scala:54:30: value functionA is not a member of object foo.Foo
[error]   val program = Foo.functionA

Note that sbt compile, or sbt assembly (using the sbt-assembly plugin) work fine.

Information

  • What sbt-native-packager are you using: 1.7.4, 1.7.5
  • What sbt version: 1.3.10, 1.3.13
  • scala version: 2.13.3
  • What is your build system: Ubuntu 18.04.5 LTS
  • What package are you building: JavaServerAppPackaging
@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Aug 31, 2020
@muuki88
Copy link
Contributor

muuki88 commented Aug 31, 2020

Hi @arjundhawan-tomtom

Thanks for the detailed description.

This sounds very odd to me. My first intuition this is an issue with the scala docs generation, because

  • it is triggered during stage IIRC
  • it is not triggered during compile or assembly
  • it is a separate scalac instance with different settings

Can you try turning off docs generation? I think this may work

Compile / doc / sources := Seq.empty

Source: https://www.playframework.com/documentation/2.8.x/sbtCookbook

@arjundhawan-tomtom
Copy link
Author

@muuki88 wow, great intuition! Indeed it scaladoc is the culprit here. The issue seems to be a 7 years (!) old bug: https://stackoverflow.com/questions/42684101/scaladoc-generation-fails-when-referencing-methods-generated-by-annotation-macro
Sorry for the inconvenience, issue closed.

@muuki88
Copy link
Contributor

muuki88 commented Sep 3, 2020

This is a bug in Scala, still present in 2.13.

Oh boy 😂 This will never end

Sorry for the inconvenience, issue closed.

No worries 😘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants