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

Remove the ability for T.inputs and T.sources to take input tasks #2488

Closed
wants to merge 2 commits into from

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented May 1, 2023

T.sources or T.input taking task inputs used to be necessary to allow them to be overriden and extended, e.g.

override def sources = T.sources{super.sources() ++ Seq(PathRef(...))}

However that workflow is no longer necessary since #2402 landed, since now you can do:

override def sources = T{super.sources() ++ Seq(PathRef(...))}

Which is generally more correct, since the current task is no longer a "source" input to the Mill build graph, but rather an intermediate target like any other.

The fact that T.inputs and T.sources can themselves take input tasks isn't very intuitive, since most people do not imagine that build graph tasks can both be inputs as intermediate targets at the same time. Since it is now no longer necessary, better to prohibit it unless there's a strong reason not to, to simplify the data/execution model and reduce the unnecessarily different ways of implementing the same build

Tested via compileError assertions in MacroErrorTests.scala

@lihaoyi lihaoyi closed this May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant