fixpath not properly converting Unix paths with print?
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Thu Oct 20 15:06:42 UTC 2022
To clarify, you need the added
FIXPATH_ARGS="-e $PATHTOOL -p $WINENV_PREFIX_ARG -r
${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR -c $CMD -q"
to be sure to get the correct behavior.
/Magnus
On 2022-10-20 17:03, Magnus Ihse Bursie wrote:
> The fixpath.sh script has two "modes", one in which it tries to
> autodetect it's environment itself, and one in which the environment
> info is fed into it from the caller.
>
> The latter method is used in all real use cases when it is used in the
> make files.
>
> You are exercising the first case. That is only intended as a
> development tool, and might not work correctly.
>
> I think that is the answer to the oddities you are seeing.
>
> Look in `spec.gmk` to find how fixpath.sh is really called during a
> makefile execution.
>
> /Magnus
>
>
> On 2022-10-20 10:58, Julian Waters wrote:
>> Hi all,
>>
>> On Windows MakeBase contains a utility to extract Windows paths from
>> Unix style paths:
>>
>> # FixPath
>> #
>> # On Windows, converts a path from cygwin/unix style (e.g. /bin/foo)
>> into
>> # "mixed mode" (e.g. c:/cygwin/bin/foo). On other platforms, return
>> the path
>> # unchanged.
>> # This also converts a colon-separated list of paths to a
>> semicolon-separated
>> # list.
>> # This is normally not needed since we use the FIXPATH prefix for
>> command lines,
>> # but might be needed in certain circumstances.
>>
>> According to the documentation it should be able to handle paths like
>> /usr/bin or /bin/xxx, but manually invoking the implementation of
>> this utility from the shell seems to indicate that it can only
>> properly convert full paths that have environment prefixes and so on,
>> with the "true" Unix style paths simply expanding into empty strings:
>>
>> Working usage:
>>
>> user at LAPTOP-NEMLU0S6:/mnt/d/eclipse/workspace/hotspot/jdk$ fixpath
>> print
>> /mnt/c/progra~1/mib055~1/2022/commun~1/vc/tools/msvc/1432~1.313/bin/hostx64/x64/cl.exe
>>
>> c:\progra~1\mib055~1\2022\commun~1\vc\tools\msvc\1432~1.313\bin\hostx64\x64\cl.exe
>>
>> user at LAPTOP-NEMLU0S6:/mnt/d/eclipse/workspace/hotspot/jdk$
>>
>> as compared to:
>>
>> user at LAPTOP-NEMLU0S6:/mnt/d/eclipse/workspace/hotspot/jdk$
>> /mnt/d/eclipse/workspace/hotspot/jdk/build/windows-x86_64-server-release/fixpath
>> print /usr/bin/make
>> vertig0 at LAPTOP-NEMLU0S6:/mnt/d/eclipse/workspace/hotspot/jdk$
>>
>> I can't quite tell if this is a subtle bug or if it's working as
>> intended, and the documentation is just a tad outdated/was
>> misinterpreted by me, so I thought I'd raise it on the list just in
>> case (I first caught this while using FixPath on a local branch).
>>
>> best regards,
>> Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20221020/d9f3f776/attachment.htm>
More information about the build-dev
mailing list