3333 matrix :
3434 os : [ubuntu-22.04]
3535 odbc_provider : [UnixODBC]
36- compiler : [Clang]
36+ compiler : [Clang, GCC ]
3737 build_type : [Debug, Release]
3838 architecture : [x86_64]
39- runtime_link : [static-runtime, dynamic-runtime]
40- third_parties : [bundled-third-parties, system-third-parties]
4139 # exclude:
4240 # - os: ubuntu-18.04
4341 # compiler: Clang
6664 sudo apt update -q
6765 sudo apt remove -y php* node* mysql* mssql-tools
6866 sudo apt upgrade -y
69- sudo apt install -y build-essential git cmake docker perl libdbi-perl libdbd-odbc-perl python-is-python3 python3 python3-pip python3-setuptools libpoco-dev libssl-dev libicu-dev
67+ sudo apt install -y build-essential git cmake docker perl libdbi-perl libdbd-odbc-perl python-is-python3 python3 python3-pip python3-setuptools
7068
7169 - name : Install dependencies - UnixODBC
7270 if : ${{ matrix.odbc_provider == 'UnixODBC' }}
8280
8381 - name : Install dependencies - GCC
8482 if : ${{ matrix.compiler == 'GCC' }}
85- run : sudo apt install -y gcc g++ gdb
83+ # GCC 12 is the oldest GCC with adequate C++23 support; Ubuntu 22.04 defaults to GCC 11.
84+ run : sudo apt install -y gcc-12 g++-12 gdb
8685
8786 - name : Install dependencies - Cleanup
8887 run : sudo apt autoremove -y
@@ -105,14 +104,12 @@ jobs:
105104 )
106105 dsn_string=$(IFS=';'; echo "${dsn_list[*]}")
107106
108- CC=${{ fromJSON('{"Clang": "clang", "GCC": "gcc"}')[matrix.compiler] }} \
109- CXX=${{ fromJSON('{"Clang": "clang++", "GCC": "g++"}')[matrix.compiler] }} \
107+ CC=${{ fromJSON('{"Clang": "clang", "GCC": "gcc-12 "}')[matrix.compiler] }} \
108+ CXX=${{ fromJSON('{"Clang": "clang++", "GCC": "g++-12 "}')[matrix.compiler] }} \
110109 cmake -S ${{ github.workspace }}/source -B ${{ github.workspace }}/build \
111110 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
112111 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
113112 -DODBC_PROVIDER=${{ matrix.odbc_provider }} \
114- -DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }} \
115- -DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }} \
116113 -DTEST_DSN_LIST="$dsn_string" \
117114 -DBUILD_TESTING=YES
118115
@@ -134,6 +131,21 @@ jobs:
134131 done
135132 exit $rc
136133
134+ - name : Check driver does not depend on a shared C++ runtime
135+ working-directory : ${{ github.workspace }}/build/driver
136+ run : |
137+ rc=0
138+ for f in libclickhouseodbc.so libclickhouseodbcw.so; do
139+ if readelf -dW "$f" | grep -E 'NEEDED.*\b(libstdc\+\+|libgcc_s)\b'; then
140+ echo "FAIL (shared C++ runtime dependency): $f"; rc=1
141+ elif readelf -VW "$f" | grep -qE 'GLIBCXX_|CXXABI_'; then
142+ echo "FAIL (libstdc++ symbol version requirement): $f"; rc=1
143+ else
144+ echo "ok (static C++ runtime): $f"
145+ fi
146+ done
147+ exit $rc
148+
137149 - name : Package
138150 run : cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} --target package
139151
@@ -143,7 +155,7 @@ jobs:
143155 ls -lahR ${{ github.workspace }}/build/
144156
145157 - name : Upload the artifacts
146- if : ${{ matrix.odbc_provider == 'UnixODBC' && matrix.build_type == 'Release' && matrix.runtime_link == 'dynamic-runtime' && matrix.third_parties == 'bundled-third-parties' }}
158+ if : ${{ matrix.odbc_provider == 'UnixODBC' && matrix.build_type == 'Release' }}
147159 uses : actions/upload-artifact@v4
148160 with :
149161 name : clickhouse-odbc-linux-${{ matrix.compiler }}-${{ matrix.odbc_provider }}-${{ matrix.build_type }}
0 commit comments