-
Notifications
You must be signed in to change notification settings - Fork 14
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
task semantics
rebuild behavior
#229
Comments
Suggestion for task name In my opinion bob should act this way: Whenever bob can't verify it input or target is changed it should build. Probably this would result in default
We could also take dependencies into account.
|
I think we should try to mimic the make behavior "PHONY" tasks of rebuilding as often as possible. For tasks that can not be cached I suggest we add that information to the console summary at the end of bob build. That helps the user to identify possible optimizations. Besides taking the presence of input and target into account I want to make explicit that the absence of the target file or no files in the target folder qualifies as reason to rebuild. I suggest to following behavior:
About 5 and 7: I argue that if you don't know if the target is still present or if it was deleted or changed then you should always rebuild. In the current implementation failures are hard to debug. Bob says "cached" which is not true since if bob was asked to show the "cached" files it would have no answer. IF it was to stay the current way, bob should at least change the information in the summary to something like "not-rebuild". Further, a call of |
Bob is a simpler Bazel alternative for multi-language projects of any size. With that in mind let's go one step back and bring this down to the physics to answer the following questions.
AnalysisWe have to deal with three kind of tasks:
A (Verify/Analyze a Codebase)Impacted Scenarios: 4) 5)
B (Alter a Codebase)Impacted Scenarios: 1) 4) 5) The case of fmt and lintFor something like
Defining those kind of targets is tedious and maybe even unnecessary as those are changes which are best transported through a repository/git and NOT through an shared artifact cache. The case of
|
task semantics
rebuild behaviour task semantics
rebuild behavior
I have some comments that we already discussed: About case 3/4/5: Regard There is already an old issue (#73) with this topic which needs refinement since it was before the introduction of |
I agree with the above suggestion by @Equanox and the additional comment from @dketterer; cases where the user would get 'error: no input specified' should not return the mentioned error if the rebuild: always flag is set. The tasks mentioned in case (6) are called "compound tasks" (per vscode & intellij's docs, for example) and I agree in that they should always just be a way to group tasks together. Regarding the discussion we had today offline, I think we do not have to introduce a new task type, but just consider tasks with rebuild: always and their dependents as simple run tasks. Caching and incremental builds should be turned off for these and their dependents, and users will not have to resort to separate makefiles etc. if we treat them that way. This solution can also be quite robust, as a part of the DAG can use the incremental build system and the rest can just exist as a task runner. The run tasks we currently have were also modeled with this behavior, albeit with little integration with the actual build system part. Additionally, for tasks with inputs and no targets, we should consider capturing stdout/stderr of them and storing that text as target. I'm thinking of a lint step where you ideally don't want to execute it multiple times for the same filetree, but in case of errors during lint you want these to continue showing up. |
@rdnt stumbled upon another, not yet, well defined case. The question is: AnalysisIn case of a repository internal source (depends on files inside the repository) the task output should not be declared as a target, cause the output can always be regenerated and therefore must not be transported through an artifact.
In case of a external source with a output written to the repository and no source files in the repository (like a package.json for npm install) the output should either be stored inside the repository (vendoring) or always being downloaded using
In both cases I'd be careful adding such a task to a build-graph as it forces a rebuild of all parent tasks. DiscussionFrom a functionality point of view a target should not be set when BUTOne reason for ConclusionPrinting a warning in that case seems to be the most user friendly approach for now. AppendixInternally I'd like to keep the |
The current behavior of input/target combination feels a bit odd, which could lead to suprises for new users.
Current Implementation
Changing the default value for input to be
*
Taking target into account
*
cmd:
are not allowed to havetarget:
orinput:
definedAppendix
Case 3) could be detected by a
bob verifytaskintegrity
(please use a better command name) which would build tasks one by one and track filesystem & docker registry changes. At the end it prints some target suggestion for specific tasks. This could also be helpful when migrating from other build systems or adding docker builds. In that cases targets usually are hidden deep down in the build instruction (e.g. Dockerfile)The text was updated successfully, but these errors were encountered: