Skip to content
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

Revamp CMake support #1118

Open
wants to merge 103 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
0d85e89
First draft of new cmake
Krzmbrzl Jan 3, 2024
9e7c5db
Fix typo
Krzmbrzl Jan 3, 2024
579a099
Delete FindSoci.cmake - will be replaced by SociConfig
Krzmbrzl Jan 3, 2024
c2dcce7
Updated find modules to define interface targets
Krzmbrzl Jan 3, 2024
4a378ed
Remove redundant condition in endif()
Krzmbrzl Jan 3, 2024
926bfbb
SOCI_HAVE_CXX11 doesn't exist anymore
Krzmbrzl Jan 3, 2024
1ccc218
Configure soci-config.h (empty for now)
Krzmbrzl Jan 3, 2024
ec64b18
Disable Boost support by default
Krzmbrzl Jan 3, 2024
1489077
Oracle: Remove non-existing CPP source
Krzmbrzl Jan 3, 2024
074bdf2
Improved target setup
Krzmbrzl Feb 16, 2024
456a8cc
Include building tests
Krzmbrzl Feb 17, 2024
bb86d44
Add options to configure test connection strings
Krzmbrzl Feb 17, 2024
0e5c799
CI: ODBC now also uses the default runner
Krzmbrzl Feb 17, 2024
f49841c
Bring ODBC tests up to speed
Krzmbrzl Feb 17, 2024
b593a29
Expose ODBC test connector strings
Krzmbrzl Feb 17, 2024
672213c
Use dedicated test context
Krzmbrzl Feb 17, 2024
207e17e
Adapt ODBC test exclusion RegEx
Krzmbrzl Feb 17, 2024
dd5e3dd
Build shared and static libs separately
Krzmbrzl Feb 25, 2024
cd401e4
Add missing include
Krzmbrzl Feb 25, 2024
1564540
Fixed Windows build
Krzmbrzl Feb 25, 2024
342bcb4
Don't overwrite cxx standard
Krzmbrzl Feb 25, 2024
646f2fe
Enable unity builds on CI
Krzmbrzl Feb 25, 2024
921ca59
Specify config for ctest on Windows
Krzmbrzl Feb 25, 2024
1353f18
Fix DSN file paths for ODBC tests
Krzmbrzl Feb 25, 2024
eaf2994
Select ODBC tests based on available drivers
Krzmbrzl Feb 25, 2024
3540780
Use unity builds also on Windows CI
Krzmbrzl Feb 25, 2024
980d4c9
Also skip MS Access ODBC test
Krzmbrzl Feb 25, 2024
5214951
Fix print statement
Krzmbrzl Feb 25, 2024
501be49
Fix driver detection
Krzmbrzl Feb 25, 2024
e96633a
Properly generate soci-config.h
Krzmbrzl Feb 27, 2024
ec3984e
Install recent cmake version on AppVeyor CI
Krzmbrzl Feb 27, 2024
f5ab470
Remove unneeded debug message
Krzmbrzl Feb 29, 2024
241af7d
Configure compiler options
Krzmbrzl Feb 29, 2024
5f65bb5
Update CMake examples
Krzmbrzl Feb 29, 2024
5150a51
Get rid of deprecated Makefiles
Krzmbrzl Feb 29, 2024
acd1294
Build Boost bindings by default on CI
Krzmbrzl Feb 29, 2024
aea1958
Provide compat for old WITH_BOOST var
Krzmbrzl Feb 29, 2024
47c05f3
Add compat to old target names
Krzmbrzl Feb 29, 2024
e2c1a53
Disable Boost bindings on macOS CI
Krzmbrzl Feb 29, 2024
a868715
Properly set ABI version macro
Krzmbrzl Feb 29, 2024
9defe9b
Start setting up install support
Krzmbrzl Mar 1, 2024
35f0f92
More work on installation support
Krzmbrzl Apr 13, 2024
b7d56a0
Make all components installable
Krzmbrzl Apr 23, 2024
baecbb2
Improve config file
Krzmbrzl Apr 23, 2024
eba5926
Remove WITH_BOOST/SOCI_BOOST option
Krzmbrzl Apr 23, 2024
fa97a69
Properly set ABI version & runtime search paths
Krzmbrzl Apr 23, 2024
f9b1805
Move template specialization to cpp file
Krzmbrzl Apr 25, 2024
f4af355
Fix using macro as function
Krzmbrzl Apr 25, 2024
e255daa
CI: Don't use no longer existent WITH_BOOST option
Krzmbrzl Apr 25, 2024
9e123c6
Fix LTO in debug builds
Krzmbrzl Apr 25, 2024
8bceabe
Fix macro name
Krzmbrzl May 1, 2024
d611b7d
AppVeyor: Use actually available Boost versions
Krzmbrzl May 1, 2024
1efdcce
AppVeyor: Use more up-to-date PostgreSQL
Krzmbrzl May 1, 2024
b111ec1
AppVeyor: Properly locate SQLite
Krzmbrzl May 1, 2024
7bcdd9a
Ensure MySQL is found in vcpkg context
Krzmbrzl May 19, 2024
24feb96
Disable Boost autolinking on Windows
Krzmbrzl May 20, 2024
1098208
AppVeyor: Use Ninja for faster builds
Krzmbrzl May 20, 2024
2de4a69
Mark dependency's includes as SYSTEM
Krzmbrzl May 20, 2024
f38e222
Restrict to only using target-specific compiler flags
Krzmbrzl May 20, 2024
81cd483
Base macro defs on platform not compiler
Krzmbrzl May 20, 2024
d5f70a1
Tame the Windows API headers
Krzmbrzl May 20, 2024
7071264
AppVeyor: Use MSVC instead of Clang
Krzmbrzl May 20, 2024
c4895b3
remove unnecessary winsock include
Krzmbrzl May 24, 2024
9231cd0
Fix Windows build with UNICODE macro
Krzmbrzl May 24, 2024
1252be7
Get rid of SOCI_DUMMY_RETURN
Krzmbrzl May 20, 2024
1e0e1dd
Add override specs
Krzmbrzl May 27, 2024
c616644
Make include less confusing
Krzmbrzl May 30, 2024
e8cc701
Improve FindMySQL
Krzmbrzl May 28, 2024
8283a38
Change fatal error to debug message
Krzmbrzl Jun 2, 2024
b6b31be
Prevent compiler flags from propagating to superprojects
Krzmbrzl Jun 2, 2024
08eb273
Link core to DL libraries
Krzmbrzl Jun 2, 2024
21515f2
Remove debug message
Krzmbrzl Aug 25, 2024
a2faea6
Don't set output directories
Krzmbrzl Aug 31, 2024
6a106e7
Also use versioned .so install for MySQL
Krzmbrzl Sep 1, 2024
f4e01a4
Re-introduce explicit build artefact directories
Krzmbrzl Sep 1, 2024
8d14ee4
Rework install paths
Krzmbrzl Sep 1, 2024
a74341c
Update example
Krzmbrzl Sep 1, 2024
6b6db13
Fix not all headers getting installed
Krzmbrzl Sep 1, 2024
efe3a05
Work around bug in VS2015
Krzmbrzl Sep 1, 2024
c88da3b
Merge remote-tracking branch 'upstream/master' into revamp-cmake
Krzmbrzl Jan 1, 2025
c2d0d15
Don't include test-main.cpp in unity builds
Krzmbrzl Jan 3, 2025
a780c39
Enable unity builds on AppVeyor
Krzmbrzl Jan 3, 2025
858d585
Actually set compiler flags for UBSAN
Krzmbrzl Jan 3, 2025
1d7b086
Use standard checkout action
Krzmbrzl Jan 3, 2025
0709bb2
Give acion runs better names
Krzmbrzl Jan 3, 2025
17c0884
Simplify build matrix
Krzmbrzl Jan 3, 2025
815b9b7
Default destructor
Krzmbrzl Jan 3, 2025
fac29fe
Remove redundant space
Krzmbrzl Jan 3, 2025
0db29f6
Add comment back in
Krzmbrzl Jan 3, 2025
9244c88
Fix bug in soci_verify_parsed_arguments
Krzmbrzl Jan 3, 2025
af92da7
Properly integrate new type check with new cmake layout
Krzmbrzl Jan 3, 2025
5bd4138
Centralized backend list; AsAvailable->AUTO
Krzmbrzl Jan 9, 2025
0ab30db
Use GLOB to identify headers to install
Krzmbrzl Jan 9, 2025
0a8c07d
Make SOCIConfig work even if SOCI is capitalized differently
Krzmbrzl Jan 26, 2025
a317037
Avoid warnings in newer CMake versions
Krzmbrzl Jan 26, 2025
77c2e17
De-duplicate boilerplate by using function to define backend target
Krzmbrzl Jan 26, 2025
f9c5408
Merge remote-tracking branch 'upstream/master' into revamp-cmake
Krzmbrzl Jan 26, 2025
af3e8a9
Fix typo
Krzmbrzl Jan 26, 2025
2cd6349
Make common test actually be part of common-tests
Krzmbrzl Jan 26, 2025
7c6dd57
Consistently use SOCI::soci as interface target
Krzmbrzl Jan 26, 2025
6628f9c
Add missing curly brace
Krzmbrzl Jan 26, 2025
71d3911
Update connect example's CMakeLists.txt file
Krzmbrzl Jan 26, 2025
31324e0
CI: Also build example testing SOCI system installations
Krzmbrzl Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 39 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,85 +29,61 @@ on:

jobs:
build:
runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
lib_type: [shared, static]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doubles the number of builds and I'm not sure if it's worth it... Maybe it would be enough to test just some static builds instead of testing all of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the Windows CI these are really cheap to do. Besides, previously SOCI did this duplication anyway due to building shared and static libraries in a single build. So effectively, this is reproducing the original behavior (plus some extra overhead of these things now actually being different build jobs).

Finally, it is a bit of a hassle to specify that only some combinations shall be built as a static library in GitHub Action syntax. Therefore, I would tend to just keep all tests 👀

# Can't test DB2 as required db2exc package is no longer available after Ubuntu 14.04
backend: [SQLite3, PostgreSQL, MySQL, Firebird, Oracle, ODBC, Empty, Valgrind]
runner: [ubuntu-22.04]
include:
# Note: the jobs are ordered in the order of decreasing running
# time, as this should minimize the total run-time of all jobs.
- backend: postgresql
- lib_type: shared
backend: Empty
runner: macos-14
name: PostgreSQL macOS
- backend: oracle
name: Oracle 11
no_boost: true
- backend: valgrind
name: Valgrind
- backend: odbc
# There are many leak reports under Ubuntu 22.04, see #1008.
container: ubuntu:18.04
name: ODBC
# UBSAN gives nonsensical errors on this system, to be reviewed
# after migrating to newer Ubuntu and compiler versions.
no_ubsan: true
- backend: firebird
name: Firebird
- backend: postgresql
name: PostgreSQL Linux
- backend: mysql
name: MySQL
- backend: sqlite3
- lib_type: shared
backend: PostgreSQL
runner: macos-14
name: SQLite3 macOS
- backend: sqlite3
name: SQLite3 C++17
cxxstd: 17
- backend: sqlite3
name: SQLite3
- backend: empty
no_boost: true
- lib_type: shared
backend: SQLite3
runner: macos-14
name: Empty macOS
- backend: empty
name: Empty
no_boost: true
- lib_type: shared
backend: Oracle
runner: ubuntu-22.04
no_boost: true
- lib_type: shared
backend: SQLite3
runner: ubuntu-22.04
Krzmbrzl marked this conversation as resolved.
Show resolved Hide resolved
cxxstd: 17
name: SQLite3 Cxx17
- lib_type: shared
backend: Empty
test_release_package: true
# Unsupported: db2exc package is only available in Ubuntu 14.04 not
# supported by GitHub Actions any longer, we'd need to run it in
# Docker container if we really need it.
# backend: db2
- backend: empty
name: Examples
name: Release package
- lib_type: shared
backend: Empty
build_examples: true
name: Examples

