Skip to content

build(c): don't allow combined static/shared build on Windows - #4606

Merged
lidavidm merged 1 commit into
apache:mainfrom
lidavidm:gh-4581
Jul 31, 2026
Merged

build(c): don't allow combined static/shared build on Windows#4606
lidavidm merged 1 commit into
apache:mainfrom
lidavidm:gh-4581

Conversation

@lidavidm

@lidavidm lidavidm commented Jul 28, 2026

Copy link
Copy Markdown
Member

Try to avoid problems because these two conflict on Windows.

Closes #4581.

@lidavidm
lidavidm marked this pull request as ready for review July 28, 2026 06:15
@lidavidm
lidavidm requested a review from amoeba July 28, 2026 06:15
@lidavidm
lidavidm requested a review from kou as a code owner July 28, 2026 09:28
@lidavidm
lidavidm marked this pull request as draft July 28, 2026 09:31
@lidavidm
lidavidm marked this pull request as ready for review July 28, 2026 10:16
@lidavidm
lidavidm requested a review from Copilot July 31, 2026 01:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the C/CMake build configuration to prevent requesting both static and shared library builds on Windows, addressing the .lib name collision described in #4581, and makes Linux packaging explicitly build both variants.

Changes:

  • Adjusts ADBC_BUILD_STATIC default to OFF on Windows and adds a Windows-time configuration validation that rejects ADBC_BUILD_STATIC=ON + ADBC_BUILD_SHARED=ON.
  • Updates Debian and RPM packaging scripts to explicitly pass -DADBC_BUILD_SHARED=ON and -DADBC_BUILD_STATIC=ON.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ci/linux-packages/yum/apache-arrow-adbc.spec.in Explicitly enables both shared and static builds for RPM packaging.
ci/linux-packages/debian/rules Explicitly enables both shared and static builds for Debian packaging.
c/cmake_modules/DefineOptions.cmake Changes Windows defaults and adds a Windows guard against combined static/shared builds.
Comments suppressed due to low confidence (2)

c/cmake_modules/DefineOptions.cmake:90

  • This unconditional configure-time STATUS message adds noise (especially when ADBC is consumed as a subproject) and largely duplicates information already shown by config_summary_message(). Consider removing it or at least commenting it out.
message(STATUS "Default static build: ${_STATIC_BUILD_DEFAULT}")

c/cmake_modules/DefineOptions.cmake:271

  • The rationale here mentions “they both generate a .lib”, which is toolchain-specific (e.g. MSVC). Since the check is currently keyed only on WIN32, it will also forbid combined static/shared builds on Windows toolchains where the suffixes may differ. If the intent is specifically to prevent filename collisions, consider basing the check on whether CMAKE_STATIC_LIBRARY_SUFFIX and CMAKE_IMPORT_LIBRARY_SUFFIX are equal, and include guidance in the error message.
  if(WIN32
     AND ADBC_BUILD_STATIC
     AND ADBC_BUILD_SHARED)
    message(FATAL_ERROR "Cannot enable both ADBC_BUILD_STATIC and ADBC_BUILD_SHARED on Windows"
    )
  endif()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread c/cmake_modules/DefineOptions.cmake Outdated
@lidavidm
lidavidm merged commit cd1b29e into apache:main Jul 31, 2026
86 of 87 checks passed
@lidavidm
lidavidm deleted the gh-4581 branch July 31, 2026 04:44
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.

build: fail if both static and shared libraries are requested on Windows

2 participants