-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Input tasks require JSON readable and writable output #598
Comments
Not sure how easy it would be to remove the |
The workaround I'm currently using is def w[T] = writer[Unit].comap[T](_ => ())
def r[T] = reader[Unit].map[T](_ => ???)
def rw[T]: ReadWriter[T] = ReadWriter.join(r, w)
def task = T.input(...)(rw, implicitly[Ctx]) For two reasons
This second point could probably be expanded into a separate feature request except that the documented behavior of an input task already does pretty much what I want. |
Resolves #598. Input tasks results are re-evaluated every time and thus never read from the disk, and so a `upickle.default.Reader` is not required. Nevertheless, we still require that a `upickle.default.Writer` in order to generate the `*.json` files used for `./mill show` and other debugging purposes. Targeting #1600 to avoid merge conflicts Let's see what CI says... TBH not sure if this is worth doing, or whether we should just specify that `Input` tasks require a `ReadWriter` just to keep things consistent. We don't currently have any use case for de-serializing the input task JSON (e.g. even `mill show` takes the JSON from disk and spits it out verbatim without de-serializing) but that doesn't mean we won't find such use cases in future. But if such use cases do re-appear, we can always add that functionality back. `Command`s are write-only, so making `Input`s write-only would also not be unprecedented
…1601) Resolves com-lihaoyi#598. Input tasks results are re-evaluated every time and thus never read from the disk, and so a `upickle.default.Reader` is not required. Nevertheless, we still require that a `upickle.default.Writer` in order to generate the `*.json` files used for `./mill show` and other debugging purposes. Targeting com-lihaoyi#1600 to avoid merge conflicts Let's see what CI says... TBH not sure if this is worth doing, or whether we should just specify that `Input` tasks require a `ReadWriter` just to keep things consistent. We don't currently have any use case for de-serializing the input task JSON (e.g. even `mill show` takes the JSON from disk and spits it out verbatim without de-serializing) but that doesn't mean we won't find such use cases in future. But if such use cases do re-appear, we can always add that functionality back. `Command`s are write-only, so making `Input`s write-only would also not be unprecedented
I'm not sure what the intended behavior is, but the there's a little inconsistency between the documentation and the code for input tasks.
The task cheat sheet confirms that inputs do not need to be JSON readable or JSON writable, however
T.input
requires an implicit upickleReadWriter
for the result type.steps to reproduce:
Confirm the build does not compile due to
The text was updated successfully, but these errors were encountered: