Skip to content

HADOOP-19977. winutils: GetFileInformationByName collides with Windows SDK 10.0.26100 - #8713

Open
GauthamBanasandra wants to merge 1 commit into
apache:trunkfrom
GauthamBanasandra:HADOOP-19977-winutils-sdk-collision
Open

HADOOP-19977. winutils: GetFileInformationByName collides with Windows SDK 10.0.26100#8713
GauthamBanasandra wants to merge 1 commit into
apache:trunkfrom
GauthamBanasandra:HADOOP-19977-winutils-sdk-collision

Conversation

@GauthamBanasandra

Copy link
Copy Markdown
Member

Description of PR

Building hadoop-common with -Pnative-win fails on Windows against a current
Windows 11 SDK:

winutils.h(129,7): error C2733: 'GetFileInformationByName': you cannot overload
a function with 'extern "C"' linkage [libwinutils.vcxproj]

Windows SDK 10.0.26100.0 introduced its own GetFileInformationByName in
WinBase.h (guarded by #if (NTDDI_VERSION >= NTDDI_WIN11_ZN)). It collides
with the winutils helper of the same name that Hadoop has carried for years:

/* Windows SDK 10.0.26100.0 - WinBase.h */
BOOL WINAPI GetFileInformationByName(PCWSTR, FILE_INFO_BY_NAME_CLASS, PVOID, ULONG);

/* hadoop - winutils.h */
DWORD GetFileInformationByName(LPCWSTR pathName, BOOL followLink,
                               LPBY_HANDLE_FILE_INFORMATION lpFileInformation);

The two differ in signature, so in C++ they would ordinarily overload. But
overloading requires C++ linkage and both have C linkage — winutils.h
wraps its declarations in extern "C", and so does the SDK header — so the
compiler rejects the pair. It surfaces in libwinutils.vcxproj, which compiles
config.cpp as C++. SDK 10.0.22621.0 does not declare the symbol, which is why
this 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 to
the 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-win profile:

  • hadoop-common builds, producing winutils.exe, hadoop.dll and
    libwinutils.lib.
  • hadoop-hdfs-native-client builds, producing hdfs.dll.
  • Full reactor mvn install -Pdist,src,yarn-ui -Dtar -DskipTests: BUILD SUCCESS
    across all 232 modules; the resulting hadoop-3.5.0-SNAPSHOT.tar.gz contains
    bin/winutils.exe, bin/hadoop.dll and bin/hdfs.dll.
  • Smoke-tested the rebuilt binary on the renamed code path: winutils ls <file>
    (which calls the renamed function), winutils chmod 754 <file> followed by
    winutils ls, and winutils systeminfo all behave as before.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id
    (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in
    a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

🤖 Generated with Claude Code

…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>
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 8m 41s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 30m 26s trunk passed
+1 💚 compile 10m 15s trunk passed with JDK Red Hat, Inc.-21.0.12.1+1-LTS
+1 💚 compile 10m 23s trunk passed with JDK Red Hat, Inc.-17.0.20.1+1-LTS
+1 💚 mvnsite 2m 1s trunk passed
+1 💚 shadedclient 71m 0s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 56s the patch passed
+1 💚 compile 9m 16s the patch passed with JDK Red Hat, Inc.-21.0.12.1+1-LTS
+1 💚 cc 9m 16s the patch passed
+1 💚 golang 9m 16s the patch passed
+1 💚 javac 9m 16s the patch passed
+1 💚 compile 10m 30s the patch passed with JDK Red Hat, Inc.-17.0.20.1+1-LTS
+1 💚 cc 10m 30s the patch passed
+1 💚 golang 10m 30s the patch passed
+1 💚 javac 10m 30s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 2m 4s the patch passed
+1 💚 shadedclient 20m 4s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 19m 6s hadoop-common in the patch passed.
+1 💚 asflicense 1m 38s The patch does not generate ASF License warnings.
143m 1s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/artifact/out/Dockerfile
GITHUB PR #8713
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell detsecrets golang
uname Linux be8261148810 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d93dddd
Default Java Red Hat, Inc.-17.0.20.1+1-LTS
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-21.0.12.1.1-1.1.el8_10.x86_64:Red Hat, Inc.-21.0.12.1+1-LTS /usr/lib/jvm/java-17-openjdk-17.0.20.1.1-1.1.el8_10.x86_64:Red Hat, Inc.-17.0.20.1+1-LTS
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/testReport/
Max. process+thread count 3150 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/console
versions git=2.43.7 maven=3.9.15
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@pan3793

pan3793 commented Sep 4, 2026

Copy link
Copy Markdown
Member

@GauthamBanasandra, happy to see you are back.

Built on Windows 11 with ..., and JDK 8 ...

can not be true - trunk requires JDK 17+ now

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 winutils and libhadoop: they date back to an era when Hadoop ran on a very old JDK that lacked many OS APIs Hadoop needs. Modern JDKs have changed the picture — they now provide much of that functionality, so migrating the native code to JDK-provided APIs would significantly reduce its maintenance burden. I'm currently exploring what that looks like for the Linux/Unix side. For the Windows portion, though — would you be interested in investigating the migration there?

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 46s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 19m 45s trunk passed
+1 💚 compile 8m 45s trunk passed
+1 💚 mvnsite 1m 4s trunk passed
+1 💚 shadedclient 46m 9s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 42s the patch passed
+1 💚 compile 9m 12s the patch passed
+1 💚 cc 9m 12s the patch passed
+1 💚 golang 9m 12s the patch passed
+1 💚 javac 9m 12s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 1m 10s the patch passed
+1 💚 shadedclient 17m 37s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 18m 34s hadoop-common in the patch passed.
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
100m 56s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/artifact/out/Dockerfile
GITHUB PR #8713
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell detsecrets golang
uname Linux 25c96b3184e1 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d93dddd
Default Java Debian-25.0.4.1+1-1-deb13u1-Debian
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/testReport/
Max. process+thread count 1257 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/console
versions git=2.47.3 maven=3.9.15
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@GauthamBanasandra GauthamBanasandra self-assigned this Sep 4, 2026
@GauthamBanasandra

Copy link
Copy Markdown
Member Author

Thanks for the warm welcome @pan3793 😊

would you be interested in adding Windows coverage to the GitHub Actions CI?

Sure, I'll take this up. Would love to do it.

would you be interested in investigating the migration there?

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.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 26s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 22m 24s trunk passed
+1 💚 compile 9m 49s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 compile 9m 46s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 mvnsite 1m 11s trunk passed
+1 💚 shadedclient 60m 10s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 43s the patch passed
+1 💚 compile 9m 36s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 cc 9m 36s the patch passed
+1 💚 golang 9m 36s the patch passed
+1 💚 javac 9m 36s the patch passed
+1 💚 compile 11m 5s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 cc 11m 5s the patch passed
+1 💚 golang 11m 5s the patch passed
+1 💚 javac 11m 5s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 1m 17s the patch passed
+1 💚 shadedclient 16m 51s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 18m 22s hadoop-common in the patch passed.
+1 💚 asflicense 0m 47s The patch does not generate ASF License warnings.
119m 30s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/artifact/out/Dockerfile
GITHUB PR #8713
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell detsecrets golang
uname Linux e89ba0c4e1e5 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d93dddd
Default Java Ubuntu-17.0.20+8-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12+8-1-24.04-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20+8-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/testReport/
Max. process+thread count 1276 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8713/1/console
versions git=2.43.0 maven=3.9.15
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants