Skip to content

Commit

Permalink
Merge pull request #456 from ClickHouse/add_windows
Browse files Browse the repository at this point in the history
Change build system with windows support
  • Loading branch information
alesapin authored Oct 2, 2024
2 parents 1996aba + c2a75a3 commit 785957e
Show file tree
Hide file tree
Showing 1,425 changed files with 413,001 additions and 339 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04]
odbc_provider: [UnixODBC, iODBC]
compiler: [Clang, GCC]
odbc_provider: [UnixODBC]
compiler: [Clang]
build_type: [Debug, Release]
architecture: [x86_64]
runtime_link: [static-runtime, dynamic-runtime]
Expand Down
180 changes: 80 additions & 100 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-11]
odbc_provider: [UnixODBC, iODBC]
# Once folly supports new clang (libcpp) add Clang to compilers:
compiler: [AppleClang, GCC]
os: [macos-latest]
odbc_provider: [UnixODBC]
compiler: [AppleClang]
build_type: [Debug, Release]
architecture: [x86_64]
runtime_link: [dynamic-runtime]
third_parties: [bundled-third-parties]

Expand Down Expand Up @@ -63,23 +61,14 @@ jobs:
brew update
brew remove -f --ignore-dependencies -q libiodbc unixodbc freetds php node composer
brew upgrade
brew install git cmake perl python openssl poco icu4c binutils
pip3 install --user 'testflows==1.6.56'
# - name: Install dependencies - Docker
# run: |
# brew install --cask docker
# open /Applications/Docker.app
brew install git cmake perl python openssl poco icu4c binutils curl
pip3 install --break-system-packages --user 'testflows==1.6.56'
- name: Install dependencies - UnixODBC
if: ${{ matrix.odbc_provider == 'UnixODBC' }}
run: |
brew install unixodbc
pip3 install --user pyodbc
- name: Install dependencies - iODBC
if: ${{ matrix.odbc_provider == 'iODBC' }}
run: brew install libiodbc
pip3 install --break-system-packages --user pyodbc
# Right now folly fails to compile and link against brew's clang & libcpp versions 11-14
# Since Clang is removed from list of compilers in matrix, this will not be executed.
Expand All @@ -93,6 +82,12 @@ jobs:
brew install gcc gdb
export COMPILER_PATH=$(brew prefix gcc)/bin
- name: Start ClickHouse server in background
run: |
curl https://clickhouse.com | bash
sudo ./clickhouse install
sudo ./clickhouse start
- name: Configure
run: >
CC=${{ fromJSON('{"AppleClang": "cc", "Clang": "/usr/local/opt/llvm/bin/clang", "GCC": "$COMPILER_PATH/gcc-11"}')[matrix.compiler] }}
Expand Down Expand Up @@ -128,88 +123,73 @@ jobs:
working-directory: ${{ github.workspace }}/build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} -R '.*-ut.*'

# - name: Test - Start ClickHouse server in background
# run: |
# docker pull ${CLICKHOUSE_SERVER_IMAGE}
# docker run -d --name clickhouse ${CLICKHOUSE_SERVER_IMAGE}
# docker ps -a
# docker stats -a --no-stream

# - name: Test - Run integration tests
# working-directory: ${{ github.workspace }}/build
# run: |
# export CLICKHOUSE_SERVER_IP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' clickhouse)

# export ODBCSYSINI=${{ github.workspace }}/run
# export ODBCINSTINI=.odbcinst.ini
# export ODBCINI=$ODBCSYSINI/.odbc.ini
# if [[ "${{ matrix.odbc_provider }}" == "iODBC" ]]; then
# # Full path to a custom odbcinst.ini in ODBCINSTINI for iODBC.
# export ODBCINSTINI=$ODBCSYSINI/$ODBCINSTINI
# fi

# cat > $ODBCSYSINI/.odbcinst.ini <<-EOF
# [ODBC]
# Trace = 1
# TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
# Debug = 1
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log

# [ODBC Drivers]
# ClickHouse ODBC Driver (ANSI) = Installed
# ClickHouse ODBC Driver (Unicode) = Installed

# [ClickHouse ODBC Driver (ANSI)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# UsageCount = 1

# [ClickHouse ODBC Driver (Unicode)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# UsageCount = 1
# EOF

# cat > $ODBCSYSINI/.odbc.ini <<-EOF
# [ODBC]
# Trace = 1
# TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
# Debug = 1
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log

# [ODBC Data Sources]
# ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
# ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
# ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)

