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

Using Def.derive with configuration-scoped tasks can break task aggregation #3580

Open
smarter opened this issue Sep 25, 2017 · 2 comments
Open
Labels

Comments

@smarter
Copy link
Contributor

smarter commented Sep 25, 2017

Consider the following build.sbt (git repo: https://github.com/smarter/sbt-derive-bug):

val foo = taskKey[Unit]("")
val bar = taskKey[Unit]("")

lazy val a = (project in file("a")).
  settings(
    foo in Compile := {
      println("foo in a")
    }
    //,
    // Def.derive(bar := {
    //   val _ = foo.value
    // })
  )

lazy val root = (project in file(".")).
  aggregate(a).
  settings(
    foo in Compile := {
      println("foo in root")
    }
  )

foo is aggregated in root, as expected:

> root/foo
foo in root
foo in a

But now, if we uncomment the commented lines above, we get:

> root/foo
foo in root

This happens with both sbt 0.13 and 1.0. This does not happen if we use bar in Compile := ... instead of Def.derive, or if we replace all foo in Compile by foo.
This makes sbt-dotty unusable with aggregated projects without manually disabling the IDE plugin: scala/scala3#3172

@smarter
Copy link
Contributor Author

smarter commented Sep 26, 2017

This makes sbt-dotty unusable with aggregated projects without manually disabling the IDE plugin: scala/scala3#3172

Worked around by not using Def.derive: scala/scala3#3178

@dwijnand dwijnand added the Bug label Sep 26, 2017
ennru pushed a commit to ennru/dotty that referenced this issue Sep 27, 2017
@eed3si9n eed3si9n added the uncategorized Used for Waffle integration label Sep 18, 2018
@eed3si9n eed3si9n added backlog and removed uncategorized Used for Waffle integration x/waffle labels Nov 8, 2018
@eed3si9n eed3si9n removed the backlog label Sep 10, 2019
@jvican
Copy link
Member

jvican commented Oct 29, 2019

I am not able to reproduce this behavior with sbt +1.3.0. It looks like this issue was fixed in some commit between 1.2.8 and 1.3.0.

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

No branches or pull requests

4 participants