Open verdverm opened 2 years ago
@verdverm This is what the Config.InferTasks
feature is for. Granted, dependency analysis is really hard for this when simultaneously not trying to evaluate an entire configuration. So at the moment the implementation is a bit feeble. The intent is to evaluate the entire configuration and/or have a quick mechanism for identifying tasks.
Can you point out to what extent this feature is not working for you?
Can you point out to what extent this feature is not working for you?
err1,err2
) are intended to work and reading the entire config should fix this, and is on the long list of todos?err1,err2
cases do not currently work. I use ok1,ok2
to work around this, though it is not a preferred UX to pass on to users and the patterns are a bit viral (cascading).Note, I am using the Config.InferTask
in my custom flow, which improved something worse to the above, which was repro'd using cue cmd
for easier inclusion into tests here.
Is your feature request related to a problem? Please describe.
To make tasks sharable, they can be put into regular cue files, with care, by setting
$id
and other fields as needed. (see included txtar)However,
cue cmd
will not discover or run them (cue cmd err1
). Task references do work for tasks outside of the command to be run, where the referenced value is in the same package (cue cmd bar
). One can make cross-package references work by creating a package local reference to the imported task (cue cmd [ok1,ok2]
). However this also fails if the imported value references another task within its own package (cue cmd err2
)Can task discovery and dependency resolution be changed such that the cross-package references work without the local references?
Repro
Output