RFR 8054715: Changing the source roots and/or their filters forces a full recompile.
Andreas Lundblad
andreas.lundblad at oracle.com
Tue Aug 19 06:58:41 UTC 2014
On Fri, Aug 08, 2014 at 11:16:14PM +0200, Fredrik Öhrström wrote:
> Changing the source roots and/or their filters forces a full recompile,
> since the source roots and the filters are included in the command line
> memory in the javac_state file.
>
> This is a bug, since all changes to the set of source files should be
> gracefully handled incrementally.
>
> SJavac should do an incremental compile both when:
> beta/B.java is deleted from the file system (this works)
> or when
> "-x beta" is added to the command line to exclude beta/B.java from
> compilation (this does not work).
>
> Simple fix, do not include the filters and the source roots in the memory
> line in the javac_state file.
So you say it works if beta/B.java is in fact deleted, but doesn't work if "-x beta" is added. Ideally "-x beta" should hide beta and the effect should be the same as if beta/B.java was removed from the file system, no? If we solve this by changing what we save in javac_state it feels like we're fixing the problem in the wrong place.
If there's just no way to solve this at a better level of abstraction, then I would still argue that we shouldn't decide what options to save or not to save in javac_state based on these kind of corner cases. Save all options as is, and then, when deciding whether to do an incremental compile or not, we take the relevant options into account.
-- Andreas
More information about the compiler-dev
mailing list