On Tue, 12 Mar 2024 14:07:32 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

>> I don't see a race. The `rm` was there in the original code and is no 
>> scarier in the modified version. The jdk image is constructed by a 
>> combination of targets and recipes. The first one to run has to be jlink, 
>> then we overlay more stuff on top. If the makefile dependency resolution 
>> concludes that we need to rerun the jlink step, we clear out the directory 
>> completely to make sure we aren't leaving anything in there that's no longer 
>> valid. This is basically a precaution to guarantee a correct incremental 
>> build. It's not incurring a big build time penalty as jlink would have 
>> overwritten all files it would have created anyway. However, if a module was 
>> removed, or a file was removed from a module, the `rm` helps guarantee that 
>> we don't include such a removed file from a previous build attempt in the 
>> final image.
>> 
>> Or it may even be as Severin says, that jlink refuses to run, I don't 
>> remember.
>
> Ok, good, thanks. I did not see the whole picture there.

Marking this as resolved.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14787#discussion_r1524961788

Reply via email to