Skip to content

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

Open
@wmmc88

Description

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.

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions