build(c): don't allow combined static/shared build on Windows - #4606
Merged
Conversation
lidavidm
marked this pull request as ready for review
July 28, 2026 06:15
lidavidm
marked this pull request as draft
July 28, 2026 09:31
lidavidm
marked this pull request as ready for review
July 28, 2026 10:16
There was a problem hiding this comment.
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_STATICdefault toOFFon Windows and adds a Windows-time configuration validation that rejectsADBC_BUILD_STATIC=ON+ADBC_BUILD_SHARED=ON. - Updates Debian and RPM packaging scripts to explicitly pass
-DADBC_BUILD_SHARED=ONand-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Try to avoid problems because these two conflict on Windows.
Closes #4581.