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

Possible bug when passing variadic parameter variables to recipe dependencies #2354

Closed
marcaddeo opened this issue Sep 8, 2024 · 2 comments

Comments

@marcaddeo
Copy link
Contributor

In #2342 there was discussion of an alternative use-case for aliases where aliases were being used as the "main" descriptive name for the recipe and the recipe name was meant for internal use. Looking through the reasoning in #1725 and the discussion in #1302, it seems to me this use-case appeared due to a possible bug?

set positional-arguments

main-recipe *FLAGS:
  echo "$1"
  echo "$2"
  echo "$3"

r *FLAGS: (main-recipe FLAGS)

test1: (main-recipe '123' '456' '789')
test2: (r '123' '456' '789')

Given this Justfile, test1 will give the expected results while test2 will throw an error because FLAGS is parsed as a variable and evaluated to a single string 123 456 789 which cases only the $1 positional argument to be set.

Is this a desirable/intended behavior? Or should dependency arguments that are variables for a variadic parameter get split back into individual strings before getting passed to the dependent recipe?

@laniakea64
Copy link
Contributor

laniakea64 commented Sep 8, 2024

It's working as intended. The current proposed solution for this use case is #1988 (comment)

@casey
Copy link
Owner

casey commented Sep 9, 2024

Yah, unfortunately this is working badly as intended. Variadic arguments are immediately space-joined, which is why they exhibit this behavior.

@casey casey closed this as completed Sep 9, 2024
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

No branches or pull requests

3 participants