-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Redesign AOT Processors #29266
Comments
@snicoll, @philwebb, & @wilkinsona, can one of you please create and implement an issue analogous to spring-projects/spring-boot#32560 so that I can remove the |
Preparatory work for this issue has been pushed in 61cc7c0. |
I'm not sure that there is such an analogy here. #29181 was about moving some functionality from Boot into Framework. spring-projects/spring-boot#32560 then adapted Boot to make use of that new Framework functionality. On the test side, there is no test-specific AOT processor in Boot and using Framework's |
What Andy said. I don't understand why the parity is required for this as it really isn't the same thing. It is required on the Spring Boot side of things because the concept of an application (and what it requires) isn't known to framework. There's no such thing for tests as it is already abstracted by the TCF. |
Thanks for the feedback. If there is no foreseeable need to extend the class, then I agree that it should not be abstract. I have changed the title of this issue to reflect that. However, I don't think it's a good idea for Framework to provide the In addition, I don't like the idea of maintaining a It may be that the Furthermore, build plugins can already instantiate In summary, I don't see any good reason to keep the |
Can you expand on what you mean by "very specific". Looking at the main method it takes exactly the arguments that
Isn't that the exact same problem with the current constructor?
Build plugins use a forked process to run AOT.
Except the fact that you may not want to have a |
So is the Boot build plugin actually invoking that Point taken, the |
Not directly. Boot's Maven and Gradle plugins both fork a JVM that is configured to use |
Alright, thanks for the clarification. I assumed that it is part of a larger orchestrated step where That said, even if this is not the case right now, potential pre- or post-processing for that execution step could emerge in the future, e.g. some kind of special parsing of the input (like the path parsing and splitting happening there already). A thin Boot-controlled entry point that parses the command line input (including the current path parsing for a start) does not seem wrong to me, as it separates that command line formatting concern. FWIW we had recent issues with |
If we believe that it's important for someone to be able to use Framework without Boot to perform AOT processing of their main code and tests, I don't understand why we'd factor out into Boot an important part of that particularly when we think it may be hard to get right. With |
I see your point but I'm just not sure that the plain presence of a main method with a particular format really makes things easy for outside users. It's another thing to document and understand, with custom executions having to get the command line format right. If we keep it for convenience, we'd have to properly document it for actual convenient usage for everyone, and we'd have to be willing to accept requests for enhancements around it. Custom main methods on the user's side are not that hard to get right. They can make assumptions about the input and its format, or could even hard-code a thing or two for their purposes, without relying on conventions for String input parsing that are meant to work for everyone everywhere in every encoding. I don't think that many such users would complain about this, after all they have to write a custom main method even to start the simplest of application contexts at this point. For better or for worse, I actually have rather strong feelings about this. If it is generally feasible that Boot could provide the command line entry point there, could we please try such an arrangement for a start? |
I'm sure it's feasible and we can give it a try. Before we do that, if we're going to go down the route of having code in Boot that calls |
That is a compelling argument for not having a I've tried initially to reuse |
There's a lot of overlap (duplication) between the two at the moment. I think we should:
|
Sounds good to me. I also like the name |
I'm also open to other prefixes. The rationale for that proposal was based on the modules in which the processors reside.
Plus the one from Another naming convention could be based on the context in which the processors are used: Thoughts? |
@snicoll & @wilkinsona, shall I put together a proposal and push it to a branch for review? |
Yes please, @sbrannen. |
The redesign proposal can be viewed here: https://github.com/sbrannen/spring-framework/commits/issues/gh-29266-AotProcessor-restructuring @wilkinsona, @snicoll, and @jhoeller, please provide feedback as soon as possible so that we can make changes before the RC1 release. |
LGTM, thanks. |
There's currently a considerable amount of overlap between the implementations of AotProcessor and TestAotProcessor. In addition AotProcessor is abstract and does not include a main() method; whereas, TestAotProcessor is concrete and does include a main() method. To address these issues, this commit: - Introduces an AbstractAotProcessor base class that AotProcessor and TestAotProcessor now both extend - Moves common properties/functionality to AbstractAotProcessor - Renames AotProcessor to ContextAotProcessor - Makes TestAotProcessor abstract like ContextAotProcessor - Removes the main() method from TestAotProcessor Closes spring-projectsgh-29266
As discussed with @wilkinsona, I pushed changes to address the "container" idea for common settings. We went with a mutable If we want to introduce a Builder API instead, we can revisit this. |
Overview
To align with the implementation of
AotProcessor
, we should remove themain()
method inTestAotProcessor
and allow Spring Boot to provide its ownmain()
that usesTestAotProcessor
.Related Issues
The text was updated successfully, but these errors were encountered: