Skip to content

[orc] update to 2.3.0#51063

Draft
toge wants to merge 3 commits into
microsoft:masterfrom
toge:orc-2.3.0
Draft

[orc] update to 2.3.0#51063
toge wants to merge 3 commits into
microsoft:masterfrom
toge:orc-2.3.0

Conversation

@toge
Copy link
Copy Markdown
Contributor

@toge toge commented Apr 9, 2026

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version, or no changes were necessary.
  • Any fixed CI baseline and CI feature baseline entries are removed from that file, or no entries needed to be changed.
  • All patch files in the port are applied and succeed.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

https://github.com/apache/orc/releases/tag/v2.3.0

@toge toge marked this pull request as draft April 9, 2026 15:03
@vicroms
Copy link
Copy Markdown
Member

vicroms commented Apr 21, 2026

vcpkg CI Failure Report

Build: #129760
PR: #51063 - [orc] update to 2.3.0
Triggered by: Pull Request — toge on refs/pull/51063/merge @ 89cfe98a
Result:FAILED | Finished: 2026-04-09 17:37:33 UTC


Summary

Triplet Status Failing Ports Category
x64_windows ❌ Failed orc Linker Error
x64_windows_release ❌ Failed orc Linker Error
x64_windows_static ❌ Failed orc Linker Error
x64_windows_static_md ❌ Failed orc Linker Error
x86_windows ❌ Failed orc Linker Error
arm64_windows ❌ Failed orc Linker Error
arm64_windows_static_md ❌ Failed orc Linker Error
x64_linux ✅ Passed
x64_android ✅ Passed
arm64_linux ✅ Passed
arm64_android ✅ Passed
arm_neon_android ✅ Passed
arm64_osx ✅ Passed

Total regressions: 1 unique port (orc)
Affected triplets: 7 Windows variants (all x64_windows and arm64_windows families)
Status: New regression (orc was previously passing)


🔴 New Regressions (Action Required)

orc — Linker Error: Missing getopt Symbols

Failure type: BUILD_FAILED — Linker (LNK1120, LNK2019)

Affected triplets: x64_windows, x64_windows_release, x64_windows_static, x64_windows_static_md, x86_windows, arm64_windows, arm64_windows_static_md

Root cause: The ORC 2.3.0 release introduced new tools that depend on the GNU getopt API (getopt_long_a, optind, optarg_a). These symbols are not available on Windows by default. The build fails at the link stage when trying to build the tools (orc-metadata, orc-contents, orc-memory, orc-scan, orc-statistics, csv-import).

Error output:

tools\src\orc-metadata.exe : fatal error LNK1120: 3 unresolved externals
FileMetadata.cc.obj : error LNK2019: unresolved external symbol __imp_getopt_long_a referenced in function main
ToolsHelper.cc.obj : error LNK2001: unresolved external symbol __imp_optind
ToolsHelper.cc.obj : error LNK2019: unresolved external symbol __imp_optarg_a

Analysis:

  1. Version update context: PR [orc] update to 2.3.0 #51063 updates ORC from 2.2.x to 2.3.0. The new version includes new command-line tools (tools/src/orc-metadata.cc, ToolsHelper.cc, etc.) that were not present in the previous release.

  2. MSVC incompatibility: These tools use POSIX getopt functions, which are not standard on Windows. The code references __imp_getopt_long_a, __imp_optind, and __imp_optarg_a — these are typically provided by GNU libc or a ported getopt implementation.

  3. Missing dependency: Windows builds need either:

    • A vcpkg dependency on a getopt port (e.g., gnugetopt, getopt-win32)
    • A Windows-specific workaround (e.g., conditional tool build only on Unix platforms)
    • A patch to use Windows-native argument parsing on MSVC builds
  4. Why it passes on Linux/Android: Unix platforms have native POSIX getopt in their standard C library, so the tools build successfully.

Suggested fixes:

  1. Add a vcpkg dependency on getopt-win32 (recommended):

    • Add getopt-win32 as a dependency in the orc/portfile.cmake
    • Link the tools against the getopt library
    • This requires adding find_package(getopt REQUIRED) and linking in CMakeLists.txt or portfile
  2. Disable tools on Windows only:

    • Modify portfile.cmake to set -DBUILD_TOOLS=OFF for Windows triplets
    • Less ideal, but avoids the linker error if tools are not critical on Windows
  3. Patch ORC to conditionally use Windows APIs:

    • Add a patch that uses Windows' main() argument parsing on MSVC instead of POSIX getopt
    • More involved, but keeps feature parity
  4. Check upstream ORC for Windows support:

    • The ORC project may have added Windows tool support in 2.3.0 but not tested it fully
    • Reach out to the Apache ORC project or check their issue tracker for known Windows linker issues with the tools

Recommended next steps:

  • Determine whether the tools are required for vcpkg's use case (library only? or tools too?)
  • If tools are optional: add -DBUILD_TOOLS=OFF for Windows triplets in the next attempt
  • If tools are required: investigate adding getopt-win32 as a dependency or patching the tools to use Windows APIs

Verification: After fix, rebuild on x64_windows to verify the tools link successfully.


ℹ️ Platform Impact

  • Windows affected: All 7 Windows triplets failed at the same point (linker stage), indicating a systematic platform-wide issue
  • Linux/Android unaffected: All Linux and Android triplets passed successfully, confirming the issue is Windows-specific
  • macOS unaffected: arm64_osx passed, as macOS has POSIX APIs like Linux

This is a classic case of a cross-platform library update introducing new platform-specific dependencies that weren't caught during the initial PR validation.


Summary & Recommendation

Issue: ORC 2.3.0 adds new command-line tools that depend on POSIX getopt functions. On Windows, these symbols are not provided by the MSVC C runtime, causing linker errors.

Scope: Affects all 7 Windows triplets; unaffected on Unix-like platforms.

Resolution: The port maintainer should either:

  1. Disable tools on Windows (-DBUILD_TOOLS=OFF)
  2. Add a getopt-win32 dependency and update the ORC CMakeLists.txt to find and link it
  3. Provide a patch to use Windows-native APIs for argument parsing

Status: Blocking PR #51063 from merge. Mark as draft or rebase with a fix before re-running CI.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants