-
Notifications
You must be signed in to change notification settings - Fork 47
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
dyndep support #48
base: master
Are you sure you want to change the base?
dyndep support #48
Conversation
Duncaen
commented
Apr 5, 2020
One big open issue is that it currently does not recompute the newly added dependencies when they are loaded after the dyndep node is done. I'm not really sure how to add this without maybe splitting out parts of the I'm also not sure if the log change to always add nodes is good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for working on this! This is an important feature for samurai to keep up with current ninja, and I'm not sure when I would've gotten around to implementing it.
My first impression after skimming these changes is that this looks great. I really appreciate you taking the care to match the existing style and design of samurai. I haven't read up on the details of dyndeps yet, so I'll do that and get back to you with a more thorough review.
dyndep.c
Outdated
} | ||
|
||
static void | ||
dyndepparse(struct node *n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should just take the file path directly.
Ok nice, I opened the PR early to get some initial feedback and to avoid duplicating work. I'm going to fix some outstanding issues:
|
This would either require to add error return values and a lot of ifs to the current scanner which makes everything more complicated. Current issues:
|
Hmm... yes, I see the problem. I think I'd like to make the scanner be able to report errors instead of using
Looks like these two are resolved now, is that right?
Do you know why it needs those subtools? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for factoring this into smaller changes. It makes it a lot easier to review.
But, could you expand on the commit descriptions a bit? Explaining the problems it solves, or how it will be used in future commit, etc.
In particular, I don't quite understand "build: edgedone: prune all output nodes if one is being pruned" and "log: create nodes if they don't exist so dyndeps can use logmtime".
The pruning stuff is probably the trickiest part of samurai, so I want to make sure we don't accidentally introduce any regressions.
@@ -146,6 +146,49 @@ computedirty(struct edge *e, struct node *newest) | |||
} | |||
} | |||
|
|||
void | |||
buildupdate(struct node *n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could reuse even more code here by passing input and output nodes as parameters to a helper function
@@ -106,6 +106,10 @@ queue(struct edge *e) | |||
{ | |||
struct edge **front = &work; | |||
|
|||
if (e->flags & FLAG_QUEUED) | |||
return; | |||
e->flags |= FLAG_QUEUED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why we would otherwise queue edges multiple times with dyndeps?
@@ -443,6 +443,8 @@ edgedone(struct edge *e) | |||
bool restat, prune, pruned; | |||
int64_t old; | |||
|
|||
/* mark edge clean for dyndepload */ | |||
e->flags &= ~FLAG_DIRTY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might break manifest rebuilds. We currently use the dirty flag to check if we actually needed to rebuild it (see #31).
|
||
/* all outputs are dirty if any are older than the newest input */ | ||
generator = edgevarbool(e, "generator"); | ||
restat = edgevarbool(e, "restat"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking, does ninja treat set-but-empty generator
and restat
as false?
@Duncaen & @michaelforney Any news on the status of this feature? |