-
Enhancement
-
Resolution: Unresolved
-
P3
-
15
Currently we have two modes of executing a target in the build files: <target> and <target>-only. For instance, java.base-java executes first all the java.base-java dependencies, and then the actual java.base-java target. But java.base-java-only will skip the dependencies and only execute the actual target.
This functionality is good, but it would need expansion to support more use cases. And the method of invocation need to change, since we have a "target explosion" where all targets are automatically doubled, one in a "normal" and one in a "-only" version. Adding more variants of dependency selection using this method would make us regress into the problem of having too many targets for GNU Make to handle.
My proposal is to introduce a make control variable "DEPS", that will determine how and when dependencies and the actual target is executed. DEPS will take four possible values:
1) "full" -- the normal, and default, method: both the dependencies and the target are executed.
2) "none" -- no dependencies, only the target, is executed. Similar to today's "-only" targets.
3) "only" -- only the dependencies, but not the target, are executed. Useful for preparing the build for benchmarking just an actual target, etc.
4) "smart" -- a new method where make tries to avoid building and checking the dependencies, but at the price of not being able to fully guarantee a correct build. As an initial implementation, the smart mode will build the dependencies once, if they have never been built, but later on not rebuild (nor even check) them, but just build the target. That is, "DEPS=smart" will be equal to "DEPS=full" the first time, but "DEPS=none" the following.
To save on typing, the values for DEPS can be shortened as long as they match a valid prefix, so DEPS=n or DEPS=non would both mean DEPS=none. Further, setting an empty value ("DEPS=") -- which is the shortest possible form -- will be a short-hand for DEPS=smart, to make it as easy as possible for developers to chose this method.
DEPS=full will, of course, be the default. This will always guarantee a correct build.
This functionality is good, but it would need expansion to support more use cases. And the method of invocation need to change, since we have a "target explosion" where all targets are automatically doubled, one in a "normal" and one in a "-only" version. Adding more variants of dependency selection using this method would make us regress into the problem of having too many targets for GNU Make to handle.
My proposal is to introduce a make control variable "DEPS", that will determine how and when dependencies and the actual target is executed. DEPS will take four possible values:
1) "full" -- the normal, and default, method: both the dependencies and the target are executed.
2) "none" -- no dependencies, only the target, is executed. Similar to today's "-only" targets.
3) "only" -- only the dependencies, but not the target, are executed. Useful for preparing the build for benchmarking just an actual target, etc.
4) "smart" -- a new method where make tries to avoid building and checking the dependencies, but at the price of not being able to fully guarantee a correct build. As an initial implementation, the smart mode will build the dependencies once, if they have never been built, but later on not rebuild (nor even check) them, but just build the target. That is, "DEPS=smart" will be equal to "DEPS=full" the first time, but "DEPS=none" the following.
To save on typing, the values for DEPS can be shortened as long as they match a valid prefix, so DEPS=n or DEPS=non would both mean DEPS=none. Further, setting an empty value ("DEPS=") -- which is the shortest possible form -- will be a short-hand for DEPS=smart, to make it as easy as possible for developers to chose this method.
DEPS=full will, of course, be the default. This will always guarantee a correct build.
- is blocked by
-
JDK-8244757 Introduce SetupTarget in Main.gmk
-
- Resolved
-