Commit Graph

120 Commits

Author SHA1 Message Date
Vadim Zeitlin
5e9f200001 Read entire Oracle CLOB and not just its length in characters
We need to read the entire contents of the CLOB in Oracle backend and
not just the number of bytes corresponding to its length in characters
as returned by OCILobGetLength() because this may (and will) be strictly
less than its full size in bytes for any encoding using multiple bytes
per character, such as the de facto standard UTF-8.

Also make reading CLOBs more efficient by doing what Oracle
documentation suggests and using the LOB chunk size for reading.

Finally, add a unit test checking that using non-ASCII strings in UTF-8
(which had to be enabled for the CI) with CLOBs does work.

This commit is best viewed ignoring whitespace-only changes.
2024-11-20 00:35:15 +01:00
Vadim Zeitlin
80128a18d1 Enable UBSAN for all non-Ubuntu 18.04 CI builds
UBSAN gives nonsensical errors for the ODBC job running under Ubuntu
18.04, e.g. it complains that

src/core/session.cpp:246:16: runtime error: member call on address
0x607000000250 which does not point to an object of type
'session_backend'
1: 0x607000000250: note: object is of type 'soci::odbc_session_backend'

which doesn't make any sense because odbc_session_backend is an object
of type session_backend. But apparently something is broken in this
compiler version, so disable UBSAN for this job for now.
2024-10-16 17:11:43 +02:00
Vadim Zeitlin
689e349b84 Explicitly install postgresql@14 with brew
Installing just "postgresql" results in an annoying warning about the
formula having been renamed to "postgresql@14".
2024-10-16 16:00:00 +02:00
Vadim Zeitlin
698495c33b Install PostgreSQL ourselves in macOS CI workflow
It used to be part of macos-12 image but is not present in the later
ones for whatever reason.

Installing postgresql formula using brew already initializes the
database cluster but does it in a non-default directory, so adjust
PGDATA definition accordingly and remove "pg_ctl init" which is not
needed any longer.
2024-10-16 15:50:56 +02:00
Vadim Zeitlin
4a7b72ea53 Disable GitHub certificate check under Ubuntu 18.04
wget doesn't recognize it for some reason under this old OS, so just
disable it to be able to download mold there.
2023-12-11 17:21:18 +01:00
Vadim Zeitlin
957a4352df Don't pipe wget output to tar during mold installation
This hides any errors during download, making any issues difficult to
diagnose, so break the pipeline in parts in order to better see what is
going on.
2023-12-11 17:03:59 +01:00
Vadim Zeitlin
4119e7d209 Trace shell scripts when using GitHub Actions debug output
This should give more information when rerunning failed actions with
debug output enabled.
2023-12-11 16:46:12 +01:00
Vadim Zeitlin
f6c8aa8203 Add missing "sudo" calls to mold installation step
Also install wget when running on minimal system without it.
2023-12-11 15:17:04 +01:00
Vadim Zeitlin
9f7722b477 Use mold for GitHub Actions builds 2023-12-07 22:00:08 +01:00
Vadim Zeitlin
249d1a4704 Fix CI install script to work on bare OS install too
Don't assume that sudo and lsb-release are always available, this is not
the case when using a Docker container image, for example.
2023-04-18 18:20:45 +02:00
Vadim Zeitlin
193ef4ddf8 Install PostgreSQL server in ODBC install script
It is needed and is not guaranteed to be already installed when running
inside a container.
2023-04-18 18:19:33 +02:00
Vadim Zeitlin
d9b499a992 Don't install recommended packages
Try to speed up the installation process a bit by installing fewer
packages.
2023-04-18 18:19:30 +02:00
Vadim Zeitlin
e7b5d1f4cd Ignore leaks from SQLDriverConnect() in Unix ODBC tests
Switching to Debian UnixODBC packages exposed memory leaks in
SQLDriverConnect() that we don't seem to be able to do anything about.
2023-02-23 15:38:02 +01:00
Vadim Zeitlin
bb8ca5481d Also install debug symbols for Unix ODBC package 2023-02-23 15:38:02 +01:00
Vadim Zeitlin
e82fdcdfeb Work around a problem with incompatible unixodbc-dev package
The package already installed on the system results in build errors when
trying to use it:

