-
Notifications
You must be signed in to change notification settings - Fork 30
Integrating scikit-core-build with vcpkg #4310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
eb1a067 to
305d935
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4310 +/- ##
==========================================
- Coverage 89.23% 86.84% -2.39%
==========================================
Files 62 137 +75
Lines 7087 20706 +13619
Branches 0 15 +15
==========================================
+ Hits 6324 17982 +11658
- Misses 763 2724 +1961
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
375513b to
ac8bca5
Compare
d973812 to
1d2e1f0
Compare
jp-dark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I have a couple small initial comments while I continue to experiment locally and dig into all the changes
b916f6d to
f1370f3
Compare
f1370f3 to
4c845ed
Compare
teo-tsirpanis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify the vcpkg integration and tiledbsoma's build system by eliminating the superbuild and following the Core's approaches.
| # Bootstrap vcpkg if needed | ||
| if [ ! -f "${VCPKG_ROOT}/vcpkg" ] && [ ! -f "${VCPKG_ROOT}/vcpkg.exe" ]; then | ||
| echo "Bootstrapping vcpkg..." | ||
| "${VCPKG_ROOT}/bootstrap-vcpkg.sh" || { | ||
| echo "Error: Failed to bootstrap vcpkg" | ||
| exit 1 | ||
| } | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vcpkg will do this by itself if needed.
| # Copy custom triplets if they exist in the Python package | ||
| if [ -d "${PYTHON_DIR}/vcpkg_triplets" ] && [ -d "${VCPKG_ROOT}/triplets" ]; then | ||
| echo "Installing custom vcpkg triplets..." | ||
| cp -f "${PYTHON_DIR}/vcpkg_triplets/"*-release.cmake "${VCPKG_ROOT}/triplets/" 2>/dev/null || true | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set VCPKG_OVERLAY_TRIPLETS when configuring. Modifying the vcpkg directory is not a good idea in general.
| @@ -0,0 +1,332 @@ | |||
| cmake_minimum_required(VERSION 3.21) | |||
| cmake_policy(SET CMP0148 NEW) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the policy need to be set to NEW? It doesn't change anything if we don't use a deprecated find module, does it?
| # Set macOS architecture before project() to avoid vcpkg warnings | ||
| if(APPLE AND NOT DEFINED CMAKE_OSX_ARCHITECTURES) | ||
| # Detect system architecture | ||
| execute_process( | ||
| COMMAND uname -m | ||
| OUTPUT_VARIABLE DETECTED_ARCH | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ) | ||
| set(CMAKE_OSX_ARCHITECTURES "${DETECTED_ARCH}" CACHE STRING "macOS architecture") | ||
| message(STATUS "Auto-detected macOS architecture: ${CMAKE_OSX_ARCHITECTURES}") | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done automatically; what warnings does vcpkg emit?
| - name: Create custom vcpkg triplets for release builds | ||
| run: | | ||
| mkdir -p vcpkg_triplets | ||
| # x64-linux-release | ||
| cat > vcpkg_triplets/x64-linux-release.cmake << 'EOF' | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE release) | ||
| set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
| EOF | ||
| # arm64-linux-release | ||
| cat > vcpkg_triplets/arm64-linux-release.cmake << 'EOF' | ||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE release) | ||
| set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
| EOF | ||
| # x64-osx-release | ||
| cat > vcpkg_triplets/x64-osx-release.cmake << 'EOF' | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE release) | ||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES x86_64) | ||
| set(VCPKG_OSX_DEPLOYMENT_TARGET "13.0") | ||
| EOF | ||
| # arm64-osx-release | ||
| cat > vcpkg_triplets/arm64-osx-release.cmake << 'EOF' | ||
| set(VCPKG_TARGET_ARCHITECTURE arm64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE release) | ||
| set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
| set(VCPKG_OSX_ARCHITECTURES arm64) | ||
| set(VCPKG_OSX_DEPLOYMENT_TARGET "13.0") | ||
| EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it? We already have triplet files checked in, and they are better being placed there.
| - name: Checkout vcpkg | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: microsoft/vcpkg | ||
| path: vcpkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better let CMake clone vcpkg, per my other comments.
| - name: Bootstrap vcpkg | ||
| run: | | ||
| if [ ! -d vcpkg ]; then | ||
| git clone --depth 1 https://github.com/microsoft/vcpkg.git vcpkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better let CMake clone vcpkg, per my other comments.
| CXX_STANDARD 20 | ||
| CXX_STANDARD_REQUIRED ON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| CXX_STANDARD 20 | |
| CXX_STANDARD_REQUIRED ON |
We already set the C++ version globally in lines 19-20.
| # Install system dependencies required by vcpkg (runs once per container) | ||
| before-all = [ | ||
| "yum install -y zip unzip tar curl ninja-build perl-IPC-Cmd autoconf automake libtool pkg-config", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something the user (or CI) should do explicitly. Besides the side-effects of a system-wide operation, it might require root.
|
Thank you @teo-tsirpanis for your comments! |
Copying data from [PR #4310](#4310) Co-Authored-By: Konstantinos Tsitsimpikos <[email protected]>
Issue and/or context:
Changes:
pyproject.tomlandCMakeLists.txtupdatesvcpkgIntegrationNotes for Reviewer: