-
Notifications
You must be signed in to change notification settings - Fork 12
Artifact cleanup logic #22
Comments
Currently, jenga never removes directories, nothing to do with version control logic (I don't understand what this means!) |
Sorry bad guess then. I thought you were deferring to hg to remove stale artifacts, and that hg ignores empty folders. |
Ah, now I understand what you meant by "version control logic". Yes, hg Also, if jenga has rules which create artifacts in a directory without On 17 May 2016 at 07:29, Cheng Lou notifications@github.com wrote:
Nick Chapman nic@amadido.co.uk |
Why is it that when there is an output directory, and a separate (different) source directory, that globing the source directory will not detect that a source has been removed, and therefore its old artifact in the separate build directory should be removed? (If I understand correctly, this is what Cheng said is happening). I would imagine it should work like this:
But if I understand correctly, it does not work like that. Is there a reason? |
It doesn't work like that because the build is the other way around. You don't try to build everything you know how to build which might be out-of-date, only those things which your build target depends on. Globbing the I suspect one issue is that you are thinking of stale artefact deletion as a mechanism similar to (As a side-note, the tracking of artefacts should not depend on tracking "that artifact |
I should make clear that I'm not saying the way Jenga currently handles stale artefacts is correct (the need to glob the output directory is still clearly a hack), I was just explaining why it doesn't work as you were suggesting. |
Okay. And yes, the case that you described is exactly the one that we ran into (I was merely simplifying the problem in this thread for sake of discussion). So how should It seems that Jenga should allow us to express (or infer when possible) that files are generated as a result of running rules on other files (that were the result of a glob). Is version control the ideal way to deal with this (what would that even look like), or should Jenga understand this natively? |
Well I think the basic idea of Jenga's approach is correct: when your build depends on The only weird bit is that it also removes some stale files when they are not depended on, so globing on For those things which rely on this weird behaviour (e.g.
I don't follow what you mean here. But assuming it was related to my side-note, I should try to clarify what I meant. The build rules (i.e. "file So when you said that Jenga should observe that "_build/a.cmo was generated from input file src/a.ml" I merely wanted to draw your attention to the subtle distinction between that and "_build/a.cmo is not a source file and there is a rule to create _build/a.cmo from input file src/a.ml". The two pieces of information are very similar, but it is important that Jenga bases its decisions on the second one not the first. |
This has been discussed in chat so I'll summarize here. Correct me if anything's wrong here.
The current way Jenga handles artifacts makes it so that if they're not colocated with the source, I have to pass the
artifacts
callback toEnv
and indicate which files can be considered as artifact. The cleaning itself is delayed, aka only happens when, say, aglob_listing
is called on the artifact directory. When the artifacts are alongside the source, this hasn't been a problem since globbing on the source directory will clean the artifacts anyway.Another problem is that empty, stale folders aren't cleaned
(I guess because of version control logic?). This would be troublesome if one doessubdirs
on a stale artifact directory. Fortunately I don't do that, but still.The text was updated successfully, but these errors were encountered: