You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Windows compute testing helper exports static API definitions to shared-linked tests #55279
On Windows, arrow_compute_testing exports ARROW_STATIC and ARROW_COMPUTE_STATIC when ARROW_BUILD_STATIC is enabled. That option
means a static library variant is available; it does not mean tests selected
static linkage.
With both library variants enabled and ARROW_TEST_LINKAGE=shared, the
PUBLIC definitions propagate static declarations into a test linking Arrow
DLL import libraries. The real arrow-dlpack-test target fails with duplicate arrow::Status constructor/destructor definitions (LNK2005 followed by
LNK1169).
How to reproduce
On Windows with Visual Studio and MSVC, configure from the repository root:
Inspect arrow_compute_testing's PUBLIC compile definitions and those
inherited by dlpack_test.cc. Static API definitions are present despite
shared test linkage.
Expected: export those definitions only when ARROW_TEST_LINKAGE is static.
Version and proposed fix
The real-target failure was reproduced at d228ba5a9def26e67e12b2e475be0b00edb77aea. The same conditional is present
at current main 4a6ebc06dc2bb967263fdf83449ac104e54cbaba.
Change the Windows conditional from ARROW_BUILD_STATIC to ARROW_TEST_LINKAGE STREQUAL "static".
Validation
With the same compiler, configuration and build directory, the original
target fails to link. After the one-condition change it builds successfully,
and arrow-dlpack-test passes all 39 tests from 10 suites.
An extracted exact CMake target-section check also passes the three linkage
controls: shared tests with both library variants, static tests, and
shared-only libraries. The whole Arrow suite was not run.
Tool assistance
Copilot assisted with diagnosis, the conditional change, and this report.
The results above came from actual target builds and test execution; no
private compiler inputs or internal build logs are attached.
Activity