In file included from /usr/include/sql.h:19:0,
                 from /usr/include/sqlext.h:43,
                 from /home/runner/work/soci/soci/include/soci/odbc/soci-odbc.h:25,
                 from /home/runner/work/soci/soci/src/backends/odbc/factory.cpp:9:
/usr/include/sqltypes.h:56:10: fatal error: unixodbc.h: No such file or directory
 #include "unixodbc.h"
          ^~~~~~~~~~~~

so remove it before installing the Debian version.

See https://github.com/microsoft/linux-package-repositories/issues/36
2023-02-23 15:38:02 +01:00
Vadim Zeitlin
c5adff3925 Add CI build using C++17
This is needed at least to run C++17-only tests.

See #1001.
2022-10-28 00:09:44 +02:00
Vadim Zeitlin
1fd22cf9b1 Remove Microsoft apt repositories before apt-updating
If nothing else, this should speed up the process a little, but it might
also fix spurious errors that we get in CodeQL builds all the time now.
2022-10-27 23:43:13 +02:00
Vadim Zeitlin
e99534f372 Add run_apt function for running apt-get with "quiet" options
Set Dpkg::Use-Pty=0 to avoid more useless output and use this function
in all CI scripts instead of specifying the same apt-get options in all
of them.
2022-10-27 23:26:31 +02:00
Vadim Zeitlin
88e6ca2853 Use /bin/sh for common.sh instead of bash
This script must be sourced from all the other ones, including
install.sh which is used to install bash under FreeBSD, so it can't rely
on bash being already available.
2022-10-27 23:26:31 +02:00
Vadim Zeitlin
0fb07e8aca Use Firebird 3.0 under Ubuntu Jammy too 2022-10-27 23:25:50 +02:00
Vadim Zeitlin
fc3ec8089d Give the name of the unknown Ubuntu release in the error message
No real changes, just make things a bit more clear.
2022-10-27 23:25:50 +02:00
Vadim Zeitlin
fc365a9cc8 Set up MySQL to allow CREATE FUNCTION in the CI builds
This is necessary with MySQL 8.
2022-10-27 23:25:50 +02:00
Vadim Zeitlin
9ecda7e5af Remove SOCI_CI_PACKAGES and always install CMake under Linux
It doesn't make much sense to configure this outside of the installation
script when we can already just install it from the script itself.

No real changes.
2022-10-27 18:27:01 +02:00
Vadim Zeitlin
c1a4b7606f Require C++14 in CMake makefiles
Remove SOCI_CXX11 option which doesn't make sense any longer.
2022-09-18 17:28:57 +02:00
Vadim Zeitlin
98b55bf86c Merge branch 'dont-use-dynamic-cast'
Don't use dynamic cast to avoid ELF visibility problems with libc++.

See #975.
2022-09-17 22:46:19 +02:00
Vadim Zeitlin
0914905949 Fail if there are no tests in the CI builds
This can happen if a backend is unexpectedly not detected and we want to
fail the CI build in this case instead of silently ignoring the problem.
2022-09-17 22:02:09 +02:00
Vadim Zeitlin
2748194f76 Initialize PostgreSQL database under Mac
Otherwise the CI build fails to start the database.
2022-09-14 17:08:27 +02:00
Vadim Zeitlin
fdd704b6c1 Revert "Turn off visibility support for FreeBSD CI builds"
This reverts commit 23e57e3f18 which is
not needed any longer now that the problem with using ELF visibility
with libc++ was fixed.
2022-06-22 16:10:03 +02:00
Vadim Zeitlin
23e57e3f18 Turn off visibility support for FreeBSD CI builds
Using visibility with clang (which is the default FreeBSD compiler)
doesn't work currently, see #913.
2022-06-22 12:29:13 +02:00
Vadim Zeitlin
f9c3d7c07c Move FreeBSD-specific installation commands to install.sh
Try to keep as little logic in the Cirrus CI-specific file as possible,
even if it's just a single command.
2022-06-22 01:44:06 +02:00
Vadim Zeitlin
0cc89c7c6e Only run Linux-specific commands under Linux in install.sh
No real changes, just make sure we don't run apt-get under non-Linux
systems.

This commit is best viewed ignoring whitespace-only changes.
2022-06-22 01:43:53 +02:00
Vadim Zeitlin
f721fa88e0 Detect number of available CPUs under FreeBSD too
This is done using the same command as under Darwin there.
2022-06-22 00:58:41 +02:00
Vadim Zeitlin
69d25bb316 Explicitly turn off Boost support if WITH_BOOST is set to OFF
Pass the option to CMake too, instead of just skipping Boost
installation in this case because this didn't prevent any Boost
libraries already available on the system from being used.
2022-06-21 23:04:50 +02:00
Vadim Zeitlin
282c834159 Use common CMake options in all builds
This was always the intention, but it wasn't actually done, resulting in
not enabling -Werror and, also, building static libraries which is more
or less useless.
2022-06-21 23:04:50 +02:00
Vadim Zeitlin
186128d601 Don't hardcode bash path to improve portability
Under FreeBSD, for example, bash is installed only in /usr/local/bin and
/bin/bash is not available, so use "/usr/bin/env bash" to find it any
location.

As there doesn't seem to be any portable way to pass "-e" option to bash
when using env ("env -S" doesn't work with older GNU coreutils used in
GitHub CI Linux builds), set this option in common.sh once now instead
of doing it on the shebang line of all the scripts.

It would be even better to rewrite the scripts to avoid requiring bash,
but this would require more effort.
2022-06-21 20:09:44 +02:00
Vadim Zeitlin
b8560cca41 Fix typo in a comment in build.bat script
No real changes.
2022-02-16 00:26:15 +01:00
Lukas Zanner
17e8e40d37 Add example build to CI 2022-01-13 21:55:24 +01:00
Ilya Sinitsyn
6fc0cfac6c Suppress FB memory leaks 2021-10-11 21:58:17 +07:00
Ilya Sinitsyn
8a23e534db Enable XXX-dbgsym repositories 2021-10-11 21:42:04 +07:00
Ilya Sinitsyn
c32aae32e5 Setup Oracle library path 2021-10-11 21:42:00 +07:00
Ilya Sinitsyn
8c6701f168 Fix Firebird installation script for Ubuntu Bionic 2021-10-11 21:41:55 +07:00
Ilya Sinitsyn
e873cb507e Fix the postgresql symbols package name for Ubuntu 18.04 2021-10-11 21:41:51 +07:00
Ilya Sinitsyn
a896ea9e89 Don't use ubuntu release name in postgresql packacges names 2021-10-11 21:41:46 +07:00
Vadim Zeitlin
ea2912b0e1 Merge branch 'minor-ci-fixes'
Some minor improvements to the CI scripts, no real changes.
2021-07-10 11:51:50 +02:00
Vadim Zeitlin
b41c0bad46 Add simple CodeQL analysis workflow
Try using CodeQL with SOCI.

As a side effect, also add "all" pseudo-backend for building everything.
2021-07-10 11:51:17 +02:00
Vadim Zeitlin
d1d6f5b632 De-TAB-ify CI build script
Get rid of a stray hard TAB, no real changes.
2021-07-10 11:49:07 +02:00
Vadim Zeitlin
6776adda63 Add missing "-e" option to CI build script
This script must also fail on error.
2021-07-10 11:49:07 +02:00
Vadim Zeitlin
4c8a7e752b Use platform-appropriate way of getting CPUs number
This is simpler than parsing /sys/devices/system/cpu/online ourselves
and also works under macOS.

Reduce the number of jobs, 1.5*CPU number is too much, so use more
conservative +1 instead.

Also rename TCI_NUMTHREADS (which was another reference to Travis CI) to
just num_cpus.
2021-07-10 11:49:07 +02:00
Vadim Zeitlin
7e52b708ca Don't hardcode 3.4 Python version in the CI build script
Use python3-venv package which should work on all Ubuntu versions,
including Xenial where this script currently runs, and which doesn't
have python3.4-venv.
2021-04-07 21:30:15 +02:00
Vadim Zeitlin
721bb1aa9d Remove trailing whitespace from all files
No real changes.
2021-04-07 19:32:41 +02:00