OpenJDK6 build oddity

Andrew John Hughes gnu_andrew at member.fsf.org
Tue Sep 8 12:50:13 PDT 2009


2009/9/8 Kelly O'Hair <Kelly.Ohair at sun.com>:
>
>
> Andrew John Hughes wrote:
>>
>> 2009/9/8 Kelly O'Hair <Kelly.Ohair at sun.com>:
>>>
>>> Andrew John Hughes wrote:
>>>>
>>>> It seems whenever you do a build of OpenJDK6 you get an empty
>>>> 'fastdebug' directory, due to the following under setup in the
>>>> top-level Makefile:
>>>>
>>>>       $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
>>>>       $(MKDIR) -p $(ABS_OUTPUTDIR)/j2sdk-image
>>>>       $(MKDIR) -p $(OUTPUTDIR)-fastdebug/j2sdk-image
>>>>       $(MKDIR) -p $(ABS_OUTPUTDIR)-fastdebug/j2sdk-image
>>>>
>>>> Shouldn't there be a conditional here so that only the appropriate
>>>> mkdir invocations are used?
>>>>
>>>> The logic in OpenJDK7's Makefile is completely different, and doesn't
>>>> produce this empty directory.
>>>
>>> This strange stuff came about while dealing with Windows and
>>> the so called "8.3 short paths", or paths without spaces.
>>> The makefiles generally need paths without spaces, but these
>>> dang 8.3 paths are kind of a dynamic appendage on the long path,
>>> and strange things happen when one or the other gets deleted and
>>> recreated. I never got to the very bottom of this, but the top level
>>> makefile somehow manages to delete and recreate, and sometimes you
>>> would end up with several 8.3 paths (different directories) in these
>>> two variables, but only one was actually used. Ugly stuff. :^(
>>>
>>> The fastdebug ones had something to do with the way the top level
>>> Makefile works when it created both the product images and the
>>> fastdebug images. I forget the details, but some of the initialization
>>> logic only got run once, so it had to create both.
>>>
>>> I am sure this could be cleaned up, a complete build on Windows would
>>> need to verify it is ok.
>>>
>>> -kto
>>>
>>
>> Thanks for the feedback on this, Kelly.  I should have guessed this
>> would be down to Windows yet again...
>>
>> My presumption is that there is some option which turns on fastdebug
>> mode, which will mean that the build ends up in the -fastdebug
>> directories and the directories without a suffix are empty.  So
>> presumably this statement needs to be conditional on which mode is
>> enabled.  But I may be completely wrong.
>>
>> As I say, this is obviously fixed on 7 as I don't get these
>> superfluous directories. That's why they stood out so much with
>> OpenJDK6.  If you set ALT_OUTPUTDIR, as I do as standard to build on a
>> different disk, the extra directory is more noticeable.  I'm guessing
>> most people haven't noticed this on OpenJDK6 because it's otherwise
>> buried inside build instead of being at toplevel:
>>
>> $ ls /mnt/builder/icedtea6/openjdk/build
>> linux-amd64/  linux-amd64-fastdebug/
>>
>
> I will poke around in the jdk7 sources and see where this changed, I'm
> sure it has my DNA on it somehow. :^(
>
> Not easy to find out who 'deleted' lines in a file... :^(
>
> Look at changeset d6b08bdb9a54, this link might work:
>   http://hg.openjdk.java.net/jdk7/jdk7/rev/d6b08bdb9a54
>
> My network connection is messed up right now, so I cannot verify.
>
> -kto
>
>
>

Yep, that looks to be the one:

 setup: openjdk_check
$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
- $(MKDIR) -p $(ABS_OUTPUTDIR)/j2sdk-image
- $(MKDIR) -p $(OUTPUTDIR)-fastdebug/j2sdk-image
- $(MKDIR) -p $(ABS_OUTPUTDIR)-fastdebug/j2sdk-image
# Check on whether we really can build the openjdk, need source etc.
-openjdk_check:
+openjdk_check: FRC
ifneq ($(SKIP_OPENJDK_BUILD), true)
@$(ECHO) " "
@$(ECHO) "================================================="
@@ -170,7 +170,7 @@ endif
COMMON_DEBUG_FLAGS= \
DEBUG_NAME=$(DEBUG_NAME) \
- ALT_OUTPUTDIR=$(_OUTPUTDIR)-$(DEBUG_NAME) \
+ ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
NO_DOCS=true

Though it's not immediately obvious to me how ALT_OUTPUTDIR doesn't
end up being $(ABS_OUTPUTDIR)- if $(DEBUG_NAME) is empty; I assume the
surrounding context prevents that being invoked if that's the case.
I'll have a look at backporting that tomorrow; thanks for finding it!
I diffed the two Makefiles but there are so many changes this was
obviously lost in them all.

Cheers,
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


More information about the jdk6-dev mailing list