[7u]: help on jdk/make/common/shared/Defs-windows.gmk
Erik Joelsson
erik.joelsson at oracle.com
Thu Nov 21 13:45:42 UTC 2013
I did some experiments and looked closer at the code. I missed some
details in my earlier analysis. Here is what is supposed to happen:
FullPath is a macro that takes a path and converts it to mixed style
(c:/) path without spaces. Depending on whether the input contains a
space (the test $(if $(word 2,$1))) two different approaches to this are
employed. If there is a space, cygpath is executed as we do not know of
a way to convert to dos short names without it. If there is no space, we
avoid the overhead of executing an external command and instead use a
combination of $(realpath) and some make macro magic. $(realpath) makes
a path absolute and canonical. Then the MixedPath macro handles the
conversion of /cygdrive/c to C:.
It seems to me like your make binary is failing the realpath call. I
have no idea how this happened and have never seen it before.
One thing I am certain of is that changing the test to $(if $(word 1,$1)
is not the correct solution. It's basically changing it to "if true".
Could you try a couple of tests of realpath in your test.mk? Something
like: $(info realpath . $(realpath .))
/Erik
On 2013-11-20 21:11, Francis ANDRE wrote:
> Erik
>
> >>How are you invoking the build to cause this error? Are you
> explicitly setting ALT_OUTPUTDIR?
> I am invoking just: make sanity without explicitly setting ALT_OUTPUTDIR.
>
>
> What is the path to your workspace?
> FrancisANDRE at idefix /cygdrive/Z/JDK/jdk7u
> $ hg path
> default = http://hg.openjdk.java.net/jdk7u/jdk7u
>
> FrancisANDRE at idefix /cygdrive/Z/JDK/jdk7u
> $ hg root
> /cygdrive/Z/JDK/jdk7u
>
>
>
> I extracted the relevant commands from the
> jdk/make/common/shared/Defs-windows.gmk into the joined test.mk file
>
> if one runs make -f test.mk with $(if $(word 2,$1) at line 72, one gets
> $ make -f test.mk
> *OUTPUTDIR=./build/windows-i586**
> **ABS_OUTPUTDIR=*
> ALT_HOTSPOT_IMPORT_PATH=Z:/JDK/jdk7u/build/windows-i586/hotspot/import
> _HOTSPOT_IMPORT_PATH2=
> _HOTSPOT_IMPORT_PATH3=
> HOTSPOT_IMPORT_PATH=Z:/JDK/jdk7u/build/windows-i586/hotspot/import
> SYSTEMROOT=C:WINDOWS
> xSYSTEMROOT=C:/WINDOWS
> _system_root=C:/WINDOWS
> FOO=Z:/JDK/jdk7u/build/windows-i586
> BAR=C:/WINDOWS
>
>
> if one runs make -f test.mk with $(if $(word 1,$1) at line 72, one gets
> $ make -f test.mk
> *OUTPUTDIR=./build/windows-i586**
> **ABS_OUTPUTDIR=Z:/JDK/jdk7u/build/WINDOW~1*
> ALT_HOTSPOT_IMPORT_PATH=Z:/JDK/jdk7u/build/windows-i586/hotspot/import
> _HOTSPOT_IMPORT_PATH2=
> _HOTSPOT_IMPORT_PATH3=
> HOTSPOT_IMPORT_PATH=Z:/JDK/jdk7u/build/WINDOW~1/hotspot/import
> SYSTEMROOT=C:WINDOWS
> xSYSTEMROOT=C:/WINDOWS
> _system_root=C:/WINDOWS
> FOO=Z:/JDK/jdk7u/build/WINDOW~1
> BAR=C:/WINDOWS
>
>
> in both case, OUTPUTDIR is a relative path as "./build/windows-i586",
> but only the second computes properly the ABS_OUTPUTDIR as
> "Z:/JDK/jdk7u/build/WINDOW~1". In the first case, ABS_OUTPUTDIR is
> empty with leads to the error "ERROR: Trouble with the absolute path
> for OUTPUTDIR"
>
>
>
> Le 20/11/2013 10:47, Erik Joelsson a écrit :
>> The way I understand it $(if $(word 2,$1) is a check for whitespace
>> in the input parameter. It's an optimization to avoid executing
>> cygpath when it's not needed. The MixedPath macro cannot be used if
>> the path contains a space. It also doesn't convert to an absolute
>> path, just replacing cygwin specific paths with driveletter paths.
>> The unfortunate effect of this is that FullPath behaves differently
>> depending on if the path contains a space.
>>
>> How are you invoking the build to cause this error? Are you
>> explicitly setting ALT_OUTPUTDIR? What is the path to your workspace?
>>
>> /Erik
>>
>> On 2013-11-15 18:37, Francis ANDRE wrote:
>>> Hi
>>>
>>> I am trying to fix the following error
>>>
>>> $ make sanity
>>> jdk/make/common/shared/Defs.gmk:563: *** "ERROR: Trouble with the
>>> absolute path for OUTPUTDIR './bui
>>> ld/windows-i586'". Stop.
>>>
>>> and found the following code in
>>> jdk/make/common/shared/Defs-windows.gmk, line 109
>>>
>>> define FullPath
>>> $(if $(word 2,$1),$(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL)),$(call
>>> MixedPath,$(realpath $(subst ",,$1))))
>>> endef
>>>
>>> Can someone explain me what use case is covered by the $(word 2,$1)
>>> in the previous statement?
>>>
>>> The error "ERROR: Trouble with the absolute path for OUTPUTDIR" can
>>> be fixed by replacing $(word 2,$1) by $(word 1,$1) but I cannot find
>>> a usage for the $(word 2,$1)
>>>
>>> Francis
>>
>>
>
More information about the build-dev
mailing list