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

New Flag: -nodeps: skip target dependencies when executing target #251

Closed
wants to merge 2 commits into from

Conversation

nlowe
Copy link

@nlowe nlowe commented Jun 23, 2019

When you run mage with '-nodeps', mage will skip any Deps/SerialDeps
in the target being executed. This is useful when you want to run a
single target or need to run targets with dependencies locally but
without dependencies in CI for timing / visibility reasons.

Fixes #250

When you run mage with '-nodeps', mage will skip any Deps/SerialDeps
in the target being executed. This is useful when you want to run a
single target or need to run targets with dependencies locally but
without dependencies in CI for timing / visibility reasons.
@nlowe
Copy link
Author

nlowe commented Jun 23, 2019

Hmm, I'm not sure what that failure is on travis for Go: tip. I can't repro locally with 1.12 I get different failures on windows, but I can repro this with a 1.12 docker container. I'm going to open a new issue for this. Did go modules get flipped on by default?

#241 is also failing with the same error, I'm guessing this is unrelated to the changes in either PR.

@nlowe
Copy link
Author

nlowe commented Jun 23, 2019

Ah, we're hitting #224.

@natefinch
Copy link
Member

There's a lot of ways to do this if you really want to, but I don't think it's a good idea to add a new flag for it, since it should be rare.

You can either make the meat of the code a separate function and have one target with the deps and one without, or you can check an environment variable like this:

if os.Getenv("NODEPS") != "1" {
    mg.Deps(SomeDep)
}

But I don't feel like this is a common enough need to implement and maintain separately, especially since it's pretty easy to do yourself.

@nlowe nlowe closed this Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "Exclusive" Mode to execute a task without dependencies
2 participants