fix(c): Generate versioned DLLs and import LIBs when building with MSVC#2858
fix(c): Generate versioned DLLs and import LIBs when building with MSVC#2858lidavidm merged 96 commits intoapache:mainfrom
Conversation
|
Thanks for figuring this out. Overall this looks reasonable. If you don't mind I can attempt to push a Windows pipeline to this PR so we can test it. |
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
…o window-build
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Yes please @lidavidm that would be helpful. |
|
Got it - I'll try to get to it soon |
|
pre-commit issues addressed |
|
Hmm not sure why the pre-commit is still failing. Is it because I've run mine on a Windows machine so it's not capturing everything the CI does (which runs on Ubuntu from the looks of it)? 🤔 |
|
How are you running it? |
|
Using this command: |
|
I don't see a problem. I guess it could be Windows. |
lidavidm
left a comment
There was a problem hiding this comment.
Thanks! I have some questions but they aren't blockers.
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
|
||
| # If we're building on Windows using vcpkg, ensure the runtime dependencies of binaries are copied to the install folder. | ||
| if(ADBC_BUILD_VCPKG) |
There was a problem hiding this comment.
Can this automatically be detected somehow? e.g. by checking CMake's platform property and something the vcpkg-cmake integration sets?
There was a problem hiding this comment.
Hmm had a quick look but can't see a better way at the moment. The problem is that runtime dependencies copying doesn't work for other builds like python/conda etc. Maybe we can spend more time investigating in a separate PR if that's OK?
| id: winlibs-version | ||
| shell: pwsh | ||
| run: | | ||
| $winlibs_asset_name = "winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r4.7z" |
There was a problem hiding this comment.
I assume this has to be updated periodically?
There was a problem hiding this comment.
Yes. We can always get the latest, but I think it's safer pinning the version and updating manually.
Co-authored-by: David Li <li.davidm96@gmail.com>
Co-authored-by: David Li <li.davidm96@gmail.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
…o window-build
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
I'll take one last look but also I wanna make sure we file any follow up issues that were mentioned here 😅 Thanks again for figuring out all of this! |
Removed Windows configuration handling for test binaries.
Co-authored-by: David Li <li.davidm96@gmail.com>
Thanks @lidavidm, I see you've created the relevant issues. Regarding packaging the debug and release binaries, do you have anything specific in mind, as I'm not sure what the packaging patterns are in this rep. We can update the vcpkg job to upload the artifacts, but not sure how these will make it to the tagged release as assets. Thanks |
|
We don't actually ship Windows packages, only wheels. (We do ship packages for some Linux distros, but not macOS either.) So I'm not sure there's too much to do here in terms of packaging. |
…VC (apache#2858) Hi. This is to address building binaries and LIBs on Windows. The PR is mainly for consideration purposes, as it's my first PR against this repo so not necessarily a complete one. Following are the changes I needed to make: - Disable ASAN/UBSAN builds configs as they require GCC/Clang, and on Windows we're building with MSVC. - An environment variable to `vcpkg` root is expected so that third party packages (sqlite, postgres etc) can be installed and found via vcpkg. - Disable some warnings for testing code that are safe to ignore for MSVC builds. - Ensure the generated binaries have file level details (Details tab on the file properties in Windows) for the version. This is required by Windows MSIs that may be used to install the adbc DLLs in order to detect if the DLL being installed is a newer or older version. - Generate import LIB file for drivers built with go build, which includes flight SQL and Snowflake drivers. This allows the testing projects referencing those DLLs to built on Windows. - The `GoUtils.cmake` is not automatically copying the driver DLLs to the location of the test executables, causing the tests for those drivers to fail. Added a post build command to ensure the DLLs are copied. - Fix some type casting mismatch (casting between size_t and int). - Fix warnings where a variable is hiding a previous one with the same name. Appended `2` to the second variable name. What I haven't done is update the GitHub actions to verify a complete build on a Windows machine as I'm not too familiar with the CI/CD pipeline in this repo. Hopefully this is a good start to get everything building successfully and Windows. Closes apache#2846 --------- Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Co-authored-by: David Li <li.davidm96@gmail.com> Co-authored-by: Bryce Mecum <petridish@gmail.com>
Hi.
This is to address building binaries and LIBs on Windows. The PR is mainly for consideration purposes, as it's my first PR against this repo so not necessarily a complete one. Following are the changes I needed to make:
vcpkgroot is expected so that third party packages (sqlite, postgres etc) can be installed and found via vcpkg.GoUtils.cmakeis not automatically copying the driver DLLs to the location of the test executables, causing the tests for those drivers to fail. Added a post build command to ensure the DLLs are copied.2to the second variable name.What I haven't done is update the GitHub actions to verify a complete build on a Windows machine as I'm not too familiar with the CI/CD pipeline in this repo.
Hopefully this is a good start to get everything building successfully and Windows.
Closes #2846