For both java and native source files, we have a feature in the build which allows overriding based on file name for more specific version (i.e. OS specific overrides shared). This works quite well and is used in several locations. It does however break down when building src.zip. The file with the newest modification date gets picked by the zip utility, which essentially makes it random. Luckily the kind of files that are overridden this way are usually rather fringe so very few people probably care. Even so, the build should be correct, so here is a patch that fixes it.

I've added a loop that looks for duplicate files in the given source roots and adds any but the first found to exclude lists. I was afraid this would add noticeable time to incremental rebuilds, but I found a way to work around this by putting this calculation in the recipe for the zip file. The drawback is that we cannot remove these files from the prerequisites list, so we may trigger unnecessary rebuilds of zip files. However, since the number of src files that are handled this way is so small, I believe that to be a very rare situation and that it's much more valuable to avoid doing the calculation most of the time instead. (On my machine, without this hack, incremental rebuild of "make zip-source" went from 2.7s to 3.2s, which is noticeable enough IMO, with the hack, there is no difference.)

Bug: https://bugs.openjdk.java.net/browse/JDK-8058539

Webrev: http://cr.openjdk.java.net/~erikj/8058539/webrev.01/

/Erik
<https://bugs.openjdk.java.net/browse/JDK-8058539>

Reply via email to