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

Overriding part of a task definition causes the original task's env to be lost during merge #1111

Open
wmmc88 opened this issue Jul 11, 2024 · 1 comment
Assignees

Comments

@wmmc88
Copy link
Contributor

wmmc88 commented Jul 11, 2024

Describe The Bug

If a define a task in a makefile with an env scoped to the task, and then extend that task in another makefile, the env block gets lost.

To Reproduce

Makefile.toml:

extend = "./other.toml"

[tasks.my-task]

other.toml:

[tasks.my-task]
env = { A = "1", B = "2", C = "3" }
script = '''
#!@duckscript
echo A=${A} B=${B} C=${C}
'''

Error Stack

cargo make my-task
[cargo-make] INFO - cargo make 0.37.13
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: my-task
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: my-task
A= B= C=
[cargo-make] INFO - Build Done in 1.50 seconds.

When I comment out the "overidden" task definition in Makefile.toml, the output is correct:

cargo make my-task
[cargo-make] INFO - cargo make 0.37.13
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: my-task
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: my-task
A=1 B=2 C=3
[cargo-make] INFO - Build Done in 1.54 seconds.
@sagiegurari
Copy link
Owner

@wmmc88 i suspect it might be related to the fact i 'push' env vars to tasks like what makefile created them and their task name in the descriptor/mod.rs (if i remember correctly).
would you like to PR this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants