-
Notifications
You must be signed in to change notification settings - Fork 121
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
Profile setting is lost when recursively calling cargo make #263
Comments
profile value is provided on command line and not as env, so that is why you are facing the issue. [tasks.build-native-flow]
workspace = false
category = "Build"
# Recursively call cargo make to go back to using workspace mode, thus running build-native
# for all non-excluded crates in the workspace
run_task = { name = "build-native", fork = true } this is both much simpler and shorter and also ensures that all original settings are preserved. as for workspace=true/false, by default i believe that when you want to run some tool (formatting/build/test/clippy/...) you want to run them on each member so that is why by default, when in a workspace, it is invoking the task on each member. |
Thanks for the solution! I thought I think the reason workspace=false by default makes sense to me is that it only applies to rust code, but the native rust tools already do this job for you quite well. That is to say, if I run Perhaps a more general "I would like these tasks to iterate over these sub-directories, which may also contain makefiles", would make sense? That doesn't couple so heavily with rust workspaces specifically, but still gives you that power when needed. Just some spitballing. Thanks again! |
Ah, another note, with
|
oh, that's a bug. i'll check that out. thanks as for the workspace=false, i opened issue #264 which will allow you to disable it globally via workspace level env block. that i think, should give you a very simple solution. |
@Sushisource the profile name bug should be fixed now in the 0.22.0 development branch. |
@sagiegurari Confirmed fixed. Thanks! |
thanks a lot for confirming. |
@Sushisource cargo make 0.22.0 has now been published with the profile fix. |
Using So is there a reason why profiles aren't passed down? Is this by design? |
Describe the bug
The profile setting is lost when recursively calling cargo make (ex: to go from workspace=false mode to workspace=true)
To Reproduce
This script repros the bug in a cargo workspace with at least two members
Output:
Thanks again! Sorry for the slew of bugs, but it's only because I'm finding your tool so useful!
As a related note, I think the way workspaces are handled in general is a ubit confusing and doesn't mesh well with the way cargo natively does things. In my makefile at least, almost everything is
workspace=false
. I would advocate for making that the default, honestly, or have an option to make it the default.Additionally, simply being able to force
workspace=true
into tasks that need it (unless overridden by the command line when directly calling the task) would make more sense to me than having to do this odd recursive calling trick.That said, it seems like cargo does pretty much everything you'd want by default without needing to go run things explicitly in each sub directory, hence why
workspace=false
seems like it ought to be the default to me.The text was updated successfully, but these errors were encountered: