RFR (XS) 8221824: Build failure with MSVS 2013 after JDK-8218418
Alan Bateman
Alan.Bateman at oracle.com
Tue Apr 2 12:56:34 UTC 2019
On 02/04/2019 12:58, Aleksey Shipilev wrote:
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8221824
>
> I understand Oracle is building with newer MSVS. I would like to still maintain the code buildable
> with older MSVS-es.
>
> Fix:
>
> diff -r 35794e8db61b src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c
> --- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c Tue Apr 02 10:04:35 2019 +0200
> +++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c Tue Apr 02 13:56:19 2019 +0200
> @@ -1066,6 +1066,9 @@
> // Allow creation of symbolic links when the process is not elevated.
> // Developer Mode must be enabled for this option to function, otherwise
> - // it will be ignored.
> - DWORD dwFlags = (DWORD)flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
> + // it will be ignored. Check that symbol is available in current build SDK.
> + DWORD dwFlags = (DWORD)flags;
> +#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
> + dwFlags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
> +#endif
>
> // On Windows 64-bit this appears to succeed even when there are
>
> Testing: local Windows build, jdk-submit (running)
>
With this patch then you undo JDK-8218418 when building on an older SDK.
Instead, I think you need to set
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE when it's not set (its
value seems to be 0x2).
Separately, I'm interested to hear from Brian is this flag is ignored on
older versions of Windows. If it isn't then a OS version check will be
needed.
-Alan
More information about the nio-dev
mailing list