# [ClickHouse DSN (ANSI)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log

# [ClickHouse DSN (Unicode)]
# Driver = ClickHouse ODBC Driver (Unicode)
# Description = Test DSN for ClickHouse ODBC Driver (Unicode)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log

# [ClickHouse DSN (ANSI, RBWNAT)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
# Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
# EOF

# if [[ "${{ matrix.odbc_provider }}" == "iODBC" ]]; then
# export GTEST_FILTER="-PerformanceTest.*"
# fi

# # Run all tests except those that were run in "Test - unit tests" step.
# ctest --output-on-failure --build-config ${{ matrix.build_type }} -E '.*-ut.*'
- name: Test - Run integration tests
working-directory: ${{ github.workspace }}/build
run: |
export CLICKHOUSE_SERVER_IP=127.0.0.1
export ODBCSYSINI=${{ github.workspace }}/run
export ODBCINSTINI=.odbcinst.ini
export ODBCINI=$ODBCSYSINI/.odbc.ini
cat > $ODBCSYSINI/.odbcinst.ini <<-EOF
[ODBC]
Trace = 1
TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
Debug = 1
DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log
[ODBC Drivers]
ClickHouse ODBC Driver (ANSI) = Installed
ClickHouse ODBC Driver (Unicode) = Installed
[ClickHouse ODBC Driver (ANSI)]
Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.dylib
Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.dylib
UsageCount = 1
[ClickHouse ODBC Driver (Unicode)]
Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.dylib
Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.dylib
UsageCount = 1
EOF
cat > $ODBCSYSINI/.odbc.ini <<-EOF
[ODBC]
Trace = 1
TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
Debug = 1
DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log
[ODBC Data Sources]
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
[ClickHouse DSN (ANSI)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
[ClickHouse DSN (Unicode)]
Driver = ClickHouse ODBC Driver (Unicode)
Description = Test DSN for ClickHouse ODBC Driver (Unicode)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log
[ClickHouse DSN (ANSI, RBWNAT)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
EOF
# Run all tests except those that were run in "Test - unit tests" step.
ctest --output-on-failure --build-config ${{ matrix.build_type }} -E '.*-ut.*'
- name: Upload artifacts as release assets
if: ${{ github.event_name == 'release' && matrix.build_type == 'Release' }}
Expand All @@ -219,4 +199,4 @@ jobs:
file: ${{ github.workspace }}/build/clickhouse-odbc-*
overwrite: true
tag: ${{ github.ref }}
file_glob: true
file_glob: true
47 changes: 32 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
[submodule "contrib/poco"]
path = contrib/poco
url = https://github.com/ClickHouse-Extras/poco.git
branch = clickhouse-odbc
[submodule "contrib/ssl"]
path = contrib/ssl
url = https://github.com/ClickHouse-Extras/ssl.git
branch = master
[submodule "contrib/nanodbc"]
path = contrib/nanodbc
url = https://github.com/nanodbc/nanodbc.git
branch = master
[submodule "contrib/googletest"]
path = contrib/googletest
url = https://github.com/google/googletest.git
branch = master
[submodule "contrib/icu"]
path = contrib/icu
url = https://github.com/ClickHouse/icu.git
[submodule "contrib/icudata"]
path = contrib/icudata
url = https://github.com/ClickHouse/icudata
[submodule "contrib/UnixODBC"]
path = contrib/unixodbc
url = https://github.com/ClickHouse/UnixODBC.git
[submodule "contrib/nanodbc"]
path = contrib/nanodbc
url = https://github.com/ClickHouse/nanodbc.git
[submodule "contrib/llvm-project"]
path = contrib/llvm-project
url = https://github.com/ClickHouse/llvm-project
[submodule "contrib/zlib-ng"]
path = contrib/zlib-ng
url = https://github.com/ClickHouse/zlib-ng.git
[submodule "contrib/lz4"]
path = contrib/lz4
url = https://github.com/ClickHouse/lz4
[submodule "contrib/openssl"]
path = contrib/openssl
url = https://github.com/ClickHouse/openssl
[submodule "contrib/folly"]
path = contrib/folly
url = https://github.com/facebook/folly.git
branch = master
path = contrib/folly
url = https://github.com/facebook/folly.git
[submodule "contrib/double-conversion"]
path = contrib/double-conversion
url = https://github.com/ClickHouse/double-conversion
[submodule "contrib/libunwind"]
path = contrib/libunwind
url = https://github.com/ClickHouse/libunwind
Loading

0 comments on commit 785957e

Please sign in to comment.