> The OpenJDK build is using a Plugin called Depend to avoid building Java code > unnecessarily. It has two parts, one is checking module APIs (and forces > rebuild of dependent modules if a dependency changes), and second takes > modified files in a module, and attempts to detect whether it is enough to > recompile these files, or if the whole module must be rebuilt. > > There's a bug in the second part, it does not track changes in primitive > types, so e.g. a change of a type of a public field form `int` to `long` does > not cause recompile. > > This patch fixes that by visiting the primitive types, and including them in > the hash computed for the given file. > > There's also another problem - if a module is being recompiled from scratch > due to a change in a file hash, the new/updated file hashes are written > immediately. And if the compilation consequently fails, the state is not > compared to the original hash, but to the hash from the broken compilation, > which may lead to missing compilation of some files. > > This patch moves the code to write the new hashes to the end of compilation, > and only do that when there were no compile-time errors during the > compilation.
Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Adjusting DependTest, as suggested on the review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/12801/files - new: https://git.openjdk.org/jdk/pull/12801/files/63cd6884..de84439d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=12801&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12801&range=00-01 Stats: 50 lines in 2 files changed: 46 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/12801.diff Fetch: git fetch https://git.openjdk.org/jdk pull/12801/head:pull/12801 PR: https://git.openjdk.org/jdk/pull/12801