Skip to content

Commit 994515d

Browse files
committed
remove windows support
1 parent 3938fb4 commit 994515d

9 files changed

Lines changed: 20 additions & 109 deletions

File tree

.clang-format

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,12 @@ IncludeCategories:
6262
# Standard library
6363
- Regex: '^<[a-z_]+>'
6464
Priority: 4
65-
# Windows headers
66-
- Regex: '^<windows\.h>'
67-
Priority: 5
6865
# ODBC headers
6966
- Regex: '^<sql'
70-
Priority: 6
67+
Priority: 5
7168
# Third-party libraries
7269
- Regex: '.*'
73-
Priority: 7
70+
Priority: 6
7471

7572
# Other formatting
7673
BinPackArguments: true

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ assignees: ''
1111
<!-- A clear and concise description of what the bug is -->
1212

1313
## Environment
14-
- **OS**: <!-- e.g., macOS 14.0, Ubuntu 22.04, Windows 11 -->
15-
- **Compiler**: <!-- e.g., GCC 11.2, Clang 14, MSVC 2022 -->
14+
- **OS**: <!-- e.g., macOS 14.0, Ubuntu 22.04 -->
15+
- **Compiler**: <!-- e.g., GCC 11.2, Clang 14 -->
1616
- **SDK Version**: <!-- e.g., 0.3.0 -->
1717
- **CMake Version**: <!-- e.g., 3.25.0 -->
1818
- **ODBC Driver**: <!-- e.g., Simba Spark ODBC Driver 2.6.26 -->

.github/workflows/ci.yml

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
cross-platform-tests:
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, windows-latest]
13+
os: [ubuntu-latest, macos-latest]
1414

1515
runs-on: ${{ matrix.os }}
1616

@@ -42,14 +42,7 @@ jobs:
4242
fmt \
4343
nlohmann-json
4444
45-
- name: Install dependencies (Windows)
46-
if: runner.os == 'Windows'
47-
run: |
48-
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
49-
vcpkg install curl spdlog fmt nlohmann-json
50-
51-
- name: Configure CMake (Linux/macOS)
52-
if: runner.os != 'Windows'
45+
- name: Configure CMake
5346
run: |
5447
mkdir -p build
5548
cd build
@@ -59,37 +52,16 @@ jobs:
5952
cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
6053
fi
6154
62-
- name: Configure CMake (Windows)
63-
if: runner.os == 'Windows'
64-
run: |
65-
mkdir build
66-
cd build
67-
cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ..
68-
69-
- name: Build (Linux/macOS)
70-
if: runner.os != 'Windows'
55+
- name: Build
7156
run: |
7257
cd build
7358
cmake --build . --parallel $(nproc 2>/dev/null || sysctl -n hw.ncpu)
7459
75-
- name: Build (Windows)
76-
if: runner.os == 'Windows'
77-
run: |
78-
cd build
79-
cmake --build . --config Release --parallel
80-
81-
- name: Run unit tests (Linux/macOS)
82-
if: runner.os != 'Windows'
60+
- name: Run unit tests
8361
run: |
8462
cd build
8563
ctest --output-on-failure --verbose
8664
87-
- name: Run unit tests (Windows)
88-
if: runner.os == 'Windows'
89-
run: |
90-
cd build
91-
ctest -C Release --output-on-failure --verbose
92-
9365
code-coverage:
9466
runs-on: ubuntu-latest
9567

CMakeLists.txt

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ option(BUILD_TESTS "Build tests" OFF)
4444
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
4545

