-
Notifications
You must be signed in to change notification settings - Fork 451
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
Add ability to add new dependency without clobbering rule #2270
Comments
Could you do something like this instead: lint-foo:
base-lints: lint-foo import 'foo.just'
lint: base-lints You can then call |
@casey Thanks for considering this, but I don't see how that helps. Maybe my initial example was too simplified, but I have multiple modules that I hope could add additional recopies as dependents to What happens if I have both modules |
Why not specifying the dependencies in the main justfile? -
with
and
|
Because I want to be able to manage the module files separately from the projects that use them and add and remove recipes in the modules without having to manually adjust all the projects that use them. Testing is also a lot simpler if I can enable/disable modules by commenting/uncommenting just the import line without having to hand edit every recipe dependency line. It doesn't seem like a burden in the MWE we're discussing here but I'm not looking at single additions, each module would add a small handful of recipes that would all need to be added to respective parents. |
I see the use case, but I think that allowing duplicate recipes but retaining both and running both when the recipe is run probably breaks too many assumptions. I think adding a way to run all recipes in a group is probably the way to go, although, I do hesitate there, because it would substantially duplicate the current way to run a bunch of recipes from the command line is to make a recipe which depends on them, and run that recipe. |
And for my part I can see your point and I don't want to push Before this gets written off as "won't implement" however, I'd like to throw this out: even
That's not what I'm suggesting here. And seriously even Make doesn't allow duplicate recipes while retaining both. I wish it did, I have several use cases for that but it just doesn't work that way. What I am suggesting is much more limited: only allowing append-only updates to the dependency list. NOT THIS: a: b
echo stuff
a: c
echo other stuff Only this: a: b
echo stuff
a: c This doesn't update the recipe for One way this could possible be implemented is with variables: deps := b
deps := deps + " c"
a: {{deps}}
echo stuff Obviously there would be some issues to think about with string concatenation (an array type would be cool here). |
I've been following
just
development for years (and package it for Arch Linux) but I have been so deeply invested in GNU Make/Autotools that I haven't actually started using it. I just made an attempt to port some of the.PHONY
rules from one of my projects that are more task that build oriented, but ran up against an issue. One of the things I was hoping to do is keep the whole setup modular enough that I could reuse bits across projects using includes. I already do this with Make both with by own macros and the autoconf archive. This doesn't seem to be possible with Just yet.It's easy to setup a module and include it, and of course the new rules become available, but it doesn't seem possible to append new dependencies to existing tasks this way. Extrapolating from how I would do this with
make
, I expected something like this to work:Module file
foo.just
:Main
Justfile
:This doesn't work. Even with
set allow-duplicate-recipes
this just clobbers the recipe instead of adding a new dependency to it likemake
would do.I considered adding all "lint"ish recipes to a group, but that only seems to help with listing them with
just --list
, it does not provide a way to execute all results from a group at once.The text was updated successfully, but these errors were encountered: