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

Skip dependencies #1314

Closed
a1russell opened this issue Aug 19, 2022 · 8 comments
Closed

Skip dependencies #1314

a1russell opened this issue Aug 19, 2022 · 8 comments

Comments

@a1russell
Copy link

Oftentimes when I'm writing a new recipe, I'd like to re-run that task, and only that task. I don't want the dependencies to run because they might take a long time, and I know they're up-to-date.

Another way to say this is: I'd like a way to run the recipes specified explicitly given on the command line, without any dependencies. One example I can find of this feature is Fake's --single-target parameter.

I'm aware of several workarounds for this, but it would be very nice to have this feature baked in. To list a few of the workarounds, so that I might illustrate why I would like this feature:

  1. Write the dependencies with something like entr so that they don't unnecessarily re-run, as suggested in Tracking Incremental Changes (Avoid re-running builds) #424. This requires me to focus on having very robust dependencies before focusing on the task that I'm actually trying to work on. Sometimes I'd rather write the whole tree quickly and then go back and add such niceties.
  2. Split each of my recipes into two. One which is my recipe, containing no dependencies. The second recipe includes the dependencies and includes the first recipe as the final dependency. This makes the justfile much less readable, though. Not great to maintain.
  3. Comment out the dependencies as I'm developing the task. This works until I forget to uncomment them when I'm done.
@casey
Copy link
Owner

casey commented Aug 19, 2022

This seems useful, and also very easy to implement. As far as the name of the flag goes, --no-deps or --only could be good.

@a1russell a1russell changed the title Skip dependencies [enhancement] Skip dependencies Aug 19, 2022
@a1russell
Copy link
Author

Thank you for the reply @casey. If I were to create a PR for this, you would be willing to consider it, then?

@casey
Copy link
Owner

casey commented Aug 19, 2022

Oh yeah, definitely. Check out the tests in tests/. The easiest thing to do is add some tests, and then open a draft PR to get feedback on the functionality before you actually implement it. I think the main cases to test are:

  • Normal dependency doesn't run when you pass --flag
  • Prior depdencies (bar in foo: && bar doesn't run when you pass --flag)

@casey
Copy link
Owner

casey commented Aug 19, 2022

Feel free to ping me if you have any issues!

@a1russell
Copy link
Author

Thank you @casey. Since I didn't get to start on this immediately, I thought I'd give an update. I might be a bit slow, as I don't have a lot of free time, but I'll definitely get around to this! 😄

@casey
Copy link
Owner

casey commented Sep 1, 2022

@a1russell No worries at all!

sousajo-cc added a commit to sousajo-cc/just that referenced this issue Oct 21, 2022
using this flag one can just re-run only that task
specified in the cmd line.

Closes: casey#1314
sousajo-cc added a commit to sousajo-cc/just that referenced this issue Oct 21, 2022
using this flag one can just re-run only that task
specified in the cmd line.

Closes: casey#1314
@nogweii
Copy link

nogweii commented Feb 23, 2024

I believe this can be closed now that #1819 was merged. 😄

@a1russell
Copy link
Author

Yep, I feel bad I never got around to this. Life got in the way. Thanks @ngharrington!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants