RFR: JDK-8244844 javac command line is not re-executable

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue May 12 17:08:05 UTC 2020


On 2020-05-12 17:38, Erik Joelsson wrote:
> On 2020-05-12 08:29, Magnus Ihse Bursie wrote:
>> We've broken our golden rule in SetupJavaCompilation, that all 
>> command lines should be copy/paste:able to re-execute them from the 
>> command line. The reason is that the file containing the source code 
>> file names has a temporary name, which is renamed after the 
>> compilation. This is just a messy way to use the file both as input 
>> to javac and as a marker that the compilation has succeeded. By 
>> splitting up these two roles, we get more readable code and a 
>> re-executable command line.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8244844
>> WebRev: 
>> http://cr.openjdk.java.net/~ihse/JDK-8244844-make-javac-re-executable/webrev.01
>>
> I really like seeing this fixed, but not sure about this patch. By 
> moving the filelist to a separate rule and only having the source 
> files as prereq, there will be cases where the source files timestamps 
> have not changed, but the list of files may have. I think this would 
> be safely covered if you moved VARDEPS_FILE as prereq to FILELIST.
I see your point. Will do that.

I was also a bit divided about whether the actual javac invocation rule 
should keep $$($1_SRCS) as a dependency. Technically, it's not needed, 
since changes in the sources will result in the filelist being updated, 
but maybe the intention will be better expressed. And if the set of 
files has not changed, then we will write the same files back to the 
filelist, which effectively just updates the timestamp in a roundabout 
way. If we keep the list of source files as dependency, we are free to 
implement a future optimization where the filelist is not updated if the 
set of files has not changed.

Otoh, I don't know if a huge list of dependencies (the number of sources 
files for e.g. java.base is non-trivial!) affects make performance, so 
listing it twice just to make it "look good" maybe isn't a good idea.

Do you have any opinion?

/Magnus
>
> /Erik
>
>




More information about the build-dev mailing list