4646
# Platform-specific configuration
47-
if(WIN32)
48-
# Windows uses odbc32
49-
set(ODBC_LIBRARIES odbc32)
50-
elseif(APPLE)
47+
if(APPLE)
5148
# macOS: Prefer Homebrew paths on Apple Silicon
5249
if(NOT CMAKE_PREFIX_PATH AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
5350
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew")
@@ -185,28 +182,15 @@ set_target_properties(databricks_sdk PROPERTIES
185182
SOVERSION ${PROJECT_VERSION_MAJOR}
186183
)
187184

188-
# Set RPATH for finding ODBC libraries at runtime (Unix/Linux/macOS only)
189-
if(NOT WIN32)
190-
# Use RPATH to find shared libraries relative to executable
191-
set_target_properties(databricks_sdk PROPERTIES
192-
BUILD_RPATH "${ODBC_LIBRARY_DIR};/usr/local/lib;/opt/homebrew/lib;/opt/local/lib"
193-
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;/usr/local/lib;/opt/homebrew/lib;/opt/local/lib"
194-
INSTALL_RPATH_USE_LINK_PATH TRUE
195-
)
196-
endif()
185+
# Set RPATH for finding ODBC libraries at runtime
186+
set_target_properties(databricks_sdk PROPERTIES
187+
BUILD_RPATH "${ODBC_LIBRARY_DIR};/usr/local/lib;/opt/homebrew/lib;/opt/local/lib"
188+
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;/usr/local/lib;/opt/homebrew/lib;/opt/local/lib"
189+
INSTALL_RPATH_USE_LINK_PATH TRUE
190+
)
197191

198-
# Compiler warnings and definitions
199-
if(MSVC)
200-
target_compile_options(databricks_sdk PRIVATE /W4)
201-
target_compile_definitions(databricks_sdk
202-
PRIVATE
203-
NOMINMAX # Prevent min/max macros
204-
NOGDI # Prevent GDI macros (including ERROR)
205-
WIN32_LEAN_AND_MEAN # Reduce Windows header bloat
206-
)
207-
else()
208-
target_compile_options(databricks_sdk PRIVATE -Wall -Wextra -Wpedantic)
209-
endif()
192+
# Compiler warnings
193+
target_compile_options(databricks_sdk PRIVATE -Wall -Wextra -Wpedantic)
210194

211195
# Examples
212196
if(BUILD_EXAMPLES)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Thank you for your interest in contributing to the Databricks C++ SDK! This docu
1414

1515
### Prerequisites
1616

17-
- C++17 compatible compiler (GCC 7+, Clang 5+, MSVC 2017+)
17+
- C++17 compatible compiler (GCC 7+, Clang 5+)
1818
- CMake 3.14 or higher
1919
- ODBC Driver Manager (unixODBC on Linux/macOS)
2020
- [Simba Spark ODBC Driver](https://www.databricks.com/spark/odbc-drivers-download)
@@ -248,7 +248,7 @@ TEST(ClientTest, QueryWithValidParameters) {
248248
4. **Style**: Does it follow project conventions?
249249
5. **Performance**: Any performance implications?
250250
6. **Security**: Any security concerns?
251-
7. **Compatibility**: Works on Linux/macOS/Windows?
251+
7. **Compatibility**: Works on Linux/macOS?
252252

253253
### Responding to Feedback
254254

examples/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ target_link_libraries(unity_catalog_example PRIVATE databricks_sdk)
2020
add_executable(secrets_example secrets_example.cpp)
2121
target_link_libraries(secrets_example PRIVATE databricks_sdk)
2222

23-
# Windows-specific definitions for all examples
24-
if(MSVC)
25-
set(ALL_EXAMPLES simple_query jobs_example compute_example unity_catalog_example secrets_example)
26-
foreach(example ${ALL_EXAMPLES})
27-
target_compile_definitions(${example}
28-
PRIVATE
29-
NOMINMAX # Prevent min/max macros
30-
NOGDI # Prevent GDI macros (including ERROR)
31-
WIN32_LEAN_AND_MEAN # Reduce Windows header bloat
32-
)
33-
endforeach()
34-
endif()
35-
3623
# Set RPATH for all examples to find ODBC libraries
3724
set_target_properties(
3825
simple_query

include/databricks/internal/secure_string.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
#include <cstring>
77
#include <memory>
88
#include <string>
9-
10-
#ifdef _WIN32
11-
# include <windows.h>
12-
#else
13-
# include <sys/mman.h>
14-
#endif
9+
#include <sys/mman.h>
1510

1611
namespace databricks {
1712
namespace internal {
@@ -86,26 +81,16 @@ template <typename T> class SecureAllocator {
8681
* @brief Lock memory pages to prevent swapping to disk
8782
*/
8883
static void lock_memory(void* ptr, size_type size) noexcept {
89-
#ifdef _WIN32
90-
// Use VirtualLock on Windows
91-
// Ignore failures - locking is best-effort
92-
VirtualLock(ptr, size);
93-
#else
9484
// Use mlock on POSIX systems
9585
// Ignore failures - locking is best-effort
9686
mlock(ptr, size);
97-
#endif
9887
}
9988

10089
/**
10190
* @brief Unlock memory pages
10291
*/
10392
static void unlock_memory(void* ptr, size_type size) noexcept {
104-
#ifdef _WIN32
105-
VirtualUnlock(ptr, size);
106-
#else
10793
munlock(ptr, size);
108-
#endif
10994
}
11095

11196
/**

src/core/client.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#include <stdexcept>
2020
#include <thread>
2121

22-
#ifdef _WIN32
23-
# include <windows.h>
24-
#endif
2522
#include <sql.h>
2623
#include <sqlext.h>
2724

tests/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ FetchContent_Declare(
88
GIT_TAG v1.14.0
99
)
1010

11-
# For Windows: Prevent overriding the parent project's compiler/linker settings
1211
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
1312

1413
FetchContent_MakeAvailable(googletest)
@@ -42,16 +41,6 @@ target_include_directories(unit_tests
4241
${CMAKE_CURRENT_SOURCE_DIR}/mocks
4342
)
4443

45-
# Windows-specific definitions
46-
if(MSVC)
47-
target_compile_definitions(unit_tests
48-
PRIVATE
49-
NOMINMAX # Prevent min/max macros
50-
NOGDI # Prevent GDI macros (including ERROR)
51-
WIN32_LEAN_AND_MEAN # Reduce Windows header bloat
52-
)
53-
endif()
54-
5544
# Discover and register Google Test cases
5645
include(GoogleTest)
5746
gtest_discover_tests(unit_tests)

0 commit comments

Comments
 (0)