HADOOP-19977. winutils: GetFileInformationByName collides with Windows SDK 10.0.26100 - #8713
Conversation
…s SDK 10.0.26100 Windows SDK 10.0.26100.0 introduced its own GetFileInformationByName in WinBase.h, guarded by NTDDI_WIN11_ZN. It collides with the winutils helper of the same name. Both declarations have C linkage, so they cannot overload, and libwinutils fails to compile with error C2733. Rename the Hadoop helper to GetFileInformationByPathName, the by-path counterpart to the SDK's existing GetFileInformationByHandle. Pure rename; no behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
💔 -1 overall
This message was automatically generated. |
|
@GauthamBanasandra, happy to see you are back.
can not be true - Jenkins is not stable, so don't be surprised if it fails. The community recently spent effort moving the CI to GitHub Actions, and the Linux part should be mostly working. Since you might be the only committer who is proficient in both Hadoop native code and Windows, would you be interested in adding Windows coverage to the GitHub Actions CI? As for |
|
💔 -1 overall
This message was automatically generated. |
|
Thanks for the warm welcome @pan3793 😊
Sure, I'll take this up. Would love to do it.
Sure. I'll help with this as well. My initial thought here is that we would still need to have the native libraries as they're more performant than the JVM. I'm definitely planning to explore ways to get rid of winutils. |
|
💔 -1 overall
This message was automatically generated. |
Description of PR
Building
hadoop-commonwith-Pnative-winfails on Windows against a currentWindows 11 SDK:
Windows SDK 10.0.26100.0 introduced its own
GetFileInformationByNameinWinBase.h(guarded by#if (NTDDI_VERSION >= NTDDI_WIN11_ZN)). It collideswith the winutils helper of the same name that Hadoop has carried for years:
The two differ in signature, so in C++ they would ordinarily overload. But
overloading requires C++ linkage and both have C linkage —
winutils.hwraps its declarations in
extern "C", and so does the SDK header — so thecompiler rejects the pair. It surfaces in
libwinutils.vcxproj, which compilesconfig.cppas C++. SDK 10.0.22621.0 does not declare the symbol, which is whythis only now breaks.
The SDK name cannot be changed, so this renames the Hadoop helper to
GetFileInformationByPathName. That also reads as the by-path counterpart tothe SDK's existing
GetFileInformationByHandle.This is a pure rename of one internal helper plus its call sites. No behaviour
change, and no change to any public or JNI-visible surface.
How was this patch tested?
Built on Windows 11 with Visual Studio 2022 (toolset v143), Windows SDK
10.0.26100.0, and JDK 8, using the
native-winprofile:hadoop-commonbuilds, producingwinutils.exe,hadoop.dllandlibwinutils.lib.hadoop-hdfs-native-clientbuilds, producinghdfs.dll.mvn install -Pdist,src,yarn-ui -Dtar -DskipTests: BUILD SUCCESSacross all 232 modules; the resulting
hadoop-3.5.0-SNAPSHOT.tar.gzcontainsbin/winutils.exe,bin/hadoop.dllandbin/hdfs.dll.winutils ls <file>(which calls the renamed function),
winutils chmod 754 <file>followed bywinutils ls, andwinutils systeminfoall behave as before.For code changes:
(e.g. 'HADOOP-17799. Your PR title ...')?
declared according to the connector-specific documentation?
a way that is compatible for inclusion under ASF 2.0?
LICENSE,LICENSE-binary,NOTICE-binaryfiles?🤖 Generated with Claude Code