runs-on: ${{ matrix.runner }}
name: ${{ format('{0} on {1}', (matrix.name != '' && matrix.name || format('{0} ({1})', matrix.backend, matrix.lib_type)), matrix.runner) }}

env:
SOCI_CI: true
SOCI_CI_BACKEND: ${{ matrix.backend }}
SOCI_MYSQL_ROOT_PASSWORD: root
ASAN_OPTIONS: fast_unwind_on_malloc=0
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
SOCI_CXXSTD: 14

steps:
- name: Checkout
run: |
case "${{matrix.container}}" in
ubuntu:18.04)
export DEBIAN_FRONTEND=noninteractive

apt-get update -qq
apt-get install -qq git
;;
esac

git config --global init.defaultBranch master
git config --global --add safe.directory `pwd`
git config --global advice.detachedHead false
git init .
git remote add origin https://github.com/SOCI/soci.git
git fetch --depth=1 origin $GITHUB_SHA
git checkout FETCH_HEAD
uses: actions/checkout@v4

- name: Set environment variables
shell: bash
run: |
set_env_var() {
echo "Setting environment variable $1=$2"
Expand All @@ -130,14 +106,6 @@ jobs:
;;
esac

case "${{matrix.container}}" in
ubuntu:18.04)
# We need to use this option as GitHub certificate is not recognized by
# wget in this old container otherwise.
set_env_var SOCI_WGET_OPTIONS --no-check-certificate
;;
esac

if [ -n "${{matrix.cxxstd}}" ]; then
set_env_var SOCI_CXXSTD ${{matrix.cxxstd}}
fi
Expand All @@ -150,15 +118,15 @@ jobs:
if [ "${{matrix.build_examples}}" = true ]; then
set_env_var BUILD_EXAMPLES YES
fi
if [ "${{matrix.no_ubsan}}" = true ]; then
set_env_var SOCI_NO_UBSAN 1
else
set_env_var UBSAN_OPTIONS print_stacktrace=1:halt_on_error=1
if [ "${{matrix.lib_type}}" = "static" ]; then
set_env_var SOCI_BUILD_STATIC YES
fi
# Ensure SOCI_CI_BACKEND is always lowercase
set_env_var SOCI_CI_BACKEND "$( echo "$SOCI_CI_BACKEND" | tr '[:upper:]' '[:lower:]' )"

- name: Setup tmate
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.enable_ssh }}
uses: mxschmitt/action-tmate@v3

- name: Install dependencies
run: ./scripts/ci/install.sh
Expand Down
Loading