On Tue, 4 Oct 2022 16:19:24 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

> This patch fixes incremental builds on Windows.
> 
> There are 2 parts to this:
> 1. the build system needs to run the paths in the modified file list through 
> fixpath. I've added a `convert` mode to `fixpath.sh` for that. There's an 
> extra target for generating the file with fixed paths. On non-windows 
> platforms this is just a simple `cp` of the file.
> 2. the dependency plugin of `javac` was using string-based path comparison. 
> But, the paths fed by the build system and the paths used internally by javac 
> could be in slightly different formats, meaning that files were not detected 
> properly as changed. I switched to `Path`-based comparison instead and that 
> fixes the issue.
> 
> Testing:
> tested this manually by doing the following:
> 1. `make clean`
> 2. `make images`
> 3. put garbage in one of the files in `java.base`
> 4. `make images` (incremental)
> 5. verify that the build reported an error
> 6. verify the contents of 
> `<build>\jdk\modules\java.base_the.java.base_batch.modfiles.fixed`
> 7. revert the changes of 3, and do the same for another file
> 8. `make images` (incremental)
> 9. verify that the build reported an error
> 10. verify the contents of 
> `<build>\jdk\modules\java.base_the.java.base_batch.modfiles.fixed`
> 11. remove garbage from file modified by 9 again
> 12. `make images` (incremental)
> 13. verify that build succeeds as in 2
> 
> I've tested the build on Windows and Linux (WSL) using the above steps.

Also verified that:
- changes to public interface trigger full recompilation
- changes that do not affect public interface cause minimal recompilation.

This was on Cygwin. LGTM!

-------------

Marked as reviewed by djelinski (Committer).

PR: https://git.openjdk.org/jdk/pull/10560

Reply via email to