Closed matta closed 1 month ago
@matta sorry for late reply. this is hard to act on as i'm missing some info but i think you are confusing how things work in workspaces. in workspaces, each make doesn't 'see' the workspace level makefile so whatever you configured there is lost and actually they are invoking the core built in format task
so add: CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true to your makefile in the workspace level
see more here https://github.com/sagiegurari/cargo-make?tab=readme-ov-file#automatically-extend-workspace-makefile
also got a hunch you are not aware you get dozens of built in tasks unless you skip core tasks https://github.com/sagiegurari/cargo-make?tab=readme-ov-file#disabling-predefined-tasksflows
tell me if that 1 liner solve it for you
closing due to lack of feedback
Describe The Bug
A task's
toolchain = "nightly"
option doesn't seem to take effect in the child tasks executed in each package of a virtual workspace repo.In my git repo I have the following in a
Makefile.toml
at the root:I also have a
rustfmt.toml
in the root that sets some rustfmt options available only in nightly:With the above, in a non-workspace repo,
cargo-make
runs "cargo fmt --all" using the nightly toolchain, as expected.With the above, in a virtual workspace repo,
cargo-make
appears to run the same command in each package in the workspace but not with the nightly toolchain. I would expect it to use the nightly toolchain.The fix in this specific case is to set
workspace = false
for[tasks.format]
, sincefmt
has its own workspace traversal logic anyway (which I enable by passing it the--all
flag).I'm filing this despite that available workaround. It seems useful to have the
toolchain = "nightly"
option propagate to the child tasks executed in each package of a virtual workspace repo.To Reproduce
The above sets up a small repo that exhibits the bug (at a revision before I found the workaround I describe above).
Now run
cargo make format
.The output is:
The visible warnings make it clear that the exec of each "cargo fmt" command is not being done with the nightly channel.