RFR 8003161: Cannot build jdk8/build using the new build system after latest merge.

David Holmes david.holmes at oracle.com
Thu Nov 8 20:00:25 UTC 2012


On 8/11/2012 9:11 PM, Fredrik Öhrström wrote:
> 2012-11-08 11:52, David Holmes skrev:
>> I don't understand this:
>>
>> $$(shell $(MKDIR) -p $$($1_BIN) && $(RM)
>> $$($1_BIN)/_the.$$($1_JARNAME)_include)
>>
>> If you have to create the directory there can't possibly be anything
>> to rm. ???
>
> Two things need to be established before ListPathsSafely is executed.
> The output dir must exist, and the previous file must be empty/removed.

So this is just shorthand for:

if [ -d  $$($1_BIN) ]; then
  $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include)
else
  $(MKDIR) $$($1_BIN)
fi

> So you are right and to do it properly, you shoud not execute the RM
> if you successfully created the dir. That command line would look like
> this:
>
> $$(shell $(MKDIR) $$($1_BIN) 2> /dev/null || $(RM)
> $$($1_BIN)/_the.$$($1_JARNAME)_include)

But does the -p make a difference? Do we know that all the intervening 
path elements will exist?

> The extra complexity is just not worth it methinks, since saving a
> single RM per jar will not give you a noticeable speedup....

It isn't the speed up that I'm concerned about it is the 
understandability. Other people are going to see this and their reaction 
will be just like mine. A comment beforehand would help.

David

> //Fredrik



More information about the build-dev mailing list