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.

Thanks for the review, I've address your comments 
(https://github.com/openjdk/jdk/pull/10560/commits/35cc2269be8d69841f5641396cece5a1b0c1b2a3).

WRT the redundant copy. I wanted to avoid the use site having to have some `if` 
that checks whether we're running on Windows to decide which file 
`$1_COMPILE_TARGET` should depend on. Copying allows always depending on the 
fixed file.

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

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

Reply via email to