-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
needs: syntax error under v5.36 (indirect) #1543
Comments
Thanks for the report, it's a good find 👍 Since the currently established syntax of WorkaroundsKeep using the indirect featureThe general workaround is to add Simplify Rexfile (and add example to docs)Alternatively, in this specific example, it's possible to avoid the indirect syntax altogether, because
Since task task 'two', sub {
- needs main 'one';
+ needs 'one';
say 'hello from two';
}; We may want to add one more example to the docs about calling a single task like the above. Proposed fix outlineThe only proper fix I currently see is to introduce a new syntax for Unfortunately that would break all pre-existing Rex-based code which already uses the indirect form of For the new syntax itself, I would propose using the already well-established "fully qualified task names" ( use Rex -feature => ['no_indirect_needs'];
needs 'another_task'; # call task named `another_task`
needs 'Module:something_else'; # call task named `something_else` from `Module`
needs 'Module:'; # call all tasks from `Module` Related, but different bugAs an aside, there is a second bug in the provided example. Adding
I will open another bug about that. |
Describe the bug
Calling
needs
command with the indirect syntax described by its documentation fails with syntax error:Expected behavior
[2022-08-24 13:43:10] INFO - Running task one on
hello from one
[2022-08-24 13:43:11] INFO - All tasks successful on all hosts
Process finished with exit code 0
Success (as achievable with
use feature 'indirect';
)How to reproduce it
Call
needs
with indirect syntax.See the code example.
Code example
Additional context
#1542
#1538
Rex version
1.13.4
Perl version
5.36.0
Operating system running rex
Debian
Operating system managed by rex
FreeBSD
How rex was installed?
cpan client
The text was updated successfully, but these errors were encountered: