-
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
Selectively skipping task #538
Comments
why not add condition for rsut stable + beta for that specific task instead? |
Because "it depends". When I'm running on a nightly toolchain on my local machine, I do want to have the Regardless of the |
i'll ask few more questions about conditions, but i am not sure it doesn't solve the general issue and i'll use your rustfmt example. [tasks.rustfmt-conditional]
run_task = [
{ name = "rustfmt", condition = { channels = ["stable", "beta"] } },
{ name = "rustfmt", condition = { env_false = ["CARGO_MAKE_CI"] } },
] this is kinda of doing an OR between conditions (currently condition is AND for all) so this is a wrapper above that. another way to make a simple condition like: [env]
run_fmt = true
run_clippy = true
[env.notooling]
run_fmt = false
run_clippy = false
[tasks.fmt]
condition = { env_true = ["run_fmt"] }
# .... having skip globally could be very tricky to understand. |
I understand the alternatives but they suffer from a common downside, the all require modification of the flow in advance, or at minimum duplicate an existing task just to add a condition to it. If one is using canned flows (e.g. from cargo make itself), then this isn't convenient and also will prevent the modified (duplicated) task from benefiting from future bug fixes or improvements in the original canned flow. Edit: Is there a way to say in my As for semantics in edge cases (recursive |
you can redefine the task in your makefile and just add the condition. the rest will be taken from the core makefile. [tasks.mytask]
condition = { env_true = ["abc"] } so in this case, if mytask is defined in a core makefile (or any extended makefile), the rest of the attributes are taken from there, and only the condition is added on top.
got it. i'll check it out later this week and think about it. |
Good to know about being able to add a condition in this way - that provides a workaround, though IMVHO being able to simply |
@orenbenkiki this is now available in the 0.32.16 dev branch. tell me if it works well for you. |
Wow, that was fast. Yes, this seems to work well. I note that one can't repeat Thanks! |
ya, will add a bit more to the cli doc. |
released :) |
Feature Description
Allow
cargo make some-goal --skip some-task
to skip a specific namedsome-task
while buildingsome-goal
. Allow--skip
to be repeated.Ideally,
--skip
would accept a pattern rather than an exact name. For simplicity, specifying it takes a substring of the skipped task would be sufficient (similar to howcargo test
works).This is a natural extension of
--skip-init-end-tasks
, which would be equivalent to writing--skip 'pre-*' --skip 'post-*'
(or--skip pre- --skip post-
if--skip
takes a simple substring of the skipped goals).The specific reason I'd like this is to disable the
rustfmt
related tasks while building innightly
, without having to duplicate all the high-level flows.The text was updated successfully, but these errors were encountered: